ChannelProperties#

class iqm.pulse.playlist.channel.ChannelProperties(sample_rate, instruction_duration_granularity, instruction_duration_min, compatible_instructions=<factory>, is_iq=False, is_virtual=False, blocks_component=True)#

Bases: object

Defines the properties of a control or measurement channel.

All ZI instruments (HDAWG, UHFQA, SHFSG, SHFQA) can handle control pulses and waits where the number of samples is 32 + n * 16, where n in {0, 1, 2, ...}.

TODO Some of them might be more capable (at least some SHFQA commands can handle 4 + n * 4) ?

Module: iqm.pulse.playlist.channel

Attributes

blocks_component

Whether content in this channel should block the entire component that it is associated with in the scheduling.

is_iq

HACK, True iff this is an IQ channel.

is_virtual

Virtual channels are only used on the frontend side during compilation and scheduling.

sample_rate

sample rate of the instrument responsible for the channel (in Hz)

instruction_duration_granularity

all instruction durations on this channel must be multiples of this granularity (in samples)

instruction_duration_min

all instruction durations on this channel must at least this long (in samples)

compatible_instructions

instruction types that are allowed on this channel

Methods

duration_to_int_samples

Convert a time duration to an integer number of samples at the channel sample rate.

duration_to_samples

Convert a time duration to number of samples at the channel sample rate.

duration_to_seconds

Convert a time duration in samples at the channel sample rate to seconds.

round_duration_to_granularity

Round a time duration to the channel granularity.

Parameters:
  • sample_rate (float) –

  • instruction_duration_granularity (int) –

  • instruction_duration_min (int) –

  • compatible_instructions (tuple[type[Instruction], ...]) –

  • is_iq (bool) –

  • is_virtual (bool) –

  • blocks_component (bool) –

sample_rate: float#

sample rate of the instrument responsible for the channel (in Hz)

instruction_duration_granularity: int#

all instruction durations on this channel must be multiples of this granularity (in samples)

instruction_duration_min: int#

all instruction durations on this channel must at least this long (in samples)

compatible_instructions: tuple[type[Instruction], ...]#

instruction types that are allowed on this channel

is_iq: bool = False#

HACK, True iff this is an IQ channel. TODO do better

is_virtual: bool = False#

Virtual channels are only used on the frontend side during compilation and scheduling. They are removed from the Schedule before it is sent to Station Control. For example, virtual drive channels of computational resonators.

blocks_component: bool = True#

Whether content in this channel should block the entire component that it is associated with in the scheduling. Typically all physical channels should block their components, but certain virtual channels might not require this.

duration_to_samples(duration)#

Convert a time duration to number of samples at the channel sample rate.

Parameters:

duration (float) – time duration in s

Returns:

duration in samples

Return type:

float

duration_to_seconds(duration)#

Convert a time duration in samples at the channel sample rate to seconds.

Parameters:

duration (float) – time duration in samples

Returns:

duration in seconds

Return type:

float

duration_to_int_samples(duration, message='Given duration', check_min_samples=True)#

Convert a time duration to an integer number of samples at the channel sample rate.

duration must be sufficiently close to an integer number of samples, and that number must be something the channel can handle.

Parameters:
  • duration (float) – time duration in s

  • message (str) – message identifying the duration we are testing

  • check_min_samples (bool) – If True, check that the output is at least instruction_duration_min.

Returns:

duration as an integer number of samples

Raises:

ValueErrorduration is not close to an integer number of samples, or is otherwise unacceptable to the channel

Return type:

int

round_duration_to_granularity(duration, round_up=False, force_min_duration=False)#

Round a time duration to the channel granularity.

Parameters:
  • duration (float) – time duration in s

  • round_up (bool) – whether to round the durations up to the closest granularity

  • force_min_duration (bool) – whether to force the duration to be at least self.instruction_duration_min in seconds

Returns:

duration rounded to channel granularity, in s

Return type:

float