| 878 | |
| 879 | |
| 880 | void 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 |
no test coverage detected