| 650 | |
| 651 | |
| 652 | void localiser_fullstatediagmatr_setElems(FullStateDiagMatr matr, qindex startInd, qcomp* in, qindex numElems) { |
| 653 | |
| 654 | // modification of a FullStateDiagMatr is identical to that of a |
| 655 | // statevector Qureg, so we spoof an identically-deployed Qureg |
| 656 | Qureg spoof = getSpoofedBufferlessQuregFromFullStateDiagMatr(matr); |
| 657 | |
| 658 | // invoke the Qureg setter, which will modify matr's memory |
| 659 | localiser_statevec_setAmps(in, spoof, startInd, numElems); |
| 660 | |
| 661 | // note that FullStateDiagMatr needs its CPU and GPU memories |
| 662 | // to always be consistent with one another (like all matrix |
| 663 | // types), since this is a precondition assumed by accelerator.cpp. |
| 664 | // So if the above function modified GPU mem, we also trigger CPU. |
| 665 | if (spoof.isGpuAccelerated) { |
| 666 | spoof.isGpuAccelerated = 0; |
| 667 | localiser_statevec_setAmps(in, spoof, startInd, numElems); |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | |
| 672 | void localiser_fullstatediagmatr_setElemsToPauliStrSum(FullStateDiagMatr out, PauliStrSum in) { |
no test coverage detected