analog#
Utilty classes for Qblox analog modules.
Module Contents#
Classes#
Class that performs the compilation steps on the sequencer level, for QCM and |
|
Base class for QCM and QRM-type modules. |
|
Abstract class with all the shared functionality between the QRM and QCM baseband |
|
Abstract class with all the shared functionality between the QRM-RF and QCM-RF |
Attributes#
- class AnalogSequencerCompiler(parent: AnalogModuleCompiler, index: int, static_hw_properties: quantify_scheduler.backends.types.qblox.StaticAnalogModuleProperties, settings: quantify_scheduler.backends.types.qblox.AnalogSequencerSettings, sequencer_cfg: quantify_scheduler.backends.qblox_backend._SequencerCompilationConfig)[source]#
Bases:
quantify_scheduler.backends.qblox.compiler_abc.SequencerCompiler
Class that performs the compilation steps on the sequencer level, for QCM and QRM-type modules.
- Parameters:
parent – A reference to the module compiler this sequencer belongs to.
index – Index of the sequencer.
static_hw_properties – The static properties of the hardware. This effectively gathers all the differences between the different modules.
settings – The settings set to this sequencer.
sequencer_cfg – The instrument compiler config associated to this device.
- static_hw_properties: quantify_scheduler.backends.types.qblox.StaticAnalogModuleProperties[source]#
- property frequency: float | None[source]#
The frequency used for modulation of the pulses.
- Returns:
The frequency.
- get_operation_strategy(operation_info: quantify_scheduler.backends.types.qblox.OpInfo) quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy [source]#
Determines and instantiates the correct strategy object.
- Parameters:
operation_info – The operation we are building the strategy for.
channel_name – Specifies the channel identifier of the hardware config (e.g. complex_output_0).
- Returns:
The instantiated strategy object.
- add_operation_strategy(op_strategy: quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy) None [source]#
Adds the operation strategy to the sequencer compiler.
- Parameters:
op_strategy – The operation strategy.
- _prepare_acq_settings(acquisitions: list[quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy], acq_metadata: quantify_scheduler.schedules.schedule.AcquisitionMetadata) None [source]#
Sets sequencer settings that are specific to certain acquisitions. For example for a TTL acquisition strategy.
- Parameters:
acquisitions – List of the acquisitions assigned to this sequencer.
acq_metadata – Acquisition metadata.
- _get_integration_length_from_acquisitions() int | None [source]#
Get the (validated) integration_length sequencer setting.
Get the duration of all SSB integration acquisitions assigned to this sequencer and validate that they are all the same.
- prepare() None [source]#
Perform necessary operations on this sequencer’s data before
compile()
is called.
- static _assert_nco_operation_timing_on_grid(ordered_op_strategies: list[quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy]) None [source]#
Check whether this sequencer’s operation adhere to NCO timing restrictions.
- _assert_total_play_time_on_nco_grid() None [source]#
Raises an error if the total play time does not align with the NCO grid time.
Method is implemented on the base class instead of the AnalogSequencerCompiler subclass because it is called by generate_qasm_program.
- _write_pre_wait_sync_instructions(qasm: quantify_scheduler.backends.qblox.qasm_program.QASMProgram) None [source]#
Write instructions to the QASM program that must come before the first wait_sync.
The duration must be equal for all module types.
- _write_repetition_loop_header(qasm: quantify_scheduler.backends.qblox.qasm_program.QASMProgram) None [source]#
Write the Q1ASM that should appear at the start of the repetition loop.
The duration must be equal for all module types.
- _insert_qasm(op_strategy: quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy, qasm_program: quantify_scheduler.backends.qblox.qasm_program.QASMProgram) None [source]#
Get Q1ASM instruction(s) from
op_strategy
and insert them intoqasm_program
.Optionally wrap pulses and acquisitions in marker pulses depending on the
marker_debug_mode_enable
setting.
- _decide_markers(operation: quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy) int [source]#
Helper method to decide what markers should be pulled high when enable_marker is set to True. Checks what module and operation are being processed, then builds a bit string accordingly.
Note that with the current quantify structure a sequencer cannot have connected inputs and outputs simultaneously. Therefore, the QRM baseband module pulls both input or output markers high when doing an operation, as it is impossible during compile time to find out what physical port is being used.
- Parameters:
operation – The operation currently being processed by the sequence.
- Returns:
A bit string passed on to the set_mrk function of the Q1ASM object.
- class AnalogModuleCompiler(parent: quantify_scheduler.backends.qblox.instrument_compilers.ClusterCompiler, name: str, total_play_time: float, instrument_cfg: quantify_scheduler.backends.qblox_backend._ClusterModuleCompilationConfig)[source]#
Bases:
quantify_scheduler.backends.qblox.compiler_abc.ClusterModuleCompiler
,abc.ABC
Base class for QCM and QRM-type modules.
This class is defined as an abstract base class since the distinctions between the different devices are defined in subclasses. Effectively, this base class contains the functionality shared by all Qblox devices and serves to avoid repeated code between them.
- Parameters:
parent (
quantify_scheduler.backends.qblox.instrument_compilers.ClusterCompiler
) – Reference to the parent object.name – Name of the QCoDeS instrument this compiler object corresponds to.
total_play_time – Total time execution of the schedule should go on for. This parameter is used to ensure that the different devices, potentially with different clock rates, can work in a synchronized way when performing multiple executions of the schedule.
instrument_cfg – The instrument compiler config referring to this device.
- sequencers: dict[str, AnalogSequencerCompiler][source]#
- property static_hw_properties: quantify_scheduler.backends.types.qblox.StaticAnalogModuleProperties[source]#
- Abstractmethod:
The static properties of the hardware. This effectively gathers all the differences between the different modules.
- _construct_sequencer_compiler(index: int, sequencer_cfg: quantify_scheduler.backends.qblox_backend._SequencerCompilationConfig) AnalogSequencerCompiler [source]#
Create an instance of
AnalogSequencerCompiler
.
- abstract assign_frequencies(sequencer: AnalogSequencerCompiler) None [source]#
An abstract method that should be overridden. Meant to assign an IF frequency to each sequencer, and an LO frequency to each output (if applicable).
- _set_lo_interm_freqs(freqs: quantify_scheduler.backends.qblox.helpers.Frequencies, sequencer: AnalogSequencerCompiler, compiler_lo_baseband: quantify_scheduler.backends.qblox.instrument_compilers.LocalOscillatorCompiler | None = None, lo_freq_setting_rf: str | None = None) None [source]#
Sets the LO/IF frequencies, for baseband and RF modules.
- Parameters:
freqs – LO, IF, and clock frequencies, supplied via an
helpers.Frequencies
object.sequencer – The sequencer for which frequences are to be set.
compiler_lo_baseband – For baseband modules, supply the
instrument_compilers.LocalOscillatorCompiler
instrument compiler of which the frequency is to be set.lo_freq_setting_rf – For RF modules, supply the name of the LO frequency param from the
RFModuleSettings
that is to be set.
- Raises:
ValueError – In case neither LO frequency nor IF has been supplied.
ValueError – In case both LO frequency and IF have been supplied and do not adhere to \(f_{RF} = f_{LO} + f_{IF}\).
ValueError – In case of RF, when the LO frequency was already set to a different value.
- abstract assign_attenuation() None [source]#
An abstract method that should be overridden. Meant to assign attenuation settings from the hardware configuration if there is any.
- prepare() None [source]#
Performs the logic needed before being able to start the compilation. In effect, this means assigning the pulses and acquisitions to the sequencers and calculating the relevant frequencies in case an external local oscillator is used.
- _configure_input_gains() None [source]#
Configures input gain of module settings. Loops through all valid channel names and checks for gain values in hw config.
- _configure_mixer_offsets() None [source]#
Configures offset of input, uses calc_from_units_volt found in helper file. Raises an exception if a value outside the accepted voltage range is given.
- _configure_distortion_correction_latency_compensations(distortion_configs: dict[int, Any] | None = None) None [source]#
- _configure_hardware_distortion_corrections(distortion_configs: dict[int, Any] | None = {}) None [source]#
Assign distortion corrections to settings of instrument compiler.
- _ensure_single_scope_mode_acquisition_sequencer() None [source]#
Raises an error if multiple sequencers use scope mode acquisition, because that’s not supported by the hardware. Also, see
_determine_scope_mode_acquisition_sequencer_and_qblox_acq_index()
which also ensures the program that gets uploaded to the hardware satisfies this requirement.- Raises:
ValueError – Multiple sequencers have to perform trace acquisition. This is not supported by the hardware.
- class BasebandModuleCompiler(parent: quantify_scheduler.backends.qblox.instrument_compilers.ClusterCompiler, name: str, total_play_time: float, instrument_cfg: quantify_scheduler.backends.qblox_backend._ClusterModuleCompilationConfig)[source]#
Bases:
AnalogModuleCompiler
Abstract class with all the shared functionality between the QRM and QCM baseband modules.
- assign_frequencies(sequencer: AnalogSequencerCompiler) None [source]#
Determines LO/IF frequencies and assigns them, for baseband modules.
In case of no external local oscillator, the NCO is given the same frequency as the clock – unless NCO was permanently disabled via “interm_freq”: 0 in the hardware config.
In case of an external local oscillator and sequencer.mix_lo is
False
, the LO is given the same frequency as the clock (viahelpers.determine_clock_lo_interm_freqs()
).
- class RFModuleCompiler(parent: quantify_scheduler.backends.qblox.instrument_compilers.ClusterCompiler, name: str, total_play_time: float, instrument_cfg: quantify_scheduler.backends.qblox_backend._ClusterModuleCompilationConfig)[source]#
Bases:
AnalogModuleCompiler
Abstract class with all the shared functionality between the QRM-RF and QCM-RF modules.
- assign_frequencies(sequencer: AnalogSequencerCompiler) None [source]#
Determines LO/IF frequencies and assigns them for RF modules.
- static _get_connected_lo_indices(sequencer: AnalogSequencerCompiler) Iterator[int] [source]#
Identify the LO the sequencer is outputting. Use the sequencer output to module output correspondence, and then use the fact that LOX is connected to module output X.
- assign_attenuation() None [source]#
Assigns attenuation settings from the hardware configuration.
Floats that are a multiple of 1 are converted to ints. This is needed because the
quantify_core.measurement.control.grid_setpoints()
converts setpoints to floats when using an attenuation as settable.