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

Function validate_expecPauliStrValueIsReal

quest/src/core/validation.cpp:4234–4247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4232 */
4233
4234void validate_expecPauliStrValueIsReal(qcomp value, bool isDensMatr, const char* caller) {
4235
4236 if (isNumericalValidationDisabled())
4237 return;
4238
4239 /// @todo include imag(value) in error message when non-integers are supported
4240
4241 string msg = (isDensMatr)?
4242 report::CALC_DENSMATR_EXPECTED_PAULI_STR_VALUE_WAS_NOT_APPROX_REAL:
4243 report::CALC_STATEVEC_EXPECTED_PAULI_STR_VALUE_WAS_NOT_APPROX_REAL;
4244
4245 qreal eps = REDUCTION_EPSILON_FACTOR * global_validationEpsilon;
4246 assertThat(util_isApproxReal(value, eps), msg, caller);
4247}
4248
4249void validate_expecPauliStrSumValueIsReal(qcomp value, bool isDensMatr, const char* caller) {
4250

Callers 1

calcExpecPauliStrFunction · 0.85

Calls 3

assertThatFunction · 0.85
util_isApproxRealFunction · 0.85

Tested by

no test coverage detected