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#

hardware_compilation_config

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

Mock readout module that just supports “TRACE” instruction.

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.

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.

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

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

hardware_description: Dict[str, MockROMDescription][source]#
hardware_options: MockROMHardwareOptions[source]#
compilation_passes: list[quantify_scheduler.backends.graph_compilation.SimpleNodeConfig][source]#
hardware_compilation_config[source]#