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

Function getMatrix

tests/utils/convert.cpp:77–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75
76
77qmatrix getMatrix(Qureg qureg) {
78 DEMAND( qureg.isDensityMatrix );
79
80 qindex numRows = 1;
81 qindex numCols = getPow2(qureg.numQubits);
82 qmatrix out = getZeroMatrix(numCols);
83
84 for (size_t r=0; r<out.size(); r++) {
85 qcomp* arr[] = {out[r].data()};
86 getDensityQuregAmps(arr, qureg, r, 0, numRows, numCols);
87
88 }
89
90 return out;
91}
92
93
94

Callers 7

REQUIRE_AGREEFunction · 0.85
getRefExpecValInnerFunction · 0.85
getReferenceMatrixFunction · 0.85
SECTIONFunction · 0.85
DYNAMIC_SECTIONFunction · 0.85
SECTIONFunction · 0.85
SECTIONFunction · 0.85

Calls 10

getPow2Function · 0.85
getDensityQuregAmpsFunction · 0.85
getMatrixInnerFunction · 0.85
paulis_getPauliAtFunction · 0.85
getPauliMatrixFunction · 0.85
getRangeFunction · 0.85
getZeroMatrixFunction · 0.70
getIdentityMatrixFunction · 0.70
getKroneckerProductFunction · 0.70

Tested by

no test coverage detected