AlgorithmJob#
- class AlgorithmJob(function, *args, **kwargs)[source]#
Bases:
PrimitiveJob
This class is introduced for typing purposes and provides no additional function beyond that inherited from its parents.
Update:
AlgorithmJob.submit()
method added. See its documentation for more info.- Parameters:
function – A callable function to execute the job.
Methods
- cancel()#
Attempt to cancel the job.
- in_final_state()#
Return whether the job is in a final job state such as
DONE
orERROR
.- Return type:
- result()#
Return the results of the job.
- Return type:
ResultT
- submit()[source]#
Submit the job for execution.
For V1 primitives, Qiskit
PrimitiveJob
subclassed JobV1 and definedsubmit()
.PrimitiveJob
was updated for V2 primitives, no longer subclassesJobV1
, and now has a private_submit()
method, withsubmit()
being deprecated as of Qiskit version 0.46. This maintains thesubmit()
forAlgorithmJob
here as it’s called in many places for such a job. An alternative could be to make 0.46 the required minimum version and alter all algorithm’s call sites to use_submit()
and make this an empty class again as it once was. For now this way maintains compatibility with the current min version of 0.44.