Skip to content

Quantum Machine Manager API

qm.quantum_machines_manager.QuantumMachinesManager

PARAMETER DESCRIPTION
host

Host where to find the QM orchestrator. If None, local settings are used

TYPE: string DEFAULT: None

port

Port where to find the QM orchestrator. If None, local settings are used

TYPE: Optional[int] DEFAULT: None

clear_all_job_results

Deletes all data from all previous jobs

close

Closes the Quantum machine manager

close_all_quantum_machines

Closes ALL open quantum machines

get_controllers

Returns a list of all the controllers that are available

get_qm

Gets an open quantum machine object with the given machine id

PARAMETER DESCRIPTION
machine_id

The id of the open quantum machine to get

TYPE: str

RETURNS DESCRIPTION
QuantumMachine

A quantum machine obj that can be used to execute programs

list_open_quantum_machines

Return a list of open quantum machines. (Returns only the ids, use get_qm(...) to get the machine object)

RETURNS DESCRIPTION
List[str]

The ids list

open_qm

Opens a new quantum machine. A quantum machine can use multiple OPXes, and a single OPX can also be used by multiple quantum machines as long as they do not share the same physical resources (input/output ports) as defined in the config.

PARAMETER DESCRIPTION
config

The config that will be used by the quantum machine

TYPE: DictQuaConfig

close_other_machines

When set to true (default) any open quantum machines will be closed. This simplifies the workflow, but does not enable opening more than one quantum machine.

TYPE: bool DEFAULT: True

validate_with_protobuf

Validates config with protobuf instead of marshmallow. It is usually faster when working with large configs. Defaults to False.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
QuantumMachine

A quantum machine obj that can be used to execute programs

open_qm_from_file

Opens a new quantum machine with config taken from a file on the local file system

PARAMETER DESCRIPTION
filename

The path to the file that contains the config

TYPE: str

close_other_machines

Flag whether to close all other running machines

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
QuantumMachine

A quantum machine obj that can be used to execute programs

perform_healthcheck

Perform a health check against the QM server.

PARAMETER DESCRIPTION
strict

Will raise an exception if health check failed

TYPE: bool DEFAULT: True

reset_data_processing

Stops current data processing for ALL running jobs

simulate

Simulate the outputs of a deterministic QUA program.

The following example shows a simple execution of the simulator, where the associated config object is omitted for brevity.

Example
from qm.qua import *
from qm import SimulationConfig, QuantumMachinesManager

qmm = QuantumMachinesManager()

with program() as prog:
    play('pulse1', 'qe1')

job = qmm.simulate(config, prog, SimulationConfig(duration=100))
PARAMETER DESCRIPTION
config

A QM config

TYPE: DictQuaConfig

program

A QUA program() object to execute

TYPE: Program

simulate

A SimulationConfig configuration object

TYPE: SimulationConfig

compiler_options

additional parameters to pass to execute

TYPE: Optional[CompilerOptionArguments] DEFAULT: None

strict

a deprecated option for the compiler

TYPE: Optional[bool] DEFAULT: None

flags

deprecated way to provide flags to the compiler

TYPE: Optional[List[str]] DEFAULT: None

RETURNS DESCRIPTION
SimulatedJob

a QmJob object (see QM Job API).

validate_qua_config

Validates a qua config based on the connected server's capabilities. Raises an exception if the config is invalid.

PARAMETER DESCRIPTION
qua_config

A python dict containing the qua config to validate

TYPE: DictQuaConfig

version

RETURNS DESCRIPTION
Version

A dictionary with the qm-qua and QOP versions

version_dict

RETURNS DESCRIPTION
Version

A dictionary with the qm-qua and QOP versions