From 72e150c6dca5817ac8b91416b57151de15988367 Mon Sep 17 00:00:00 2001 From: David Yonge-Mallo Date: Sat, 6 Apr 2024 09:31:40 +0200 Subject: [PATCH] Add helpful suggestion when calling `full_optimize` with non-Clifford+T circuit. See #198 for context. --- pyzx/optimize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyzx/optimize.py b/pyzx/optimize.py index f047111c..2c8e4b8b 100644 --- a/pyzx/optimize.py +++ b/pyzx/optimize.py @@ -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)