| 575 | |
| 576 | |
| 577 | bool 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 | } |
no test coverage detected