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

Function isApproxCPTP

tests/utils/linalg.cpp:577–588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575
576
577bool isApproxCPTP(vector<qmatrix> matrices) {
578 DEMAND( matrices.size() >= 1 );
579
580 size_t dim = matrices[0].size();
581 qmatrix id = getIdentityMatrix(dim);
582 qmatrix sum = getZeroMatrix(dim);
583
584 for (auto& m : matrices)
585 sum += getConjugateTranspose(m) * m;
586
587 return doMatricesAgree(sum, id);
588}

Callers 1

getRandomKrausMapFunction · 0.85

Calls 4

doMatricesAgreeFunction · 0.85
getIdentityMatrixFunction · 0.70
getZeroMatrixFunction · 0.70
getConjugateTransposeFunction · 0.70

Tested by

no test coverage detected