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

Function getPauliStrAsAllQubitsString

quest/src/core/printer.cpp:1264–1277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1262
1263
1264string 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
1280string getPauliStrAsIndexString(PauliStr str, int numPaulis) {

Callers 1

getPauliStrAsStringFunction · 0.85

Calls 1

paulis_getPauliAtFunction · 0.85

Tested by

no test coverage detected