Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Commit

Permalink
Add seed to all transpiler benchmarks (#1405)
Browse files Browse the repository at this point in the history
Fill in a missing seed for all benchmarks that need one.

Fixes #1404
  • Loading branch information
jakelishman authored Jan 25, 2022
1 parent be8b950 commit 3232143
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion test/benchmarks/qft.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ def time_ibmq_backend_transpile(self, _):
[13, 12]]
transpile(self.circuit,
basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
coupling_map=coupling_map)
coupling_map=coupling_map,
seed_transpiler=20220125)
3 changes: 2 additions & 1 deletion test/benchmarks/quantum_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ def time_ibmq_backend_transpile(self, _, translation):
transpile(self.circuit,
basis_gates=self.basis,
coupling_map=self.coupling_map,
translation_method=translation)
translation_method=translation,
seed_transpiler=20220125)
6 changes: 4 additions & 2 deletions test/benchmarks/ripple_adder.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ def time_transpile_square_grid_ripple_adder(self, _, level):
transpile(self.circuit,
coupling_map=self.coupling_map,
basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
optimization_level=level)
optimization_level=level,
seed_transpiler=20220125)

def track_depth_transpile_square_grid_ripple_adder(self, _, level):
return transpile(self.circuit,
coupling_map=self.coupling_map,
basis_gates=['u1', 'u2', 'u3', 'cx', 'id'],
optimization_level=level).depth()
optimization_level=level,
seed_transpiler=20220125).depth()
9 changes: 6 additions & 3 deletions test/benchmarks/transpiler_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,20 @@ def setup(self):
def time_single_gate_compile(self):
circ = qiskit.compiler.transpile(self.single_gate_circuit,
coupling_map=self.coupling_map,
basis_gates=self.basis)
basis_gates=self.basis,
seed_transpiler=20220125)
qiskit.compiler.assemble(circ)

def time_cx_compile(self):
circ = qiskit.compiler.transpile(self.cx_circuit,
coupling_map=self.coupling_map,
basis_gates=self.basis)
basis_gates=self.basis,
seed_transpiler=20220125)
qiskit.compiler.assemble(circ)

def time_compile_from_large_qasm(self):
circ = qiskit.compiler.transpile(self.large_qasm,
coupling_map=self.coupling_map,
basis_gates=self.basis)
basis_gates=self.basis,
seed_transpiler=20220125)
qiskit.compiler.assemble(circ)

0 comments on commit 3232143

Please sign in to comment.