| 245 | |
| 246 | |
| 247 | qindex accel_statevec_packAmpsIntoBuffer(Qureg qureg, vector<int> qubits, vector<int> qubitStates) { |
| 248 | |
| 249 | // we can never pack and swap buffers when there are no constrained qubit states, because we'd |
| 250 | // then fill the entire buffer andhave no room to receive the other node's buffer; caller would |
| 251 | // instead send amps straight to buffer |
| 252 | if (qubitStates.empty()) |
| 253 | error_noCtrlsGivenToBufferPacker(); |
| 254 | |
| 255 | // note qubits may incidentally be ctrls or targs; it doesn't matter |
| 256 | auto func = GET_CPU_OR_GPU_FUNC_OPTIMISED_FOR_NUM_TARGS( statevec_packAmpsIntoBuffer, qureg, qubits.size() ); |
| 257 | |
| 258 | // return the number of packed amps, for caller convenience |
| 259 | return func(qureg, qubits, qubitStates); |
| 260 | } |
| 261 | |
| 262 | |
| 263 | qindex accel_statevec_packPairSummedAmpsIntoBuffer(Qureg qureg, int qubit1, int qubit2, int qubit3, int bit2) { |
no test coverage detected