Skip to content
Pasqal Documentation

ChannelSamples

class pulser.sampler.ChannelSamples(amp, det, phase, slots=<factory>, eom_blocks=<factory>, eom_start_buffers=<factory>, eom_end_buffers=<factory>, target_time_slots=<factory>, _centered_phase=None)

Bases: object

Gathers samples of a channel.

Attributes

centered_phase

The phase samples centered in ]-π, π].

initial_targets

Returns the initial targets.

phase_modulation

The phase modulation samples (in rad).

amp

det

phase

slots

eom_blocks

eom_start_buffers

eom_end_buffers

target_time_slots

Methods

extend_duration

Extends the duration of the samples.

get_eom_mode_intervals

Returns EOM mode intervals.

in_eom_mode

States if a time slot is inside an EOM mode block.

is_empty

Whether the channel is effectively empty.

modulate

Modulates the samples for a given channel.

Signatures

extend_duration(new_duration)

Extends the duration of the samples.

Pads the amplitude and detuning samples with zeros and the phase with its last value (or zero if empty).

Parameters:

new_duration (int) – The new duration for the samples (in ns). Must be greater than or equal to the current duration.

Return type:

ChannelSamples

Returns:

The extended channel samples.

get_eom_mode_intervals()

Returns EOM mode intervals.

Return type:

list[tuple[int, int]]

in_eom_mode(slot)

States if a time slot is inside an EOM mode block.

Return type:

bool

is_empty()

Whether the channel is effectively empty.

The channel is considered empty if all amplitude and detuning samples are zero.

Return type:

bool

modulate(channel_obj, max_duration=None)

Modulates the samples for a given channel.

It assumes that the detuning and phase start at their initial values and are kept at their final values.

Parameters:
  • channel_obj (Channel) – The channel object for which to modulate the samples.

  • max_duration (int | None, default: None) – The maximum duration of the modulation samples. If defined, truncates them to have a duration less than or equal to the given value.

Return type:

ChannelSamples

Returns:

The modulated channel samples.

property centered_phase: AbstractArray

The phase samples centered in ]-π, π].

property initial_targets: set[str]

Returns the initial targets.

property phase_modulation: AbstractArray

The phase modulation samples (in rad).

Constructed by combining the integral of the detuning samples with the phase offset samples according to

\[\phi(t) = \phi_c(t) - \sum_{k=0}^{t} \delta(k)\]