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

Function validate_unitaryExponentIsReal

quest/src/core/validation.cpp:2443–2455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2441void validate_matrixIsUnitary(FullStateDiagMatr m, const char* caller) { assertMatrixIsUnitary(m, caller); }
2442
2443void 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
2458template <class T>

Calls 3

assertThatFunction · 0.85
util_isApproxRealFunction · 0.85

Tested by

no test coverage detected