Circuit Padding

Circuit padding utilities for applying dynamical decoupling sequences.

This module handles the insertion of DD pulses into quantum circuits during idle periods following the approach described in the paper.

class gadd.circuit_padding.DDPulse(gate_name: str, qubit: int, time: float)[source]

Bases: object

Represents a dynamical decoupling pulse with timing and gate information.

This class encapsulates the information needed to represent a single DD pulse within a quantum circuit, including the gate type, target qubit, and timing information. It provides conversion methods to transform the pulse representation into Qiskit gate objects for circuit construction.

Parameters:
  • gate_name – Name of the gate to apply (e.g., “X”, “Y”, “Xp”, “Ym”).

  • qubit – Index of the target qubit for this pulse.

  • time – Timing information for when this pulse should be applied.

__init__(gate_name: str, qubit: int, time: float)[source]
to_gate() Gate[source]

Convert gate name to Qiskit gate object.

Returns:

Qiskit gate object corresponding to the pulse’s gate name.

Raises:

ValueError – If the gate name is not recognized.

gadd.circuit_padding.get_instruction_duration(instruction: Instruction, qubits: List[int], backend: BackendV2 | None = None, unit: str = 'dt', dt: float = 2.22e-10) float[source]

Get duration of an instruction from backend or defaults.

Parameters:
  • instruction – The instruction to get duration for.

  • qubits – Qubits the instruction acts on.

  • backend – Backend to get durations from.

  • unit – Time unit (‘dt’ or ‘s’).

  • dt – Duration of a single dt in seconds.

Returns:

Duration in specified units.

gadd.circuit_padding.apply_dd_strategy(circuit: QuantumCircuit, strategy: DDStrategy, coloring: Dict[int, int], backend: BackendV2, staggered: bool = False, **dd_options: Dict | None) QuantumCircuit[source]

Apply a DD strategy to a quantum circuit using PadDynamicalDecoupling.

Parameters:
  • circuit – Original quantum circuit.

  • strategy – DD strategy containing sequences for each color.

  • coloring – Mapping from qubit to color.

  • backend – Backend to execute circuit on.

  • staggered – Whether to apply CR-aware staggering for crosstalk suppression.

  • dd_options – Additionl options to pass to PadDynamicalDecoupling.

Returns:

Circuit with DD strategy applied.