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:
|
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:
|
output |
the output key name as appears in the element config under 'outputs'.
TYPE:
|
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:
|
RETURNS | DESCRIPTION |
---|---|
float
|
The intermediate frequency of the given element
TYPE:
|
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
TYPE:
|
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
TYPE:
|
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:
|
iq_input |
The port name as appears in the element config. Options:
TYPE:
|
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:
|
digital_input |
The digital input name as appears in the element's config
TYPE:
|
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:
|
digital_input |
The digital input name as appears in the element's config
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
int
|
The delay |
get_status
¶
Returns the status of the job, one of the following strings:
In queue
- Program is in the queueRunning
- Program is currently runningProcessing
- Program done but data processing is ongoingDone
- Program and data processing doneCanceled
- Program was canceled before it was doneError
- 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:
|
data |
The data to be inserted. The data's size must match the size of the input stream.
TYPE:
|
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:
|
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:
|
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:
|
output |
the output key name as appears in the element config under 'outputs'.
TYPE:
|
offset |
the dc value to set to, in volts. Ranges from -0.5 to 0.5 - 2^-16 in steps of 2^-16.
TYPE:
|
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:
|
freq |
The intermediate frequency to set to the given element
TYPE:
|
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
TYPE:
|
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
TYPE:
|
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
TYPE:
|
io2 |
The value to be placed in
TYPE:
|
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:
|
input |
the input name as appears in the element config. Options:
TYPE:
|
offset |
The dc value to set to, in volts. Ranges from -0.5 to 0.5 - 2^-16 in steps of 2^-16.
TYPE:
|
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:
|
digital_input |
the digital input name as appears in the element's config
TYPE:
|
buffer |
The buffer value to set to, in ns.
TYPE:
|
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:
|
digital_input |
The digital input name as appears in the element's config
TYPE:
|
delay |
The delay value to set to, in ns.
TYPE:
|
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:
|
frequency_hz |
The frequency to set to the given element
TYPE:
|
update_component |
The component to update the frequency for: "upconverter", "downconverter", or "both"
TYPE:
|
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:
|
timeout |
The timeout time, in seconds
TYPE:
|
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:
|
data |
The data to be inserted. The data's size must match the size of the input stream.
TYPE:
|
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