gulps.transpiler.GulpsDecompositionPass¶
- class gulps.transpiler.GulpsDecompositionPass(decomposer, *, cost='duration', max_depth=64)[source]¶
Bases:
TransformationPassReplace each two-qubit block of a DAG with a GULPS circuit.
The pass emits the single-qubit matrices required by each decomposition, leaving merging across blocks and translation to the single-qubit basis to Qiskit’s passes. The translation plugin includes that cleanup in its pipeline.
A Target must register each native instruction under its own
gate.name; aliases raiseNotImplementedError. Since a Target has one entry per name, it cannot register several fixed angles of the same standard gate under that name. For such instruction sets, pass aGulpsDecomposerdirectly, with all native gates and their costs.- Parameters:
decomposer (GulpsDecomposer | qiskit.transpiler.Target) – A fixed decomposer for every pair, or a Target from which to build one decomposer per distinct instruction set and cost model.
cost (str) – The Target property to minimize:
"duration"or"error".max_depth (int) – Maximum number of two-qubit gates in a sequence.
Use
costandmax_depthonly when configuring a Target.- run(dag)¶
Compile every two-qubit block in place.
- Raises:
TranspilerError – If a block is invalid for the configured gates or cannot be compiled. Its
__cause__is the original error.NotImplementedError – If the DAG has control flow, classical variables, or two-qubit gates without a matrix.
- Parameters:
dag (DAGCircuit)
- Return type: