| 2441 | void validate_matrixIsUnitary(FullStateDiagMatr m, const char* caller) { assertMatrixIsUnitary(m, caller); } |
| 2442 | |
| 2443 | void validate_unitaryExponentIsReal(qcomp exponent, const char* caller) { |
| 2444 | |
| 2445 | // this validation always checks that 'exponent' is only |
| 2446 | // approximately real, permitting non-zero imaginary |
| 2447 | // component. Functions which require a strictly real |
| 2448 | // exponent never call this; they accept 'qreal' exponents. |
| 2449 | |
| 2450 | if (isNumericalValidationDisabled()) |
| 2451 | return; |
| 2452 | |
| 2453 | // assesses diag^expo unitarity for any unitary diag |
| 2454 | assertThat(util_isApproxReal(exponent, global_validationEpsilon), report::UNITARY_DIAG_MATR_EXPONENT_NOT_APPROX_REAL, caller); |
| 2455 | } |
| 2456 | |
| 2457 | // type T can be CompMatr1, CompMatr2, CompMatr, DiagMatr1, DiagMatr2, DiagMatr, FullStateDiagMatr |
| 2458 | template <class T> |
no test coverage detected