ChannelProperties#

class iqm.models.channel_properties.channel_properties.ChannelProperties(sampling_rate, instruction_duration_granularity, instruction_duration_min, compatible_instructions=<factory>, is_virtual=False, blocks_component=True)#

Bases: object

Parent class of AWG and QA Channel properties that contains common attributes and methods.

Module: iqm.models.channel_properties.channel_properties

Attributes

blocks_component

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

is_virtual

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

sampling_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:
sampling_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_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 seconds

Return type:

float