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

Function isApproxUnitary

tests/utils/linalg.cpp:250–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248
249
250bool isApproxUnitary(qmatrix m) {
251
252 // should be identity
253 qmatrix md = m * getConjugateTranspose(m);
254 qmatrix id = getIdentityMatrix(m.size());
255 return doMatricesAgree(md, id);
256}
257
258
259qcomp getTrace(qmatrix m) {

Callers 1

getRandomUnitaryFunction · 0.85

Calls 3

doMatricesAgreeFunction · 0.85
getConjugateTransposeFunction · 0.70
getIdentityMatrixFunction · 0.70

Tested by

no test coverage detected