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

Function localiser_fullstatediagmatr_setElems

quest/src/core/localiser.cpp:652–669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650
651
652void 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
672void localiser_fullstatediagmatr_setElemsToPauliStrSum(FullStateDiagMatr out, PauliStrSum in) {

Callers 1

setFullStateDiagMatrFunction · 0.85

Tested by

no test coverage detected