Skip to content

QM Job API

This page shows the Job API used with the OPX1000 with QOP 3.x, it is currently not supported by the OPX+. The equivalent OPX+ API can be found here.

qm.api.v2.job_api.job_api.JobApi

cancel

Cancels the job

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_compilation_config

Args:

 The config with which this job was compiled

get_element_correction

Gets the correction matrix for correcting gain and phase imbalances of an IQ mixer associated with an 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

get_errors

Args:

 A list of all errors in the execution report

get_input_dc_offset_by_element

Get the current DC offset of the OPX analog input channel associated with an element.

PARAMETER DESCRIPTION
element

the name of the element to get the correction for

TYPE: str

output

the output key name as appears in the element config under 'outputs'.

TYPE: str

RETURNS DESCRIPTION
float

The offset, in volts

get_intermediate_frequency

Gets the intermediate frequency of the element

PARAMETER DESCRIPTION
element

The name of the element whose intermediate frequency will be updated

TYPE: str

RETURNS DESCRIPTION
float

The intermediate frequency of the given element

TYPE: float

get_io1_value

Gets the data stored in IO1

Data will be presented as the type given. If no type was given, it'll have three fields: int_value, double_value, & boolean_value

PARAMETER DESCRIPTION
as_type

The type of IO1

TYPE: Optional[IoValueTypes] DEFAULT: None

Args:

 ``IO1``

get_io2_value

Gets the data stored in `IO12

Data will be presented as the type given. If no type was given, it'll have three fields: int_value, double_value, & boolean_value

PARAMETER DESCRIPTION
as_type

The type of IO2

TYPE: Optional[IoValueTypes] DEFAULT: None

Args:

 ``IO2``

get_io_values

Gets the data stored in IO1 & IO2

Data will be presented as the type given. If no type was given, it'll have three fields: int_value, double_value, & boolean_value Args: io1_type: The type of IO1 io2_type: The type of IO1 Args:

 A tuple of (``IO1``, ``IO2``)

get_job_id

Args:

 The job's ID

get_output_dc_offset_by_element

Get the current DC offset of the OPX analog output channel associated with an element.

PARAMETER DESCRIPTION
element

The name of the element to get the correction for

TYPE: str

iq_input

The port name as appears in the element config. Options:

'single' for an element with a single input

'I' or 'Q' for an element with mixer inputs

TYPE: Optional[Literal['I', 'Q', 'single']] DEFAULT: None

RETURNS DESCRIPTION
float

The offset, in volts

get_output_digital_buffer

Gets the buffer for digital input of the element

PARAMETER DESCRIPTION
element

The name of the element to get the buffer for

TYPE: str

digital_input

The digital input name as appears in the element's config

TYPE: str

RETURNS DESCRIPTION
int

The buffer

get_output_digital_delay

Gets the delay of the digital input of the element

PARAMETER DESCRIPTION
element

The name of the element to get the delay for

TYPE: str

digital_input

The digital input name as appears in the element's config

TYPE: str

RETURNS DESCRIPTION
int

The delay

get_status

Returns the status of the job, one of the following strings:

  • In queue - Program is in the queue
  • Running - Program is currently running
  • Processing - Program done but data processing is ongoing
  • Done - Program and data processing done
  • Canceled - Program was canceled before it was done
  • Error - Program encountered an error

Args:

 The job status

is_finished

Args:

 Will return true if the job will no longer run (Has reached "Completed", "Canceled" or "Error").

is_paused

Args:

 Returns `True` if the job was paused from QUA.

is_running

Args:

 Will return true if the job is currently running

push_to_input_stream

Push 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.

PARAMETER DESCRIPTION
stream_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[Union[bool, int, float]]

resume

Resumes a program that was halted using the pause statement

set_element_correction

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

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

set_input_dc_offset_by_element

Set the current DC offset of the OPX analog input channel associated with an element.

PARAMETER DESCRIPTION
element

the name of the element to update the correction for

TYPE: str

output

the output key name as appears in the element config under 'outputs'.

TYPE: str

offset

the dc value to set to, in volts. Ranges from -0.5 to 0.5 - 2^-16 in steps of 2^-16.

TYPE: float

Note

If the sum of the DC offset and the largest waveform data-point exceed the range, DAC output overflow will occur and the output will be corrupted.

set_intermediate_frequency

Sets the intermediate frequency of the element

PARAMETER DESCRIPTION
element

The name of the element whose intermediate frequency will be updated

TYPE: str

freq

The intermediate frequency to set to the given element

TYPE: float

set_io1_value

Sets the values of IO1.

This can be used later inside a QUA program as a QUA variable IO1, IO2 without declaration. The type of QUA variable is inferred from the python type according to the following rule:

int -> int float -> fixed bool -> bool

PARAMETER DESCRIPTION
value

The value to be placed in IO1

TYPE: Optional[NumpySupportedValue]

set_io2_value

Sets the values of IO2.

This can be used later inside a QUA program as a QUA variable IO1, IO2 without declaration. The type of QUA variable is inferred from the python type according to the following rule:

int -> int float -> fixed bool -> bool

PARAMETER DESCRIPTION
value

The value to be placed in IO2

TYPE: Optional[NumpySupportedValue]

set_io_values

Sets the values of IO1 & `IO2. If only one is given, then the value of the second will remain unchanged.

This can be used later inside a QUA program as a QUA variable IO1, IO2 without declaration. The type of QUA variable is inferred from the python type according to the following rule:

int -> int float -> fixed bool -> bool

PARAMETER DESCRIPTION
io1

The value to be placed in IO1

TYPE: Optional[NumpySupportedValue] DEFAULT: None

io2

The value to be placed in IO2

TYPE: Optional[NumpySupportedValue] DEFAULT: None

set_output_dc_offset_by_element

Set the current DC offset of the OPX analog output channel associated with an element.

PARAMETER DESCRIPTION
element

the name of the element to update the correction for

TYPE: str

input

the input name as appears in the element config. Options:

'single' for an element with a single input

'I' or 'Q' or a tuple ('I', 'Q') for an element with mixer inputs

TYPE: Union[str, Tuple[str, str], List[str]]

offset

The dc value to set to, in volts. Ranges from -0.5 to 0.5 - 2^-16 in steps of 2^-16.

TYPE: Union[float, Tuple[float, float], List[float]]

Examples:

job.set_output_dc_offset_by_element('flux', 'single', 0.1)
job.set_output_dc_offset_by_element('qubit', 'I', -0.01)
job.set_output_dc_offset_by_element('qubit', ('I', 'Q'), (-0.01, 0.05))

Note:

If the sum of the DC offset and the largest waveform data-point exceed the range,
DAC output overflow will occur and the output will be corrupted.

set_output_digital_buffer

Sets the buffer for digital input of the element

PARAMETER DESCRIPTION
element

The name of the element to update buffer for

TYPE: str

digital_input

the digital input name as appears in the element's config

TYPE: str

buffer

The buffer value to set to, in ns.

TYPE: int

set_output_digital_delay

Sets the delay of the digital input of the element

PARAMETER DESCRIPTION
element

The name of the element to update delay for

TYPE: str

digital_input

The digital input name as appears in the element's config

TYPE: str

delay

The delay value to set to, in ns.

TYPE: int

update_oscillator_frequency

Set the upconverter frequency or downconverter frequency of the microwave input of the element

PARAMETER DESCRIPTION
element

The name of the element to update the correction for

TYPE: str

frequency_hz

The frequency to set to the given element

TYPE: float

update_component

The component to update the frequency for: "upconverter", "downconverter", or "both"

TYPE: str DEFAULT: 'both'

wait_until

Waits until a specific state is reached. If the job is already passed the given state, the function will immediately return. See get_status for a list of statuses.

If the state cannot be reached (e.g., waiting for “Done” but the job is “Canceled”) then an error is raised.

If the timeout time, has passed, an error is raised.

PARAMETER DESCRIPTION
state

The state to wait for

TYPE: Union[JobStatus, Collection[JobStatus]]

timeout

The timeout time, in seconds

TYPE: float

qm.api.v2.job_api.job_api.JobApiWithDeprecations

status: str property

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

halt

Halts the job on the opx

insert_input_stream

Deprecated - Please use job.push_to_input_stream.

push_to_input_stream

Push 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.

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]

wait_for_execution

Deprecated - This method is going to be removed, please use job.wait_until("Running").

Waits until the job has passed the "Running" state. If the timeout is reached, the function will raise an error. Args: timeout: The timeout time, in seconds Args:

 The running job