Skip to content

Commit

Permalink
added a test case to check for compatibility with utf8 gate names
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrandhsn committed Mar 25, 2024
1 parent d9d75f9 commit b1ba9a9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/python/circuit/test_commutation_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
Reset,
LinearFunction,
SGate,
RXXGate,
)
from test import QiskitTestCase # pylint: disable=wrong-import-order

Expand Down Expand Up @@ -409,6 +410,15 @@ def test_annotated_operations_commute_with_unannotated(self):
self.assertTrue(scc.commute(op1, [0, 1], [], op3, [1], []))
self.assertTrue(scc.commute(op2, [1], [], op3, [1], []))

def test_utf8_gate_names(self):
g0 = RXXGate(1.234).to_mutable()
g0.name = "すみません"

g1 = RXXGate(2.234).to_mutable()
g1.name = "ok_0"

self.assertTrue(scc.commute(g0, [0, 1], [], g1, [1, 0], []))

def test_annotated_operations_no_commute(self):
"""Check non-commutativity involving annotated operations."""
op1 = AnnotatedOperation(XGate(), [InverseModifier(), ControlModifier(1)])
Expand Down

0 comments on commit b1ba9a9

Please sign in to comment.