Skip to content

Commit

Permalink
Merge pull request #207 from dlyongemallo/basic_optimization_to_basic…
Browse files Browse the repository at this point in the history
…_gates

Add helpful suggestion to `parse_gate` when called with non-basic gate.
  • Loading branch information
jvdwetering committed Apr 17, 2024
2 parents e701d74 + 2feea75 commit 3a6a878
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyzx/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,9 @@ def parse_gate(self, g: Gate) -> None:
else: # Only the control has a hadamard gate in front of it
self.add_hadamard(c)
self.add_cnot(g)

else:
raise TypeError("Unknown gate {}".format(str(g)))
raise TypeError("Unknown gate {}. Maybe simplify the gates with circuit.to_basic_gates()?".format(str(g)))



Expand Down

0 comments on commit 3a6a878

Please sign in to comment.