Skip to content

Commit

Permalink
also checking decompositions for random 3q cliffords
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderivrii committed Jan 6, 2025
1 parent 8954d20 commit 97b3cc9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/python/quantum_info/operators/test_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,16 @@ def test_clifford_2q_decompositions(self):
seen.add(cliff.to_circuit().count_ops().get("cx", 0))
self.assertEqual(seen, {0, 1, 2, 3})

def test_clifford_3q_decompositions(self):
"""Test that we get all possible CX-counts for 3q-random cliffords
with sufficiently many trials.
"""
seen = set()
for seed in range(10000):
cliff = random_clifford(3, seed)
seen.add(cliff.to_circuit().count_ops().get("cx", 0))
self.assertEqual(seen, {0, 1, 2, 3, 4, 5, 6})


@ddt
class TestRandomPauliList(QiskitTestCase):
Expand Down

0 comments on commit 97b3cc9

Please sign in to comment.