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

Function getDiagonalMatrix

tests/utils/qmatrix.cpp:41–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41qmatrix getDiagonalMatrix(qvector v) {
42 DEMAND( v.size() >= 1 );
43
44 qmatrix out = getZeroMatrix(v.size());
45
46 for (size_t i=0; i<v.size(); i++)
47 out[i][i] = v[i];
48
49 return out;
50}
51
52qmatrix getPauliMatrix(int id) {
53 DEMAND( id >= 0 );

Callers 1

SECTIONFunction · 0.85

Calls 1

getZeroMatrixFunction · 0.70

Tested by

no test coverage detected