Skip to content

Commit

Permalink
Merge pull request #206 from dlyongemallo/full_optimize_not_clifford
Browse files Browse the repository at this point in the history
Add helpful suggestion when calling `full_optimize` with non-Clifford+T circuit.
  • Loading branch information
jvdwetering authored Apr 18, 2024
2 parents 0cbffeb + 72e150c commit 4e1ab6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyzx/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def phase_block_optimize(circuit: Circuit, pre_optimize:bool=True, quiet:bool=Tr
if not isinstance(g, ZPhase):
raise TypeError("Unknown gate {}. Maybe simplify the gates with circuit.to_basic_gates()?".format(str(g)))
elif g.phase.denominator not in (1,2,4):
raise TypeError("This method only works on Clifford+T circuits. This circuit contains a {}".format(str(g)))
raise TypeError("This method only works on Clifford+T circuits. This circuit contains a {}. For these circuits, stick to basic_optimization().".format(str(g)))
gates[g.target].append(g)
else:
gates[g.target].append(g)
Expand Down

0 comments on commit 4e1ab6e

Please sign in to comment.