Skip to main contentIBM Quantum Documentation
Qiskit Transpiler Service is only available for IBM Quantum Premium Plan members.
Important

IBM Quantum Platform is moving and this version will be sunset on July 1. To get started on the new platform, read the migration guide.

TranspilerService

class qiskit_ibm_transpiler.transpiler_service.TranspilerService(optimization_level, ai='true', coupling_map=None, backend_name=None, qiskit_transpile_options=None, ai_layout_mode=None, optimization_preferences=None, use_fractional_gates=False, **kwargs)

GitHub

Bases: object

Class for using the transpiler service.

Parameters

  • optimization_level (int) – The optimization level to use during the transpilation. There are 4 optimization levels ranging from 0 to 3, where 0 is intended for not performing any optimizations and 3 spends the most effort to optimize the circuit.
  • optimization_preferences (str |list[str], optional) – Describe your preferences with a value or a list of values when prioritizing optimization. Allowed options: noise, n_cnots, n_gates, cnot_layers, layers.
  • ai (str, optional) – Specifies if the transpilation should use AI or not, defaults to True.
  • coupling_map (list[list[int]], optional) – A list of pairs that represents physical links between qubits.
  • backend_name (str, optional) – Name of the backend used for doing the transpilation.
  • qiskit_transpile_options (dict, optional) – Other options to transpile with qiskit.
  • ai_layout_mode (str, optional) – Specifies how to handle the layout selection. There are 3 layout modes: keep (respects the layout set by the previous transpiler passes), improve (uses the layout set by the previous transpiler passes as a starting point) and optimize (ignores previous layout selections).
  • use_fractional_gates (bool) –

Initializes the instance.


Methods

run

run(circuits)

GitHub

Transpile the circuit(s) by calling the service /transpile endpoint.

Parameters

circuits (List[QuantumCircuit] | QuantumCircuit) – circuit(s) to transpile.

Returns

The transpiled circuit(s)

Was this page helpful?
Report a bug or request content on GitHub.