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

Function parser_getPauliIntFromChar

quest/src/core/parser.cpp:439–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437
438
439int parser_getPauliIntFromChar(char ch) {
440
441 // must cover every char in parser_RECOGNISED_PAULI_CHARS
442 switch (ch) {
443 case '0': case 'i': case 'I': return 0;
444 case '1': case 'x': case 'X': return 1;
445 case '2': case 'y': case 'Y': return 2;
446 case '3': case 'z': case 'Z': return 3;
447 }
448
449 // should be unreachable after validation
450 error_attemptedToParseUnrecognisedPauliChar();
451 return -1;
452}
453
454
455

Callers 1

getPauliStrFunction · 0.85

Tested by

no test coverage detected