| 50 | } |
| 51 | |
| 52 | qmatrix getPauliMatrix(int id) { |
| 53 | DEMAND( id >= 0 ); |
| 54 | DEMAND( id <= 3 ); |
| 55 | |
| 56 | if (id == 0) |
| 57 | return {{1 ,0}, {0, 1}}; |
| 58 | |
| 59 | if (id == 1) |
| 60 | return {{0, 1}, {1, 0}}; |
| 61 | |
| 62 | if (id == 2) |
| 63 | return {{0, -1_i}, {1_i, 0}}; |
| 64 | |
| 65 | if (id == 3) |
| 66 | return {{1, 0}, {0, -1}}; |
| 67 | |
| 68 | // unreachable |
| 69 | return {{-1}}; |
| 70 | } |
| 71 | |
| 72 | |
| 73 | /* |
no outgoing calls
no test coverage detected