| 3439 | } |
| 3440 | |
| 3441 | void validate_basisStateIndices(Qureg qureg, qindex startInd, qindex numInds, const char* caller) { |
| 3442 | |
| 3443 | assertThat( |
| 3444 | startInd >= 0 && startInd < qureg.numAmps, |
| 3445 | report::INVALID_STARTING_BASIS_STATE_INDEX, |
| 3446 | {{"${START_IND}", startInd}, {"${MAX_IND_EXCL}", qureg.numAmps}, {"${NUM_QB}", qureg.numQubits}}, |
| 3447 | caller); |
| 3448 | |
| 3449 | // permit numInds=0 |
| 3450 | assertThat( |
| 3451 | numInds >= 0 && numInds <= qureg.numAmps, |
| 3452 | report::INVALID_NUM_BASIS_STATE_INDICES, |
| 3453 | {{"${NUM_INDS}", numInds}, {"${MAX_NUM_INDS_INCL}", qureg.numAmps}, {"${NUM_QB}", qureg.numQubits}}, caller); |
| 3454 | |
| 3455 | qindex endIndExcl = startInd + numInds; |
| 3456 | tokenSubs vars = { |
| 3457 | {"${NUM_QB}", qureg.numQubits}, |
| 3458 | {"${START_IND}", startInd}, |
| 3459 | {"${NUM_INDS}", numInds}, |
| 3460 | {"${MAX_IND_EXCL}", qureg.numAmps}, |
| 3461 | {"${END_IND_EXCL}", endIndExcl}}; |
| 3462 | |
| 3463 | assertThat( |
| 3464 | endIndExcl <= qureg.numAmps, |
| 3465 | report::INVALID_ENDING_BASIS_STATE_INDEX, |
| 3466 | vars, caller); |
| 3467 | } |
| 3468 | |
| 3469 | void validate_basisStateRowCols(Qureg qureg, qindex startRow, qindex startCol, qindex numRows, qindex numCols, const char* caller) { |
| 3470 |
no test coverage detected