---
title: PrimitiveJob (v2.4)
description: API reference for qiskit.primitives.PrimitiveJob in qiskit v2.4
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/2.4/qiskit.primitives.PrimitiveJob
---

# PrimitiveJob

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

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

Bases: [`BasePrimitiveJob`](/docs/api/qiskit/2.4/qiskit.primitives.BasePrimitiveJob "qiskit.primitives.base.base_primitive_job.BasePrimitiveJob")\[`ResultT`, [`JobStatus`](/docs/api/qiskit/2.4/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/2.4/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/2.4/qiskit.primitives.BasePrimitiveJob "qiskit.primitives.BasePrimitiveJob").

**Parameters**

**function** – A callable function to execute the job.

## Methods

### cancel

`cancel()`

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

Attempt to cancel the job.

### cancelled

`cancelled()`

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

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.4/qiskit/primitives/primitive_job.py#L95-L96)

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.4/qiskit/primitives/primitive_job.py#L104-L105)

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.4/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.4/qiskit/primitives/primitive_job.py#L67-L71)

Return the results of the job.

**Return type**

*ResultT*

### running

`running()`

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

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.4/qiskit/primitives/primitive_job.py#L73-L85)

Return the status of the job.

**Return type**

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