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

Function validate_basisStateIndex

quest/src/core/validation.cpp:3415–3425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3413 */
3414
3415void validate_basisStateIndex(Qureg qureg, qindex ind, const char* caller) {
3416
3417 qindex maxIndExcl = powerOf2(qureg.numQubits);
3418
3419 tokenSubs vars = {
3420 {"${STATE_IND}", ind},
3421 {"${NUM_QB}", qureg.numQubits},
3422 {"${NUM_STATES}", maxIndExcl}};
3423
3424 assertThat(ind >= 0 && ind < maxIndExcl, report::INVALID_BASIS_STATE_INDEX, vars, caller);
3425}
3426
3427void validate_basisStateRowCol(Qureg qureg, qindex row, qindex col, const char* caller) {
3428

Callers 3

getQuregAmpFunction · 0.85
calcProbOfBasisStateFunction · 0.85
initClassicalStateFunction · 0.85

Calls 2

powerOf2Function · 0.85
assertThatFunction · 0.85

Tested by

no test coverage detected