qat.experimental.system_data.pulse.constraints module
PulseLevelConstraints is the layer that contains any constraints on pulse types,
which are used to validate and legalise the pulse IR.
Some expected use cases are:
Validating that the pulse duration is within the allowed limits of the port it plays on, and breaking it down into smaller pulses if possible.
Ensuring all durations match the timing granularity of the hardware.
Sampling waveforms according to the feature set of the hardware.
- class PortConstraints(sample_time_ps, min_duration_ps, max_duration_ps, native_waveform_shapes, acquire_allowed)
Bases:
objectInformation about the constraints of a given port.
A given type of control hardware can have specific properties, e.g., ports that are for control, ports for readout, or even different specialised cards. These different classes of ports can carry different properties. This class contains the properties for the pulse types required at the pulse level.
- Variables:
sample_time_ps – The sample time of the port in picoseconds.
min_duration_ps – The minimum pulse and acquire duration times in picoseconds.
max_duration_ps – The maximum pulse and acquire duration times in picoseconds.
native_waveform_shapes – The native waveform shapes supported by that port.
acquire_allowed – Whether acquisitions are supported via that port.
-
acquire_allowed:
bool
-
max_duration_ps:
int|None
- property max_pulse_duration_s: float | None
The maximum pulse duration of the port in seconds.
-
min_duration_ps:
int
- property min_pulse_duration_s: float
The minimum pulse duration of the port in seconds.
-
native_waveform_shapes:
tuple[type[IsAnalyticalWaveformInterface],...]
-
sample_time_ps:
int
- property sample_time_s: float
The sample time of the port in seconds.
- supports_waveform_shape(waveform_shape)
Whether the given waveform shape is supported by the port.
- Return type:
bool
- class PulseLevelConstraints(ports, granularity_ps)
Bases:
DerivedViewInterfaceThe ports available for a given hardware are static, at least at compile time, and we can calculate the properties of each port and the constraints they place at the pulse- level.
The constraints can be accessed through the port identifier directly; how this is used will depend on where in the compiler the constraints are applied. For example, when checking if the duration of a pulse is legal, we might not know the exact frame and hence the exact port it plays on without traversing the entire IR. When defining a frame, we can look directly using the port identifier from the frame.
- Variables:
ports – Maps a port by its identifier to its constraints.
granularity_ps – The timing granularity supported by the hardware in picoseconds. All operations with a duration must be integer multiples of this. Currently, this is assumed to be constant across all ports, but later, this might be generalised to be specific to a given port type.
- classmethod from_canonical(canonical_data)
Builds the pulse-level constraints for a given hardware model.
- Parameters:
canonical_data¶ (
CanonicalSystemData) – The canonical hardware model to build the constraints from.- Return type:
- Returns:
The pulse-level constraints for the given hardware model.
-
granularity_ps:
int
- property granularity_s: float
The timing granularity of the hardware in seconds.
-
ports:
Mapping[str,PortConstraints]