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

Add overall transpilation time bench with scheduling #1441

Merged
merged 2 commits into from
Mar 11, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions test/benchmarks/transpiler_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from qiskit.compiler import transpile
from qiskit import QuantumCircuit
from qiskit.transpiler import InstructionDurations

from .backends.fake_melbourne import FakeMelbourne
from .utils import build_qv_model_circuit
Expand Down Expand Up @@ -155,6 +156,14 @@ def setup(self, _):
large_qasm_path = os.path.join(self.qasm_path, 'test_eoh_qasm.qasm')
self.large_qasm = QuantumCircuit.from_qasm_file(large_qasm_path)
self.melbourne = FakeMelbourne()
self.durations = InstructionDurations([
("u1", None, 0),
("id", None, 160),
("u2", None, 160),
("u3", None, 320),
("cx", None, 800),
("measure", None, 3200),
], dt=1e-9)

def time_quantum_volume_transpile_50_x_20(self, transpiler_level):
transpile(self.qv_50_x_20, basis_gates=self.basis_gates,
Expand Down Expand Up @@ -197,3 +206,10 @@ def time_transpile_qv_14_x_14(self, transpiler_level):
def track_depth_transpile_qv_14_x_14(self, transpiler_level):
return transpile(self.qv_14_x_14, self.melbourne, seed_transpiler=0,
optimization_level=transpiler_level).depth()

def time_schedule_qv_14_x_14(self, transpiler_level):
if transpiler_level <= 1:
itoko marked this conversation as resolved.
Show resolved Hide resolved
transpile(self.qv_14_x_14, self.melbourne, seed_transpiler=0,
optimization_level=transpiler_level,
scheduling_method="alap",
instruction_durations=self.durations)