Skip to content

Commit

Permalink
Fixed incorrect behavior of scheduling benchmarks (#12524)
Browse files Browse the repository at this point in the history
* Setting conditional and reset to false as not supported in alap/asap

* removed deprecated test

* removed unused dag
  • Loading branch information
Procatv authored Jun 17, 2024
1 parent 0bca3c4 commit 864a2a3
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions test/benchmarks/scheduling_passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SchedulingPassBenchmarks:
def setup(self, n_qubits, depth):
seed = 42
self.circuit = random_circuit(
n_qubits, depth, measure=True, conditional=True, reset=True, seed=seed, max_operands=2
n_qubits, depth, measure=True, conditional=False, reset=False, seed=seed, max_operands=2
)
self.basis_gates = ["rz", "sx", "x", "cx", "id", "reset"]
self.cmap = [
Expand Down Expand Up @@ -108,15 +108,6 @@ def setup(self, n_qubits, depth):
],
dt=1e-9,
)
self.timed_dag = TimeUnitConversion(self.durations).run(self.dag)
dd_sequence = [XGate(), XGate()]
pm = PassManager(
[
ALAPScheduleAnalysis(self.durations),
PadDynamicalDecoupling(self.durations, dd_sequence),
]
)
self.scheduled_dag = pm.run(self.timed_dag)

def time_time_unit_conversion_pass(self, _, __):
TimeUnitConversion(self.durations).run(self.dag)
Expand All @@ -129,7 +120,7 @@ def time_alap_schedule_pass(self, _, __):
PadDynamicalDecoupling(self.durations, dd_sequence),
]
)
pm.run(self.timed_dag)
pm.run(self.transpiled_circuit)

def time_asap_schedule_pass(self, _, __):
dd_sequence = [XGate(), XGate()]
Expand All @@ -139,9 +130,4 @@ def time_asap_schedule_pass(self, _, __):
PadDynamicalDecoupling(self.durations, dd_sequence),
]
)
pm.run(self.timed_dag)

def time_dynamical_decoupling_pass(self, _, __):
PadDynamicalDecoupling(self.durations, dd_sequence=[XGate(), XGate()]).run(
self.scheduled_dag
)
pm.run(self.transpiled_circuit)

0 comments on commit 864a2a3

Please sign in to comment.