| 151 | |
| 152 | |
| 153 | qindex 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 | |
| 170 | std::array<vector<int>,3> paulis_getSeparateInds(PauliStr str) { |
no test coverage detected