| 1262 | |
| 1263 | |
| 1264 | string getPauliStrAsAllQubitsString(PauliStr str, int numPaulis) { |
| 1265 | |
| 1266 | // avoid repeated allocations in below string concatenation |
| 1267 | string out = ""; |
| 1268 | out.reserve(numPaulis); |
| 1269 | |
| 1270 | // ugly but adequate - like me (call me) |
| 1271 | for (int i=numPaulis-1; i>=0; i--) { |
| 1272 | int code = paulis_getPauliAt(str, i); // 0123 |
| 1273 | out += global_pauliChars[code]; // IXYZ unless user-overriden |
| 1274 | } |
| 1275 | |
| 1276 | return out; |
| 1277 | } |
| 1278 | |
| 1279 | |
| 1280 | string getPauliStrAsIndexString(PauliStr str, int numPaulis) { |
no test coverage detected