TranspilerService
class qiskit_transpiler_service.transpiler_service.TranspilerService(optimization_level, ai='true', coupling_map=None, backend_name=None, qiskit_transpile_options=None, ai_layout_mode=None, **kwargs)
Bases: object
(opens in a new tab)
Class for using the transpiler service.
Parameters
- optimization_level (int(opens in a new tab)) – 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.
- ai (str(opens in a new tab), optional) – Specifies if the transpilation should use AI or not, defaults to True.
- coupling_map (list(opens in a new tab)[list(opens in a new tab)[int(opens in a new tab)]], optional) – A list of pairs that represents physical links between qubits.
- backend_name (str(opens in a new tab), optional) – Name of the backend used for doing the transpilation.
- qiskit_transpile_options (dict(opens in a new tab), optional) – Other options to transpile with qiskit.
- ai_layout_mode (str(opens in a new tab), 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).
Methods
run
run(circuits)
Transpile the circuit(s) by calling the service /transpile endpoint.
Parameters
circuits (List(opens in a new tab)[str(opens in a new tab) |QuantumCircuit] | str(opens in a new tab) |QuantumCircuit) – circuit(s) to transpile.
Returns
The transpiled circuit(s)