Skip to content

ops#

Building blocks for pulse sequences.

Each method returns a single operation — a pulse, a delay, or an acquisition window. Assemble them into a list and hand it to device.execute(...) to run a custom experiment.

Pulse #

Pulse(
    phase: Literal["x+", "x-", "y+", "y-"],
    duration: float
    | Literal["90deg", "180deg", "270deg", "360deg"]
    | Literal["ringing", "echo"],
) -> PulseOp

Create a radio-frequency pulse that rotates the magnetisation.

Parameters:

Name Type Description Default
phase Literal['x+', 'x-', 'y+', 'y-']

Direction the pulse is applied along — 'x+', 'y+', 'x-', or 'y-'.

required
duration float | Literal['90deg', '180deg', '270deg', '360deg'] | Literal['ringing', 'echo']

Either an explicit length in microseconds, or a calibrated spec resolved from the device — '90deg', '180deg', '270deg', '360deg', 'ringing', or 'echo'.

required

Returns:

Type Description
PulseOp

A pulse operation to place in a sequence.

Record #

Record(duration: float | int) -> RecordOp

Create an acquisition window that digitises the signal.

Parameters:

Name Type Description Default
duration float | int

How long to record for, in microseconds.

required

Returns:

Type Description
RecordOp

A record operation to place in a sequence.

Repeat #

Repeat(steps: list[BaseOp], count: int) -> list[BaseOp]

Repeat a block of operations a number of times.

Parameters:

Name Type Description Default
steps list[BaseOp]

The operations to repeat.

required
count int

How many times to repeat them.

required

Returns:

Type Description
list[BaseOp]

A flat list with steps duplicated count times, ready to splice

list[BaseOp]

into a larger sequence.

Silence #

Silence(duration: float | int) -> SilenceOp

Create a delay (no pulse, no acquisition) of a given length.

Used for relaxation/recovery delays and spacing between pulses.

Parameters:

Name Type Description Default
duration float | int

Delay length in microseconds.

required

Returns:

Type Description
SilenceOp

A delay operation to place in a sequence.

Wobble #

Wobble(
    acq_time_us: float,
    tau_2_us: float,
    tau_1_us: float | None = None,
) -> list[BaseOp]

Ready-made inversion-recovery block (WOBBLE preset).

A convenience bundle for \(T_1\) inversion-recovery measurements, equal to::

Pulse(180°) → Silence(tau_2) → Pulse(90°) → Silence(tau_1)
            → Record(acq_time) → Silence(tau_1)

The 180° pulse inverts the magnetisation, tau_2 is the variable recovery delay, and the 90° pulse reads out what has recovered.

Parameters:

Name Type Description Default
acq_time_us float

Acquisition (recording) time in microseconds.

required
tau_2_us float

Recovery delay between the two pulses, in microseconds.

required
tau_1_us float | None

Settling delay after the pulses and after acquisition, in microseconds. Defaults to the device's ring-down time when None.

None

Returns:

Type Description
list[BaseOp]

The list of operations making up one inversion-recovery block.