Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseclectic committed Apr 24, 2020
1 parent ddb66d5 commit 090b144
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/python/quantum_info/operators/symplectic/test_clifford.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,18 @@ def test_dict_round_trip(self, num_qubits):
value = Clifford.from_dict(target.to_dict())
self.assertEqual(value, target)

def test_from_label(self):
"""Test from_label method"""
label = 'IXYZHS'
CI = Clifford(IGate())
CX = Clifford(XGate())
CY = Clifford(YGate())
CZ = Clifford(ZGate())
CH = Clifford(HGate())
CS = Clifford(SGate())
target = CI.tensor(CX).tensor(CY).tensor(CZ).tensor(CH).tensor(CS)
self.assertEqual(Clifford.from_label(label), target)


if __name__ == '__main__':
unittest.main()

0 comments on commit 090b144

Please sign in to comment.