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

Function isDiagonal

tests/utils/linalg.cpp:239–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237
238
239bool isDiagonal(qmatrix m) {
240
241 for (size_t r=0; r<m.size(); r++)
242 for (size_t c=0; c<m.size(); c++)
243 if (r!=c && m[r][c] != 0_i)
244 return false;
245
246 return true;
247}
248
249
250bool isApproxUnitary(qmatrix m) {

Callers 2

getPowerOfDiagonalMatrixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected