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

Function paulis_getTargetBitMask

quest/src/core/paulilogic.cpp:153–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152
153qindex paulis_getTargetBitMask(PauliStr str) {
154
155 /// @todo
156 /// would compile-time MAX_NUM_PAULIS_PER_STR bound be faster here,
157 /// since this function is invoked upon every PauliStrSum element?
158 int maxInd = paulis_getIndOfLefmostNonIdentityPauli(str);
159
160 qindex mask = 0;
161
162 for (int i=0; i<=maxInd; i++)
163 if (paulis_getPauliAt(str, i) != 0) // Id
164 mask = flipBit(mask, i);
165
166 return mask;
167}
168
169
170std::array<vector<int>,3> paulis_getSeparateInds(PauliStr str) {

Calls 3

paulis_getPauliAtFunction · 0.85
flipBitFunction · 0.85

Tested by

no test coverage detected