| 437 | |
| 438 | |
| 439 | int 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 |
no test coverage detected