Skip to content

QM Job API

qm.jobs.base_job.QmBaseJob

id: str property

The id of the job

status: str property

Returns the status of the job, one of the following strings: "unknown", "pending", "running", "completed", "canceled", "loading", "error"

insert_input_stream

Insert data to the input stream declared in the QUA program. The data is then ready to be read by the program using the advance input stream QUA statement.

Multiple data entries can be inserted before the data is read by the program.

See Input streams for more information.

-- Available from QOP 2.0 --

PARAMETER DESCRIPTION
name

The input stream name the data is to be inserted to.

TYPE: str

data

The data to be inserted. The data's size must match the size of the input stream.

TYPE: List[Value]

qm.jobs.pending_job.QmPendingJob

Bases: QmBaseJob

A Class describing a job in the execution queue

cancel

Removes the job from the queue

RETURNS DESCRIPTION
bool

true if the operation was successful

Example
pending_job.cancel()

position_in_queue

Returns the current position of the job in the queue, returns -1 on if the job is not pending anymore

RETURNS DESCRIPTION
int

The position in the queue

Example
pending_job.position_in_queue()

wait_for_execution

Waits for the job to be executed (start running) or until the timeout has elapsed. On zero and negative timeout, the job is checked once.

PARAMETER DESCRIPTION
timeout

Timeout (in seconds) for this operation

TYPE: float DEFAULT: float('infinity')

RAISES DESCRIPTION
TimeoutError

When timeout is elapsed

RETURNS DESCRIPTION
QmJob

The running QmJob

qm.jobs.running_qm_job.RunningQmJob

Bases: QmBaseJob

manager: None property

The QM object where this job lives

result_handles: StreamingResultFetcher property

:type: qm._results.JobResults

RETURNS DESCRIPTION
StreamingResultFetcher

The handles that this job generated

execution_report

Get runtime errors report for this job. See Runtime errors.

RETURNS DESCRIPTION
ExecutionReport

An object holding the errors that this job generated.

get_element_correction

Gets the correction matrix for correcting gain and phase imbalances of an IQ mixer associated with a element.

PARAMETER DESCRIPTION
element

the name of the element to update the correction for

TYPE: str

RETURNS DESCRIPTION
Tuple[float, float, float, float]

The current correction matrix

halt

Halts the job on the opx

is_paused

RETURNS DESCRIPTION
bool

Returns True if the job is in a paused state.

see also

resume()

resume

Resumes a program that was halted using the qm.qua._dsl.pause statement

set_element_correction

Sets the correction matrix for correcting gain and phase imbalances of an IQ mixer associated with a element.

Changes will only be done to the current job!

Values will be rounded to an accuracy of \(2^{-16}\). Valid values for the correction values are between \(-2\) and \((2 - 2^{-16})\).

Warning - the correction matrix can increase the output voltage which might result in an overflow.

PARAMETER DESCRIPTION
element

the name of the element to update the correction for

TYPE: str

correction

tuple is of the form (v00, v01, v10, v11) where the matrix is \(\begin{pmatrix} v_{00} & v_{01} \\ v_{10} & v_{11}\end{pmatrix}\)

TYPE: tuple

RETURNS DESCRIPTION
Tuple[float, float, float, float]

The correction matrix, after rounding to the OPX resolution.

qm.jobs.simulated_job.SimulatedJob

Bases: RunningQmJob

get_simulated_samples

Obtain the output samples of a QUA program simulation.

Samples are returned in an object that holds the controllers in the current simulation, where each controller's name will be a property of this object. The value of each property of the returned value is an object with the following properties:

analog:

holds a dictionary with analog port names as keys and numpy array of samples as values.

digital:

holds a dictionary with digital port names as keys and numpy array of samples as values.

It is also possible to directly plot the outputs using a built-in plot command.

Example
samples = job.get_simulated_samples()
analog1 = samples.con1.analog["1"]  # obtain analog port 1 of controller "con1"
digital9 = samples.con1.analog["9"]  # obtain digital port 9 of controller "con1"
samples.con1.plot()  # Plots all active ports
samples.con1.plot(analog_ports=['1', '2'], digital_ports=['9'])  # Plots the given output ports

Note

The simulated digital waveforms are delayed by 136ns relative to the real output of the OPX.

PARAMETER DESCRIPTION
include_analog

Should we collect simulated analog samples

TYPE: bool DEFAULT: True

include_digital

Should we collect simulated digital samples

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
SimulatorSamples

The simulated samples of the job.

get_simulated_waveform_report

Get this Job's Waveform report. If any error occurred, None will be returned.

simulated_analog_waveforms

Return the results of the simulation of elements and analog outputs.

The returned dictionary has the following keys and entries:

  • elements: a dictionary containing the outputs with timestamps and values arranged by elements.

  • **controllers: a dictionary containing the outputs with timestamps and values arranged by controllers.

    • ports: a dictionary containing the outputs with timestamps and values arranged by output ports. for each element or output port, the entry is a list of dictionaries with the following information:

      • timestamp: The time, in nsec, from the start of the program to the start of the pulse.

      • samples:

        Output information, with duration given in nsec and value given normalized OPX output units.

RETURNS DESCRIPTION
Optional[WaveformInPortsType]

A dictionary containing output information for the analog outputs of the controller.

simulated_digital_waveforms

Return the results of the simulation of digital outputs.

  • controllers: a dictionary containing the outputs with timestamps and values arranged by controllers.

    • ports: a dictionary containing the outputs with timestamps and values arranged by output ports. for each element or output port, the entry is a list of dictionaries with the following information:

      • timestamp: The time, in nsec, from the start of the program to the start of the pulse.

      • samples: A list containing the sequence of outputted values, with duration given in nsec and value given as a boolean value.

RETURNS DESCRIPTION
Optional[WaveformInPortsType]

A dictionary containing output information for the analog outputs of the controller.

qm.jobs.qm_job.QmJob

Bases: RunningQmJob