Skip to content

Commit

Permalink
Remove stochastic swap from benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed Feb 24, 2025
1 parent 590814d commit b057980
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
6 changes: 0 additions & 6 deletions test/benchmarks/mapping_passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ def setup(self, n_qubits, depth):
self.dag = apply_pass.run(self.enlarge_dag)
self.backend_props = Fake20QV1().properties()

def time_stochastic_swap(self, _, __):
swap = StochasticSwap(self.coupling_map, seed=42)
swap.property_set["layout"] = self.layout
swap.run(self.dag)

def time_sabre_swap(self, _, __):
swap = SabreSwap(self.coupling_map, seed=42)
swap.property_set["layout"] = self.layout
Expand Down Expand Up @@ -230,7 +225,6 @@ def setup(self, n_qubits, depth):
apply_pass.property_set["layout"] = self.layout
self.dag = apply_pass.run(self.enlarge_dag)
self.backend_props = Fake20QV1().properties()
self.routed_dag = StochasticSwap(self.coupling_map, seed=42).run(self.dag)

def time_gate_direction(self, _, __):
GateDirection(self.coupling_map).run(self.routed_dag)
Expand Down
30 changes: 9 additions & 21 deletions test/benchmarks/transpiler_qualitative.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@


class TranspilerQualitativeBench:
params = ([0, 1, 2, 3], ["stochastic", "sabre"], ["dense", "sabre"])
param_names = ["optimization level", "routing method", "layout method"]
params = ([0, 1, 2, 3])
param_names = ["optimization level"]
timeout = 600

# pylint: disable=unused-argument
def setup(self, optimization_level, routing_method, layout_method):
def setup(self, optimization_level):
self.backend = Fake27QPulseV1()
self.qasm_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "qasm"))

Expand All @@ -50,62 +50,50 @@ def setup(self, optimization_level, routing_method, layout_method):
os.path.join(self.qasm_path, "time_qft_16.qasm")
)

def track_depth_transpile_4gt10_v1_81(self, optimization_level, routing_method, layout_method):
def track_depth_transpile_4gt10_v1_81(self, optimization_level):
return transpile(
self.depth_4gt10_v1_81,
self.backend,
routing_method=routing_method,
layout_method=layout_method,
optimization_level=optimization_level,
seed_transpiler=0,
).depth()

def track_depth_transpile_4mod5_v0_19(self, optimization_level, routing_method, layout_method):
def track_depth_transpile_4mod5_v0_19(self, optimization_level):
return transpile(
self.depth_4mod5_v0_19,
self.backend,
routing_method=routing_method,
layout_method=layout_method,
optimization_level=optimization_level,
seed_transpiler=0,
).depth()

def track_depth_transpile_mod8_10_178(self, optimization_level, routing_method, layout_method):
def track_depth_transpile_mod8_10_178(self, optimization_level):
return transpile(
self.depth_mod8_10_178,
self.backend,
routing_method=routing_method,
layout_method=layout_method,
optimization_level=optimization_level,
seed_transpiler=0,
).depth()

def time_transpile_time_cnt3_5_179(self, optimization_level, routing_method, layout_method):
def time_transpile_time_cnt3_5_179(self, optimization_level):
transpile(
self.time_cnt3_5_179,
self.backend,
routing_method=routing_method,
layout_method=layout_method,
optimization_level=optimization_level,
seed_transpiler=0,
)

def time_transpile_time_cnt3_5_180(self, optimization_level, routing_method, layout_method):
def time_transpile_time_cnt3_5_180(self, optimization_level):
transpile(
self.time_cnt3_5_180,
self.backend,
routing_method=routing_method,
layout_method=layout_method,
optimization_level=optimization_level,
seed_transpiler=0,
)

def time_transpile_time_qft_16(self, optimization_level, routing_method, layout_method):
def time_transpile_time_qft_16(self, optimization_level):
transpile(
self.time_qft_16,
self.backend,
routing_method=routing_method,
layout_method=layout_method,
optimization_level=optimization_level,
seed_transpiler=0,
)

0 comments on commit b057980

Please sign in to comment.