PassManagerConfig
class qiskit.transpiler.PassManagerConfig(initial_layout=None, basis_gates=None, coupling_map=None, layout_method=None, routing_method=None, translation_method=None, scheduling_method=None, instruction_durations=None, approximation_degree=None, seed_transpiler=None, timing_constraints=None, unitary_synthesis_method='default', unitary_synthesis_plugin_config=None, target=None, hls_config=None, init_method=None, optimization_method=None, qubits_initially_zero=True)
Bases: object
Pass Manager Configuration.
Initialize a PassManagerConfig object
Parameters
- initial_layout (Layout | None) – Initial position of virtual qubits on physical qubits.
- basis_gates (list[str] | None) – List of basis gate names to unroll to.
- coupling_map (CouplingMap | None) – Directed graph representing a coupling map.
- layout_method (str | None) – the pass to use for choosing initial qubit placement. This will be the plugin name if an external layout stage plugin is being used.
- routing_method (str | None) – the pass to use for routing qubits on the architecture. This will be a plugin name if an external routing stage plugin is being used.
- translation_method (str | None) – the pass to use for translating gates to basis_gates. This will be a plugin name if an external translation stage plugin is being used.
- scheduling_method (str | None) – the pass to use for scheduling instructions. This will be a plugin name if an external scheduling stage plugin is being used.
- instruction_durations (InstructionDurations | None) – Dictionary of duration (in dt) for each instruction.
- approximation_degree (float | None) – Heuristic dial used for circuit approximation, where
1.0means no approximation (up to numerical tolerance) and0.0means the maximum approximation. Iftargetis available, a value ofNoneindicates that approximation is allowed up to the reported error rate for an operation in the target. - seed_transpiler (int | None) – Sets random seed for the stochastic parts of the transpiler.
- timing_constraints (TimingConstraints | None) – Hardware time alignment restrictions.
- unitary_synthesis_method (str) – The string method to use for the
UnitarySynthesispass. Will search installed plugins for a valid method. You can see a list of installed plugins withunitary_synthesis_plugin_names(). - unitary_synthesis_plugin_config (dict | None) – The configuration dictionary that will be passed to the specified unitary synthesis plugin. Refer to the plugin documentation for how to use this.
- target (Target | None) – The backend target
- hls_config (HLSConfig | None) – An optional configuration class to use for
HighLevelSynthesispass. Specifies how to synthesize various high-level objects. - init_method (str | None) – The plugin name for the init stage plugin to use
- optimization_method (str | None) – The plugin name for the optimization stage plugin to use.
- qubits_initially_zero (bool) – Indicates whether the input circuit is zero-initialized.
Methods
from_backend
classmethod from_backend(backend, _skip_target=False, **pass_manager_options)
Construct a configuration based on a backend and user input.
This method automatically generates a PassManagerConfig object based on the backend’s features. User options can be used to overwrite the configuration.
Parameters
- backend (BackendV2) – The backend that provides the configuration.
- pass_manager_options – User-defined option-value pairs.
Returns
The configuration generated based on the arguments.
Return type
Raises
AttributeError – If the backend does not support a configuration() method.