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

Function populateSingleColumnQcompmatr

quest/src/core/printer.cpp:880–892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

878
879
880void populateSingleColumnQcompmatr(qcompmatr &matr, qindex startInd, PauliStrSum sum) {
881
882 // matr is single-column, and has been prior resized such that
883 // even before population, matr.size() is non-zero unless it is
884 // intended to stay empty
885 size_t numCoeffs = matr.size(); // numRows
886 if (numCoeffs == 0)
887 return;
888
889 // serially copy the CPU-only, non-distributed coefficients
890 for (size_t i=0; i<numCoeffs; i++)
891 matr[i][0] = sum.coeffs[startInd + i];
892}
893
894
895// T can be any 1D type, i.e. Qureg (.isDensity=0), FullStateDiagMatr, DiagMatr1, DiagMatr2, DiagMatr

Callers 1

populateMatrixQuadrantsFunction · 0.85

Calls 6

util_tryAllocVectorFunction · 0.85
util_getGpuMemPtrFunction · 0.85
mem_isAllocatedFunction · 0.85
gpu_copyGpuToCpuFunction · 0.85

Tested by

no test coverage detected