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

Function assertRecognisedNewPaulis

quest/src/core/validation.cpp:3128–3145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3126}
3127
3128void assertRecognisedNewPaulis(const char* paulis, int numPaulis, const char* caller) {
3129
3130 // paulis might also contain '\0' char (string termination),
3131 // but not before numPaulis (as prior validated)
3132
3133 for (int i=0; i<numPaulis; i++) {
3134
3135 /// @todo we can only display the ascii code of unrecognised characters,
3136 /// because tokenSubs only accepts integers (not chars/substrings). Fix this!
3137 char ch = paulis[i];
3138 int ascii = (int) ch;
3139
3140 assertThat(
3141 parser_RECOGNISED_PAULI_CHARS.find(ch) != string::npos,
3142 report::NEW_PAULI_STR_UNRECOGNISED_PAULI_CHAR,
3143 {{"${BAD_CHAR}", ascii}, {"${CHAR_IND}", i}}, caller);
3144 }
3145}
3146
3147void assertValidNewPauliCodes(int* paulis, int numPaulis, const char* caller) {
3148

Callers 1

Calls 1

assertThatFunction · 0.85

Tested by

no test coverage detected