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

cluster_name

The name of the cluster, allows redirection between devices

TYPE: string DEFAULT: None

timeout

The timeout, in seconds, for detecting the qmm. Default is 60

TYPE: float DEFAULT: None

log_level(string)

The logging level for the connection instance. Defaults to INFO. Please check logging for available options

octave_calibration_db_path

The path for storing the Octave's calibration database

TYPE: PathLike DEFAULT: None

clear_all_job_results

Deletes all data from all previous jobs

close_all_qms

Closes ALL open quantum machines

get_controllers

Returns a list of all the controllers that are available

get_job

-- Available in QOP 3.x --

Get a job based on the job_id.

PARAMETER DESCRIPTION
job_id

A list of jobs ids

TYPE: str

Returns: The job

get_job_result_handles

-- Available in QOP 2.x --

Returns the result handles for a job. Args: job_id: The job id Returns: The handles that this job generated

get_jobs

-- Available in QOP 3.x --

Get jobs based on filtering criteria. All fields are optional.

PARAMETER DESCRIPTION
qm_ids

A list of qm ids

TYPE: Iterable[str] DEFAULT: tuple()

job_ids

A list of jobs ids

TYPE: Iterable[str] DEFAULT: tuple()

user_ids

A list of user ids

TYPE: Iterable[str] DEFAULT: tuple()

description

Jobs' description

TYPE: str DEFAULT: ''

status

A list of job statuses

TYPE: Iterable[JobStatus] DEFAULT: tuple()

Returns: A list of jobs

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
Union[QuantumMachine, QmApi]

A quantum machine obj that can be used to execute programs

list_open_qms

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

add_calibration_elements_to_config

Automatically adds config entries to allow Octave calibration.

TYPE: bool DEFAULT: True

use_calibration_data

Automatically load updated calibration data from calibration database into the config.

TYPE: bool DEFAULT: True

keep_dc_offsets_when_closing

Available in QOP 2.4.2 - When closing the QM, do not change the DC offsets.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
Union[QuantumMachine, QmApi]

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
Union[QuantumMachine, QmApi]

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))

Args: config: A QM config program: A QUA program() object to execute simulate: A SimulationConfig configuration object compiler_options: additional parameters to pass to execute strict: a deprecated option for the compiler flags: deprecated way to provide flags to the compiler

RETURNS DESCRIPTION
Union[SimulatedJob, SimulatedJobApi]

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
Union[Version, DevicesVersion]

A dictionary with the qm-qua and QOP versions

version_dict

RETURNS DESCRIPTION
Version

A dictionary with the qm-qua and QOP versions