MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / accel_statevec_packAmpsIntoBuffer

Function accel_statevec_packAmpsIntoBuffer

quest/src/core/accelerator.cpp:247–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245
246
247qindex 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
263qindex accel_statevec_packPairSummedAmpsIntoBuffer(Qureg qureg, int qubit1, int qubit2, int qubit3, int bit2) {

Calls 1

Tested by

no test coverage detected