mock_rom#

Compiler backend for a mock readout module.

Module Contents#

Classes#

MockReadoutModule

Mock readout module that just supports "TRACE" instruction.

MockROMGettable

Mock readout module gettable.

MockROMAcquisitionConfig

Acquisition configuration for the mock readout module.

MockROMSettings

Settings that can be uploaded to the mock readout module.

MockROMInstrumentCoordinatorComponent

Mock readout module instrument coordinator component.

MockROMDescription

Specifies a piece of hardware and its instrument-specific settings.

MockROMHardwareOptions

Datastructure containing the hardware options for each port-clock combination.

MockROMHardwareCompilationConfig

Information required to compile a schedule to the control-hardware layer.

Functions#

hardware_compile(...)

Compile the schedule to the mock ROM.

Attributes#

class MockReadoutModule(name: str, sampling_rate: float = 1000000000.0, gain: float = 1.0)[source]#

Mock readout module that just supports “TRACE” instruction.

name[source]#
data = [][source]#
waveforms[source]#
instructions = [][source]#
gain = 1.0[source]#
sampling_rate = 1000000000.0[source]#
upload_waveforms(waveforms: dict[str, quantify_scheduler.structure.types.NDArray]) None[source]#

Upload a dictionary of waveforms defined on a 1 ns grid.

upload_instructions(instructions: list[str]) None[source]#

Upload a sequence of instructions.

execute() None[source]#

Execute the instruction sequence (only “TRACE” is supported).

get_results() list[numpy.ndarray][source]#

Return the results of the execution.

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)[source]#

Mock readout module gettable.

mock_rom[source]#
waveforms[source]#
instructions[source]#
sampling_rate = 1000000000.0[source]#
gain = 1.0[source]#
get() list[numpy.ndarray][source]#

Execute the sequence and return the results.

class MockROMAcquisitionConfig(/, **data: Any)[source]#

Bases: 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.

n_acquisitions: int[source]#
acq_protocols: dict[int, str][source]#
bin_mode: quantify_scheduler.enums.BinMode[source]#
class MockROMSettings(/, **data: Any)[source]#

Bases: quantify_scheduler.structure.model.DataStructure

Settings that can be uploaded to the mock readout module.

waveforms: dict[str, quantify_scheduler.structure.types.NDArray][source]#
instructions: list[str][source]#
sampling_rate: float = 1000000000.0[source]#
gain: float = 1.0[source]#
acq_config: MockROMAcquisitionConfig[source]#
class MockROMInstrumentCoordinatorComponent(mock_rom: MockReadoutModule)[source]#

Bases: quantify_scheduler.instrument_coordinator.components.base.InstrumentCoordinatorComponentBase

Mock readout module instrument coordinator component.

rom[source]#
acq_config = None[source]#
property is_running: bool[source]#

Returns if the InstrumentCoordinator component is running.

The property is_running is evaluated each time it is accessed. Example:

while my_instrument_coordinator_component.is_running:
    print('running')
Returns:

The components’ running state.

prepare(options: MockROMSettings) None[source]#

Upload the settings to the ROM.

start() None[source]#

Execute the sequence.

stop() None[source]#

Stop the execution.

retrieve_acquisition() xarray.Dataset[source]#

Get the acquired data and return it as an xarray dataset.

wait_done(timeout_sec: int = 10) None[source]#

Wait until the execution is done.

get_hardware_log(compiled_schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) None[source]#

Return the hardware log.

hardware_compile(schedule: quantify_scheduler.schedules.schedule.Schedule, config: quantify_scheduler.backends.graph_compilation.CompilationConfig) quantify_scheduler.schedules.schedule.Schedule[source]#

Compile the schedule to the mock ROM.

class MockROMDescription(/, **data: Any)[source]#

Bases: 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 ClusterDescription, ZIHDAWG4Description, LocalOscillatorDescription.

This datastructure is used to specify the control-hardware ports that are included in the Connectivity graph.

instrument_type: Literal['Mock readout module'] = 'Mock readout module'[source]#

The instrument type.

sampling_rate: float[source]#
class MockROMHardwareOptions(/, **data: Any)[source]#

Bases: 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., QbloxHardwareOptions, ZIHardwareOptions.

gain: dict[str, float] | None = None[source]#
class MockROMHardwareCompilationConfig(/, **data: Any)[source]#

Bases: quantify_scheduler.backends.types.common.HardwareCompilationConfig

Information required to compile a schedule to the control-hardware layer.

From a point of view of 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., QbloxHardwareCompilationConfig, ZIHardwareCompilationConfig.

config_type: type[MockROMHardwareCompilationConfig] = None[source]#

A reference to the HardwareCompilationConfig DataStructure for the Mock ROM backend.

hardware_description: dict[str, MockROMDescription][source]#

Datastructure describing the control hardware instruments in the setup and their high-level settings.

hardware_options: MockROMHardwareOptions[source]#

The HardwareOptions used in the compilation from the quantum-device layer to the control-hardware layer.

compilation_passes: list[quantify_scheduler.backends.graph_compilation.SimpleNodeConfig][source]#

The list of compilation nodes that should be called in succession to compile a schedule to instructions for the control hardware.

hardware_compilation_config[source]#