---
title: PrimitiveJob (latest version)
description: API reference for qiskit.primitives.PrimitiveJob in the latest version of qiskit
source: https://quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.primitives.PrimitiveJob
---

# PrimitiveJob

*class* `qiskit.primitives.PrimitiveJob(function, *args, **kwargs)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/primitive_job.py#L25-L107)

Bases: [`BasePrimitiveJob`](/docs/api/qiskit/qiskit.primitives.BasePrimitiveJob "qiskit.primitives.base.base_primitive_job.BasePrimitiveJob")\[`ResultT`, [`JobStatus`](/docs/api/qiskit/qiskit.providers.JobStatus "qiskit.providers.jobstatus.JobStatus")]

Handle to a job from the reference implementations of the primitives in Qiskit.

This is a concrete implementation of the [`BasePrimitiveJob`](/docs/api/qiskit/qiskit.primitives.BasePrimitiveJob "qiskit.primitives.BasePrimitiveJob") interface. See the documentation of that class for a discussion of the interface.

Primitives implementers looking to create their own job classes should not subclass this, but instead subclass the interface definition [`BasePrimitiveJob`](/docs/api/qiskit/qiskit.primitives.BasePrimitiveJob "qiskit.primitives.BasePrimitiveJob").

**Parameters**

- **function** – A callable function to execute the job.
- **args** – any additional positional arguments
- **kwargs** – any additional keyword arguments

## Methods

### cancel

`cancel()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/primitive_job.py#L93-L95)

Attempt to cancel the job.

### cancelled

`cancelled()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/primitive_job.py#L103-L104)

Return whether the job has been cancelled.

**Return type**

[bool](https://docs.python.org/3/library/functions.html#bool)

### done

`done()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/primitive_job.py#L97-L98)

Return whether the job has successfully run.

**Return type**

[bool](https://docs.python.org/3/library/functions.html#bool)

### in\_final\_state

`in_final_state()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/primitive_job.py#L106-L107)

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)

### job\_id

`job_id()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/base/base_primitive_job.py#L77-L79)

Return a unique id identifying the job.

**Return type**

[str](https://docs.python.org/3/library/stdtypes.html#str)

### result

`result()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/primitive_job.py#L69-L73)

Return the results of the job.

**Return type**

*ResultT*

### running

`running()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/primitive_job.py#L100-L101)

Return whether the job is actively running.

**Return type**

[bool](https://docs.python.org/3/library/functions.html#bool)

### status

`status()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/primitive_job.py#L75-L87)

Return the status of the job.

**Return type**

[*JobStatus*](/docs/api/qiskit/qiskit.providers.JobStatus "qiskit.providers.jobstatus.JobStatus")
