iqm.benchmarks.utils.perform_backend_transpilation

iqm.benchmarks.utils.perform_backend_transpilation#

iqm.benchmarks.utils.perform_backend_transpilation(qc_list: list[IQMCircuit], backend: IQMBackendBase, qubits: Sequence[int], coupling_map: list[list[int]], basis_gates: Sequence[str] = ('r', 'cz'), qiskit_optim_level: int = 1, optimize_sqg: bool = False, drop_final_rz: bool = True, routing_method: RoutingMethod | None = RoutingMethod.SABRE, approximation_degree: float = 1.0, initial_layout: Sequence[int] | None = None) → list[IQMCircuit]#

Transpile a list of circuits to backend specifications.

Parameters:
  • qc_list (list[IQMCircuit]) – The original (untranspiled) list of quantum circuits.

  • backend (IQMBackendBase) – The backend to execute the benchmark on.

  • qubits (Sequence[int]) – The qubits to target in the transpilation.

  • coupling_map (list[list[int]]) – The target coupling map to transpile to.

  • basis_gates (Sequence[str]) – The basis gates.

  • qiskit_optim_level (int) – Qiskit “optimization_level” value.

  • optimize_sqg (bool) – Whether SQG optimization is performed taking into account virtual Z.

  • drop_final_rz (bool) – Whether the SQG optimizer drops a final RZ gate.

  • routing_method (RoutingMethod | None) – The routing method employed by Qiskit’s transpilation pass.

  • approximation_degree (float) – How much the transpiler is allowed to approximate the original circuit in terms of lower gate counts and depth. 1.0 means no deviation allowed, 0.0 means maximum deviation allowed.

  • initial_layout (Sequence[int] | None) – Where to place the circuit’s logical qubits, as indices into coupling_map, so the transpiler does not have to search for a layout. With a reduced (fixed-layout) coupling map its node j is qubits[j], so a caller that knows which physical qubit each logical qubit belongs on passes those positions within qubits. If None, the identity layout is used when the circuit’s 2-qubit gates are already couplings, and otherwise the transpiler searches as before.

Returns:

A list of transpiled quantum circuits.

Raises:

ValueError – if Star topology and label 0 is in qubit layout.

Return type:

list[IQMCircuit]