mock_rom ======== .. py:module:: quantify_scheduler.backends.mock.mock_rom .. autoapi-nested-parse:: Compiler backend for a mock readout module. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: quantify_scheduler.backends.mock.mock_rom.MockReadoutModule quantify_scheduler.backends.mock.mock_rom.MockROMGettable quantify_scheduler.backends.mock.mock_rom.MockROMAcquisitionConfig quantify_scheduler.backends.mock.mock_rom.MockROMSettings quantify_scheduler.backends.mock.mock_rom.MockROMInstrumentCoordinatorComponent quantify_scheduler.backends.mock.mock_rom.MockROMDescription quantify_scheduler.backends.mock.mock_rom.MockROMHardwareOptions quantify_scheduler.backends.mock.mock_rom.MockROMHardwareCompilationConfig Functions ~~~~~~~~~ .. autoapisummary:: quantify_scheduler.backends.mock.mock_rom.hardware_compile Attributes ~~~~~~~~~~ .. autoapisummary:: quantify_scheduler.backends.mock.mock_rom.hardware_compilation_config .. py:class:: MockReadoutModule(name: str, sampling_rate: float = 1000000000.0, gain: float = 1.0) Mock readout module that just supports "TRACE" instruction. .. py:attribute:: name .. py:attribute:: data :value: [] .. py:attribute:: waveforms .. py:attribute:: instructions :value: [] .. py:attribute:: gain .. py:attribute:: sampling_rate .. py:method:: upload_waveforms(waveforms: dict[str, quantify_scheduler.structure.types.NDArray]) -> None Upload a dictionary of waveforms defined on a 1 ns grid. .. py:method:: upload_instructions(instructions: list[str]) -> None Upload a sequence of instructions. .. py:method:: execute() -> None Execute the instruction sequence (only "TRACE" is supported). .. py:method:: get_results() -> list[numpy.ndarray] Return the results of the execution. .. py:class:: MockROMGettable(mock_rom: MockReadoutModule, waveforms: dict[str, quantify_scheduler.structure.types.NDArray], instructions: list[str], sampling_rate: float = 1000000000.0, gain: float = 1.0) Mock readout module gettable. .. py:attribute:: mock_rom .. py:attribute:: waveforms .. py:attribute:: instructions .. py:attribute:: sampling_rate .. py:attribute:: gain .. py:method:: get() -> list[numpy.ndarray] Execute the sequence and return the results. .. py:class:: MockROMAcquisitionConfig(/, **data: Any) Bases: :py:obj:`quantify_scheduler.structure.model.DataStructure` Acquisition configuration for the mock readout module. This information is used in the instrument coordinator component to convert the acquired data to an xarray dataset. .. py:attribute:: n_acquisitions :type: int .. py:attribute:: acq_protocols :type: dict[int, str] .. py:attribute:: bin_mode :type: quantify_scheduler.enums.BinMode .. py:class:: MockROMSettings(/, **data: Any) Bases: :py:obj:`quantify_scheduler.structure.model.DataStructure` Settings that can be uploaded to the mock readout module. .. py:attribute:: waveforms :type: dict[str, quantify_scheduler.structure.types.NDArray] .. py:attribute:: instructions :type: list[str] .. py:attribute:: sampling_rate :type: float :value: 1000000000.0 .. py:attribute:: gain :type: float :value: 1.0 .. py:attribute:: acq_config :type: MockROMAcquisitionConfig .. py:class:: MockROMInstrumentCoordinatorComponent(mock_rom: MockReadoutModule) Bases: :py:obj:`quantify_scheduler.instrument_coordinator.components.base.InstrumentCoordinatorComponentBase` Mock readout module instrument coordinator component. .. py:attribute:: rom .. py:attribute:: acq_config :value: None .. py:property:: is_running :type: bool Returns if the InstrumentCoordinator component is running. The property ``is_running`` is evaluated each time it is accessed. Example: .. code-block:: while my_instrument_coordinator_component.is_running: print('running') :returns: The components' running state. .. py:method:: prepare(options: MockROMSettings) -> None Upload the settings to the ROM. .. py:method:: start() -> None Execute the sequence. .. py:method:: stop() -> None Stop the execution. .. py:method:: retrieve_acquisition() -> xarray.Dataset Get the acquired data and return it as an xarray dataset. .. py:method:: wait_done(timeout_sec: int = 10) -> None Wait until the execution is done. .. py:method:: get_hardware_log(compiled_schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) -> None Return the hardware log. .. py:function:: hardware_compile(schedule: quantify_scheduler.schedules.schedule.Schedule, config: quantify_scheduler.backends.graph_compilation.CompilationConfig) -> quantify_scheduler.schedules.schedule.Schedule Compile the schedule to the mock ROM. .. py:class:: MockROMDescription(/, **data: Any) Bases: :py:obj:`quantify_scheduler.backends.types.common.HardwareDescription` Specifies a piece of hardware and its instrument-specific settings. Each supported instrument type should have its own datastructure that inherits from this class. For examples, see :class:`~quantify_scheduler.backends.types.qblox.ClusterDescription`, :class:`~quantify_scheduler.backends.types.zhinst.ZIHDAWG4Description`, :class:`~.LocalOscillatorDescription`. This datastructure is used to specify the control-hardware ports that are included in the :class:`~.Connectivity` graph. .. py:attribute:: instrument_type :type: Literal['Mock readout module'] :value: 'Mock readout module' The instrument type. .. py:attribute:: sampling_rate :type: float .. py:class:: MockROMHardwareOptions(/, **data: Any) Bases: :py:obj:`quantify_scheduler.backends.types.common.HardwareOptions` Datastructure containing the hardware options for each port-clock combination. This datastructure contains the HardwareOptions that are currently shared among the existing backends. Subclassing is required to add backend-specific options, see e.g., :class:`~quantify_scheduler.backends.types.qblox.QbloxHardwareOptions`, :class:`~quantify_scheduler.backends.types.zhinst.ZIHardwareOptions`. .. py:attribute:: gain :type: dict[str, float] | None :value: None .. py:class:: MockROMHardwareCompilationConfig(/, **data: Any) Bases: :py:obj:`quantify_scheduler.backends.types.common.HardwareCompilationConfig` Information required to compile a schedule to the control-hardware layer. From a point of view of :ref:`sec-compilation` this information is needed to convert a schedule defined on a quantum-device layer to compiled instructions that can be executed on the control hardware. This datastructure defines the overall structure of a ``HardwareCompilationConfig``. Specific hardware backends should customize fields within this structure by inheriting from this class and specifying their own `"config_type"`, see e.g., :class:`~quantify_scheduler.backends.qblox_backend.QbloxHardwareCompilationConfig`, :class:`~quantify_scheduler.backends.zhinst_backend.ZIHardwareCompilationConfig`. .. py:attribute:: config_type :type: type[MockROMHardwareCompilationConfig] A reference to the :class:`~quantify_scheduler.backends.types.common.HardwareCompilationConfig` DataStructure for the Mock ROM backend. .. py:attribute:: hardware_description :type: dict[str, MockROMDescription] Datastructure describing the control hardware instruments in the setup and their high-level settings. .. py:attribute:: hardware_options :type: MockROMHardwareOptions The :class:`~quantify_scheduler.backends.types.common.HardwareOptions` used in the compilation from the quantum-device layer to the control-hardware layer. .. py:attribute:: compilation_passes :type: list[quantify_scheduler.backends.graph_compilation.SimpleNodeConfig] The list of compilation nodes that should be called in succession to compile a schedule to instructions for the control hardware. .. py:data:: hardware_compilation_config