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

Function assertValidNewPauliIndices

quest/src/core/validation.cpp:3159–3171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3157}
3158
3159void assertValidNewPauliIndices(int* indices, int numInds, int maxIndExcl, const char* caller) {
3160
3161 // check each index is valid
3162 for (int i=0; i<numInds; i++) {
3163 int ind = indices[i];
3164 assertThat(
3165 ind >= 0 && ind < maxIndExcl, report::NEW_PAULI_STR_INVALID_INDEX,
3166 {{"${BAD_IND}", ind}, {"${MAX_PAULIS}", maxIndExcl}}, caller);
3167 }
3168
3169 // check no index is duplicated
3170 assertThat(isIndexListUnique(indices, numInds), report::NEW_PAULI_STR_DUPLICATED_INDEX, caller);
3171}
3172
3173void validate_newPauliStrNumPaulis(int numPaulis, int maxNumPaulis, const char* caller) {
3174

Callers 1

Calls 2

assertThatFunction · 0.85
isIndexListUniqueFunction · 0.85

Tested by

no test coverage detected