iqm.pulla.utils_qiskit.parallelize_and_transpile

iqm.pulla.utils_qiskit.parallelize_and_transpile#

iqm.pulla.utils_qiskit.parallelize_and_transpile(circuits, components, context, perform_move_routing=True, optimize_single_qubits=True, ignore_barriers_in_1qb_optimization=False, remove_final_rzs=True, existing_moves_handling=None, optimization_level=0, seed_transpiler=None, num_processes=None)#

Transpile Qiskit circuits and parallelize them if colour grouped components were inputted.

Parameters:
  • circuits (list[QuantumCircuit]) – List of Qiskit QuantumCircuit objects to transpile and potentially parallelize.

  • components (ComponentGrouping | None) – List of (physical) components on which to transpile (route) the circuits. If a flat list of components is provided, the IQMTarget will be built only on that subset of the full QPU. If colour grouped components (i.e. of the form list[list[tuple(str, ...)]]) is provided, the circuits will be parallelized such that each colour group becomes its own circuit, and the circuit will be broadcasted to parallel groups within a colour group, i.e. executed parallelly. If None is provided, the default target for the full QPU will be used.

  • context (dict[str, Any]) – The Compiler context.

  • perform_move_routing (bool) – Whether to perform MOVE gate routing.

  • optimize_single_qubits (bool) – Whether to optimize single qubit gates away.

  • ignore_barriers_in_1qb_optimization (bool) – Whether to ignore barriers when optimizing single qubit gates.

  • remove_final_rzs (bool) – Whether to remove the final z rotations.

  • existing_moves_handling (str | None) – How to handle existing MOVE gates in the circuit, required if the circuit contains MOVE gates.

  • optimization_level (int) – The optimization level of the Qiskit transpiler.

  • seed_transpiler (int | None) – The seed of the Qiskit transpiler.

  • num_processes (int | None) – The number of parallel processes to use.

Returns:

Transpiled and possibly parallelized circuits. The circuit(s) in each inner list are executed in parallel. If there is no parallelization, each inner list has just one item.

Return type:

list[list[QuantumCircuit]]