Skip to content

Commit

Permalink
Update test_passmanager.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrandhsn committed Sep 5, 2024
1 parent f3224b3 commit 92f9fbd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/python/transpiler/test_passmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
DoWhileController,
)
from qiskit.transpiler import PassManager, PropertySet, TransformationPass
from qiskit.transpiler.passes import CommutativeCancellation
from qiskit.transpiler.passes import CommutativeCancellation, RXCalibrationBuilder
from qiskit.transpiler.passes import Optimize1qGates, BasisTranslator
from qiskit.circuit.library.standard_gates.equivalence_library import (
StandardEquivalenceLibrary as std_eqlib,
)
from qiskit.transpiler.passes.scheduling.scheduling.base_scheduler import BaseScheduler
from test import QiskitTestCase # pylint: disable=wrong-import-order


Expand Down Expand Up @@ -107,20 +108,19 @@ def callback(**kwargs):
calls.append(out_dict)

passmanager = PassManager()
passmanager.append(CommutativeCancellation(basis_gates=["u1", "u2", "u3", "cx"]))
passmanager.append(RXCalibrationBuilder())
passmanager.run(circuit, callback=callback)
self.assertEqual(len(calls), 2)
self.assertEqual(len(calls[0]), 5)
self.assertEqual(calls[0]["count"], 0)
self.assertEqual(calls[0]["pass_"].name(), "CommutationAnalysis")
self.assertEqual(calls[0]["pass_"].name(), "NormalizeRXAngle")
self.assertEqual(expected_start_dag, calls[0]["dag"])
self.assertIsInstance(calls[0]["time"], float)
self.assertIsInstance(calls[0]["property_set"], PropertySet)
self.assertEqual("MyCircuit", calls[0]["dag"].name)
self.assertEqual(len(calls[1]), 5)
self.assertEqual(calls[1]["count"], 1)
self.assertEqual(calls[1]["pass_"].name(), "CommutativeCancellation")
self.assertEqual(expected_end_dag, calls[1]["dag"])
self.assertEqual(calls[1]["pass_"].name(), "RXCalibrationBuilder")
self.assertIsInstance(calls[0]["time"], float)
self.assertIsInstance(calls[0]["property_set"], PropertySet)
self.assertEqual("MyCircuit", calls[1]["dag"].name)
Expand Down

0 comments on commit 92f9fbd

Please sign in to comment.