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)
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) –
Methods
run
run(circuits)
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.