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

Function validate_measurementProbsAreNormalised

quest/src/core/validation.cpp:3749–3759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3747}
3748
3749void validate_measurementProbsAreNormalised(vector<qreal> probs, const char* caller) {
3750
3751 if (isNumericalValidationDisabled())
3752 return;
3753
3754 /// @todo include 'total' in validation msg once supported
3755
3756 qreal total = util_getSum(probs);
3757 qreal dist = std::abs(total - 1);
3758 assertThat(dist <= global_validationEpsilon, report::OUTCOME_PROBS_DO_NOT_SUM_TO_ONE, caller);
3759}
3760
3761void validate_measurementOutcomesMatchTargets(int numQubits, int numOutcomes, const char* caller) {
3762

Calls 3

util_getSumFunction · 0.85
assertThatFunction · 0.85

Tested by

no test coverage detected