gulps.transpiler.GulpsDecompositionPass

class gulps.transpiler.GulpsDecompositionPass(decomposer, *, cost='duration', max_depth=64)[source]

Bases: TransformationPass

Replace 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 raise NotImplementedError. 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 a GulpsDecomposer directly, 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 cost and max_depth only 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:

DAGCircuit