Skip to content

Commit

Permalink
Merge pull request #187 from UCL-CCS/ind_op_fix
Browse files Browse the repository at this point in the history
IndependentOp now respects term ordering under rotation onto single-q…
  • Loading branch information
TimWeaving authored Apr 26, 2024
2 parents 0a2b968 + 53d8155 commit ffc1d79
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion symmer/operators/independent_op.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
import warnings
from functools import reduce
from typing import Dict, List, Tuple, Union
from symmer import process
from symmer.operators.utils import _rref_binary, _cref_binary, check_independent
Expand Down Expand Up @@ -307,7 +308,12 @@ def rotate_onto_single_qubit_paulis(self) -> "IndependentOp":
"""
self.generate_stabilizer_rotations()
if self.stabilizer_rotations != []:
return self.perform_rotations(self.stabilizer_rotations)
return IndependentOp.from_PauliwordOp(
reduce(
lambda x,y:x.append(y),
[s.perform_rotations(self.stabilizer_rotations) for s in self]
)
) # ensures stabilizer ordering is correct
else:
return self

Expand Down

0 comments on commit ffc1d79

Please sign in to comment.