Skip to content

Commit

Permalink
Fix test_linear_synthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarun-Kumar07 committed Apr 17, 2024
1 parent 0e81d05 commit b254b3b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/python/synthesis/test_linear_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,19 @@ def test_example_circuit(self):
qc.cx(1, 0)
mat = LinearFunction(qc).linear

optimized_qc = optimize_cx_4_options(synth_cnot_count_full_pmh, mat, optimize_count=True)
synth_cnot_pmh_section_size_2 = lambda state: synth_cnot_count_full_pmh(
state, section_size=2
)

optimized_qc = optimize_cx_4_options(
synth_cnot_pmh_section_size_2, mat, optimize_count=True
)
self.assertEqual(optimized_qc.depth(), 17)
self.assertEqual(optimized_qc.count_ops()["cx"], 20)

optimized_qc = optimize_cx_4_options(synth_cnot_count_full_pmh, mat, optimize_count=False)
optimized_qc = optimize_cx_4_options(
synth_cnot_pmh_section_size_2, mat, optimize_count=False
)
self.assertEqual(optimized_qc.depth(), 15)
self.assertEqual(optimized_qc.count_ops()["cx"], 23)

Expand Down

0 comments on commit b254b3b

Please sign in to comment.