analog ====== .. py:module:: quantify_scheduler.backends.qblox.analog .. autoapi-nested-parse:: Utilty classes for Qblox analog modules. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: quantify_scheduler.backends.qblox.analog.AnalogSequencerCompiler quantify_scheduler.backends.qblox.analog.AnalogModuleCompiler quantify_scheduler.backends.qblox.analog.BasebandModuleCompiler quantify_scheduler.backends.qblox.analog.RFModuleCompiler Attributes ~~~~~~~~~~ .. autoapisummary:: quantify_scheduler.backends.qblox.analog.logger .. py:data:: logger .. py:exception:: NcoOperationTimingError Bases: :py:obj:`ValueError` Exception thrown if there are timing errors for NCO operations. .. py:class:: AnalogSequencerCompiler(parent: AnalogModuleCompiler, index: int, portclock: tuple[str, str], static_hw_properties: quantify_scheduler.backends.types.qblox.StaticAnalogModuleProperties, settings: quantify_scheduler.backends.types.qblox.AnalogSequencerSettings, latency_corrections: dict[str, float], distortion_corrections: dict[int, Any] | None = None, qasm_hook_func: Callable | None = None, lo_name: str | None = None, downconverter_freq: float | None = None, mix_lo: bool = True, marker_debug_mode_enable: bool = False) Bases: :py:obj:`quantify_scheduler.backends.qblox.compiler_abc.SequencerCompiler` Class that performs the compilation steps on the sequencer level, for QCM and QRM-type modules. :param parent: A reference to the module compiler this sequencer belongs to. :param index: Index of the sequencer. :param portclock: Tuple that specifies the unique port and clock combination for this sequencer. The first value is the port, second is the clock. :param static_hw_properties: The static properties of the hardware. This effectively gathers all the differences between the different modules. :param settings: The settings set to this sequencer. :param latency_corrections: Dict containing the delays for each port-clock combination. :param qasm_hook_func: Allows the user to inject custom Q1ASM code into the compilation, just prior to returning the final string. :param lo_name: The name of the local oscillator instrument connected to the same output via an IQ mixer. This is used for frequency calculations. :param downconverter_freq: .. warning:: Using ``downconverter_freq`` requires custom Qblox hardware, do not use otherwise. Frequency of the external downconverter if one is being used. Defaults to ``None``, in which case the downconverter is inactive. :param mix_lo: Boolean flag for IQ mixing with LO. Defaults to ``True`` meaning IQ mixing is applied. :param marker_debug_mode_enable: Boolean flag to indicate if markers should be pulled high at the start of operations. Defaults to False, which means the markers will not be used during the sequence. .. py:property:: frequency :type: float | None The frequency used for modulation of the pulses. :returns: The frequency. .. py:method:: _prepare_acq_settings(acquisitions: list[quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy], acq_metadata: quantify_scheduler.schedules.schedule.AcquisitionMetadata) -> None Sets sequencer settings that are specific to certain acquisitions. For example for a TTL acquisition strategy. :param acquisitions: List of the acquisitions assigned to this sequencer. :param acq_metadata: Acquisition metadata. .. py:method:: _get_integration_length_from_acquisitions() -> int | None 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. .. py:method:: prepare() -> None Perform necessary operations on this sequencer's data before :meth:`~quantify_scheduler.backends.qblox.compiler_abc.SequencerCompiler.compile` is called. .. py:method:: _update_set_clock_frequency_operations() -> None .. py:method:: _replace_marker_pulses(op_strategies: list[quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy]) -> list[quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy] :staticmethod: Replaces MarkerPulse operations by explicit high and low operations. .. py:method:: _check_nco_operation_timing(ordered_op_strategies: list[quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy]) -> None :staticmethod: Check whether this sequencer's operation adhere to NCO timing restrictions. .. py:method:: _write_pre_wait_sync_instructions(qasm: quantify_scheduler.backends.qblox.qasm_program.QASMProgram) -> None Write instructions to the QASM program that must come before the first wait_sync. The duration must be equal for all module types. .. py:method:: _write_repetition_loop_header(qasm: quantify_scheduler.backends.qblox.qasm_program.QASMProgram) -> None Write the Q1ASM that should appear at the start of the repetition loop. The duration must be equal for all module types. .. py:method:: _insert_qasm(op_strategy: quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy, qasm_program: quantify_scheduler.backends.qblox.qasm_program.QASMProgram) -> None Get Q1ASM instruction(s) from ``op_strategy`` and insert them into ``qasm_program``. Optionally wrap pulses and acquisitions in marker pulses depending on the ``marker_debug_mode_enable`` setting. .. py:method:: _decide_markers(operation: quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy) -> int 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. :param operation: The operation currently being processed by the sequence. :returns: A bit string passed on to the set_mrk function of the Q1ASM object. .. py:class:: AnalogModuleCompiler(parent: quantify_scheduler.backends.qblox.instrument_compilers.ClusterCompiler, name: str, total_play_time: float, instrument_cfg: dict[str, Any], latency_corrections: dict[str, float] | None = None, distortion_corrections: dict[int, Any] | None = None) Bases: :py:obj:`quantify_scheduler.backends.qblox.compiler_abc.ClusterModuleCompiler`, :py:obj:`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. :param parent: Reference to the parent object. :type parent: :class:`quantify_scheduler.backends.qblox.instrument_compilers.ClusterCompiler` :param name: Name of the `QCoDeS` instrument this compiler object corresponds to. :param 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. :param instrument_cfg: The part of the hardware configuration dictionary referring to this device. This is one of the inner dictionaries of the overall hardware config. :param latency_corrections: Dict containing the delays for each port-clock combination. This is specified in the top layer of hardware config. .. py:property:: static_hw_properties :type: quantify_scheduler.backends.types.qblox.StaticAnalogModuleProperties :abstractmethod: The static properties of the hardware. This effectively gathers all the differences between the different modules. .. py:attribute:: _settings :type: quantify_scheduler.backends.types.qblox.AnalogModuleSettings .. py:method:: _construct_sequencer_compiler(index: int, portclock: tuple[str, str], channel_name: str, sequencer_cfg: dict[str, Any], channel_cfg: dict[str, Any]) -> AnalogSequencerCompiler Create an instance of :class:`AnalogSequencerCompiler`. .. py:method:: assign_frequencies(sequencer: AnalogSequencerCompiler) -> None :abstractmethod: 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). .. py:method:: _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 Sets the LO/IF frequencies, for baseband and RF modules. :param freqs: LO, IF, and clock frequencies, supplied via an :class:`.helpers.Frequencies` object. :param sequencer: The sequencer for which frequences are to be set. :param compiler_lo_baseband: For baseband modules, supply the :class:`.instrument_compilers.LocalOscillatorCompiler` instrument compiler of which the frequency is to be set. :param lo_freq_setting_rf: For RF modules, supply the name of the LO frequency param from the :class:`.RFModuleSettings` that is to be set. :raises ValueError: In case neither LO frequency nor IF has been supplied. :raises ValueError: In case both LO frequency and IF have been supplied and do not adhere to :math:`f_{RF} = f_{LO} + f_{IF}`. :raises ValueError: In case of RF, when the LO frequency was already set to a different value. .. py:method:: assign_attenuation() -> None :abstractmethod: An abstract method that should be overridden. Meant to assign attenuation settings from the hardware configuration if there is any. .. py:method:: prepare() -> None 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. .. py:method:: _configure_input_gains() -> None Configures input gain of module settings. Loops through all valid channel names and checks for gain values in hw config. Throws a ValueError if a gain value gets modified. .. py:method:: _configure_mixer_offsets() -> None 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. .. py:method:: _configure_distortion_correction_latency_compensations() -> None .. py:method:: _configure_dc_latency_comp_for_output(output: int, dc_comp: int) -> None .. py:method:: _configure_dc_latency_comp_for_marker(output: int, dc_comp: int) -> None .. py:method:: _configure_hardware_distortion_corrections() -> None Assign distortion corrections to settings of instrument compiler. .. py:method:: _ensure_single_scope_mode_acquisition_sequencer() -> None Raises an error if multiple sequencers use scope mode acquisition, because that's not supported by the hardware. Also, see :func:`~quantify_scheduler.instrument_coordinator.components.qblox._QRMComponent._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. .. py:class:: BasebandModuleCompiler(parent: quantify_scheduler.backends.qblox.instrument_compilers.ClusterCompiler, name: str, total_play_time: float, instrument_cfg: dict[str, Any], latency_corrections: dict[str, float] | None = None, distortion_corrections: dict[int, Any] | None = None) Bases: :py:obj:`AnalogModuleCompiler` Abstract class with all the shared functionality between the QRM and QCM baseband modules. .. py:method:: assign_frequencies(sequencer: AnalogSequencerCompiler) -> None 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 (via :func:`.helpers.determine_clock_lo_interm_freqs`). .. py:method:: assign_attenuation() -> None Meant to assign attenuation settings from the hardware configuration, if there is any. For baseband modules there is no attenuation parameters currently. .. py:method:: _configure_dc_latency_comp_for_marker(output: int, dc_comp: int) -> None .. py:class:: RFModuleCompiler(parent: quantify_scheduler.backends.qblox.instrument_compilers.ClusterCompiler, name: str, total_play_time: float, instrument_cfg: dict[str, Any], latency_corrections: dict[str, float] | None = None, distortion_corrections: dict[int, Any] | None = None) Bases: :py:obj:`AnalogModuleCompiler` Abstract class with all the shared functionality between the QRM-RF and QCM-RF modules. .. py:method:: assign_frequencies(sequencer: AnalogSequencerCompiler) -> None Determines LO/IF frequencies and assigns them for RF modules. .. py:method:: _get_connected_lo_indices(sequencer: AnalogSequencerCompiler) -> Iterator[int] :staticmethod: 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. .. py:method:: assign_attenuation() -> None Assigns attenuation settings from the hardware configuration. Floats that are a multiple of 1 are converted to ints. This is needed because the :func:`quantify_core.measurement.control.grid_setpoints` converts setpoints to floats when using an attenuation as settable. .. py:method:: _configure_dc_latency_comp_for_marker(output: int, dc_comp: int) -> None