qiskit-documentation/docs/api/qiskit/1.2/qiskit.primitives.Primitive...

99 lines
3.5 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: PrimitiveJob (v1.2)
description: API reference for qiskit.primitives.PrimitiveJob in qiskit v1.2
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.primitives.PrimitiveJob
---
# PrimitiveJob
<Class id="qiskit.primitives.PrimitiveJob" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/primitive_job.py#L25-L81" signature="qiskit.primitives.PrimitiveJob(function, *args, **kwargs)" modifiers="class">
Bases: [`BasePrimitiveJob`](qiskit.primitives.BasePrimitiveJob "qiskit.primitives.base.base_primitive_job.BasePrimitiveJob")\[`ResultT`, [`JobStatus`](qiskit.providers.JobStatus "qiskit.providers.jobstatus.JobStatus")]
Primitive job class for the reference implementations of Primitives.
**Parameters**
**function** A callable function to execute the job.
## Methods
### cancel
<Function id="qiskit.primitives.PrimitiveJob.cancel" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/primitive_job.py#L67-L69" signature="cancel()">
Attempt to cancel the job.
</Function>
### cancelled
<Function id="qiskit.primitives.PrimitiveJob.cancelled" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/primitive_job.py#L77-L78" signature="cancelled()">
Return whether the job has been cancelled.
**Return type**
[bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")
</Function>
### done
<Function id="qiskit.primitives.PrimitiveJob.done" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/primitive_job.py#L71-L72" signature="done()">
Return whether the job has successfully run.
**Return type**
[bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")
</Function>
### in\_final\_state
<Function id="qiskit.primitives.PrimitiveJob.in_final_state" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/primitive_job.py#L80-L81" signature="in_final_state()">
Return whether the job is in a final job state such as `DONE` or `ERROR`.
**Return type**
[bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")
</Function>
### job\_id
<Function id="qiskit.primitives.PrimitiveJob.job_id" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/base/base_primitive_job.py#L39-L41" signature="job_id()">
Return a unique id identifying the job.
**Return type**
[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")
</Function>
### result
<Function id="qiskit.primitives.PrimitiveJob.result" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/primitive_job.py#L49-L51" signature="result()">
Return the results of the job.
**Return type**
*ResultT*
</Function>
### running
<Function id="qiskit.primitives.PrimitiveJob.running" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/primitive_job.py#L74-L75" signature="running()">
Return whether the job is actively running.
**Return type**
[bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")
</Function>
### status
<Function id="qiskit.primitives.PrimitiveJob.status" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/primitives/primitive_job.py#L53-L61" signature="status()">
Return the status of the job.
**Return type**
[*JobStatus*](qiskit.providers.JobStatus "qiskit.providers.jobstatus.JobStatus")
</Function>
</Class>