spin_pulse.transpilation.instructions.idle

Pulse description of idle qubit.

Classes

IdleInstruction

Represent an idle (delay) operation applied to one or more qubits.

Module Contents

class spin_pulse.transpilation.instructions.idle.IdleInstruction(qubits, duration=1)[source]

Bases: spin_pulse.transpilation.instructions.pulse_instruction.PulseInstruction

Represent an idle (delay) operation applied to one or more qubits.

This instruction models the absence of active control during a time interval. It is used both for explicit delays in pulse scheduling and as a building block for dynamical decoupling sequences. The duration is expressed in time steps.

- name

Name of the instruction (“delay”).

Type:

str

- qubits

List of qubits on which the idle operation acts.

Type:

list[qiskit.circuit.Qubit]

- duration

Duration of the idle period in time steps.

Type:

int

Initialize an idle instruction on the specified qubits.

Parameters:
  • qubits (list[qiskit.circuit.Qubit]) – List of qubits where the idle operation is applied.

  • duration (int) – Duration of the idle period. Default is 1.

Returns:

The idle instruction is stored in the created object.

Return type:

None

name = 'delay'[source]
adjust_duration(duration)[source]
Parameters:

duration (int)

plot(ax=None, t_start=0, label_gates=True)[source]

Plot the idle instruction as a flat line segment.

Parameters:
  • ax (matplotlib axis, optional) – Axis on which the idle segment is drawn. If None, the current axis is used.

  • t_start (int) – Starting time of the idle segment. Default is 0.

  • label_gates (bool) – Unused parameter kept for API compatibility. Default is True.

Returns:

The idle segment is drawn on the provided axis.

Return type:

None

to_hamiltonian()[source]

Convert the idle operation to its Hamiltonian representation.

The idle period corresponds to zero Hamiltonian evolution, resulting in no phase accumulation. This method returns a zero Hamiltonian and a zero frequency array compatible with the simulation interface.

Returns:

Array of zeros of length duration.

Return type:

ndarray

to_dynamical_decoupling(hardware_specs, mode=None)[source]

Expand the idle instruction into a dynamical decoupling sequence.

Depending on the hardware_specs dynamical decoupling mode, this method replaces the idle period with a sequence of rotations and shorter idle segments. Supported dynamical decoupling modes include:

  • SPIN_ECHO: Inserts two \(\pi\) rotations with symmetric idle periods.

  • FULL_DRIVE: Applies repeated \(2\pi\) rotations to average out noise.

  • None: Returns the idle instruction unchanged.

Parameters:
Returns:

List of PulseInstruction objects implementing the chosen dynamical decoupling sequence.

Return type:

list[PulseInstruction]