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:
objectParent class of AWG and QA Channel properties that contains common attributes and methods.
Module:
iqm.models.channel_properties.channel_propertiesAttributes
Whether content in this channel should block the entire component that it is associated with in the scheduling.
Virtual channels are only used on the frontend side during compilation and scheduling.
Sample rate of the instrument responsible for the channel (in Hz).
All instruction durations on this channel must be multiples of this granularity (in samples).
All instruction durations on this channel must at least this long (in samples).
Instruction types that are allowed on this channel.
Methods
Convert a time duration to an integer number of samples at the channel sample rate.
Convert a time duration to number of samples at the channel sample rate.
Convert a time duration in samples at the channel sample rate to seconds.
Round a time duration to the channel granularity.
- Parameters:
- 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
Schedulebefore 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.
- duration_to_seconds(duration)#
Convert a time duration in samples at the channel sample rate to seconds.
- 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.
durationmust 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:
durationas an integer number of samples- Raises:
ValueError –
durationis not close to an integer number of samples, or is otherwise unacceptable to the channel- Return type:
- round_duration_to_granularity(duration, round_up=False, force_min_duration=False)#
Round a time duration to the channel granularity.
- Parameters:
- Returns:
durationrounded to channel granularity, in seconds- Return type: