Synthesize gates according to their basis gates.
Synthesize unitaries over some basis gates.
This pass can approximate 2-qubit unitaries given some gate fidelities (either via
target). More approximation can be forced by setting a heuristic dial
- basis_gates (list (opens in a new tab)[str (opens in a new tab)]) – List of gate names to target. If this is not specified the
targetargument must be used. If both this and the
targetare specified the value of
targetwill be used and this will be ignored.
- approximation_degree (float (opens in a new tab)) – heuristic dial used for circuit approximation (1.0=no approximation, 0.0=maximal approximation). Approximation can make the synthesized circuit cheaper at the cost of straying from the original unitary. If None, approximation is done based on gate fidelities.
- coupling_map (CouplingMap) – the coupling map of the backend in case synthesis is done on a physical circuit. The directionality of the coupling_map will be taken into account if
- backend_props (BackendProperties) – Properties of a backend to synthesize for (e.g. gate fidelities).
- pulse_optimize (bool (opens in a new tab)) – Whether to optimize pulses during synthesis. A value of
Nonewill attempt it but fall back if it does not succeed. A value of
Truewill raise an error if pulse-optimized synthesis does not succeed.
- natural_direction (bool (opens in a new tab)) – Whether to apply synthesis considering directionality of 2-qubit gates. Only applies when
None. The natural direction is determined by first checking to see whether the coupling map is unidirectional. If there is no coupling map or the coupling map is bidirectional, the gate direction with the shorter duration from the backend properties will be used. If set to True, and a natural direction can not be determined, raises
TranspilerError. If set to None, no exception will be raised if a natural direction can not be determined.
- synth_gates (list (opens in a new tab)[str (opens in a new tab)]) – List of gates to synthesize. If None and
pulse_optimizeis False or None, default to
pulse_optimize == True, default to
- method (str (opens in a new tab)) – The unitary synthesis method plugin to use.
- min_qubits – The minimum number of qubits in the unitary to synthesize. If this is set and the unitary is less than the specified number of qubits it will not be synthesized.
- plugin_config – Optional extra configuration arguments (as a
dict) which are passed directly to the specified unitary synthesis plugin. By default, this will have no effect as the default plugin has no extra arguments. Refer to the documentation of your unitary synthesis plugin on how to use this.
- target – The optional
Targetfor the target device the pass is compiling for. If specified this will supersede the values set for
Check if the pass is an analysis pass.
If the pass is an AnalysisPass, that means that the pass can analyze the DAG and write the results of that analysis in the property set. Modifications on the DAG are not allowed by this kind of pass.
Check if the pass is a transformation pass.
If the pass is a TransformationPass, that means that the pass can manipulate the DAG, but cannot modify the property set (but it can be read).
execute(passmanager_ir, state, callback=None)
Execute optimization task for input Qiskit IR.
- passmanager_ir (Any (opens in a new tab)) – Qiskit IR to optimize.
- state (PassManagerState) – State associated with workflow execution by the pass manager itself.
- callback (Callable (opens in a new tab) | None) – A callback function which is caller per execution of optimization task.
Optimized Qiskit IR and state of the workflow.
Name of the pass.
Run the UnitarySynthesis pass on
dag (DAGCircuit) – input dag.
Output dag with UnitaryGates synthesized to target basis.
Update workflow status.
- state (PassManagerState) – Pass manager state to update.
- run_state (RunState) – Completion status of current task.
Updated pass manager state.