qiskit-documentation/docs/api/qiskit/0.33/qiskit.providers.basicaer.B...

163 lines
4.2 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: BasicAerJob
description: API reference for qiskit.providers.basicaer.BasicAerJob
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.providers.basicaer.BasicAerJob
---
# BasicAerJob
<Class id="qiskit.providers.basicaer.BasicAerJob" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.19/qiskit/providers/basicaer/basicaerjob.py" signature="BasicAerJob(backend, job_id, result)" modifiers="class">
Bases: `qiskit.providers.job.JobV1`
BasicAerJob class.
Initializes the asynchronous job.
**Parameters**
* **backend** the backend used to run the job.
* **job\_id** a unique id in the context of the backend used to run the job.
* **kwargs** Any key value metadata to associate with this job.
## Methods
### backend
<Function id="qiskit.providers.basicaer.BasicAerJob.backend" signature="BasicAerJob.backend()">
Return the instance of the backend used for this job.
</Function>
### cancel
<Function id="qiskit.providers.basicaer.BasicAerJob.cancel" signature="BasicAerJob.cancel()">
Attempt to cancel the job.
</Function>
### cancelled
<Function id="qiskit.providers.basicaer.BasicAerJob.cancelled" signature="BasicAerJob.cancelled()">
Return whether the job has been cancelled.
**Return type**
`bool`
</Function>
### done
<Function id="qiskit.providers.basicaer.BasicAerJob.done" signature="BasicAerJob.done()">
Return whether the job has successfully run.
**Return type**
`bool`
</Function>
### in\_final\_state
<Function id="qiskit.providers.basicaer.BasicAerJob.in_final_state" signature="BasicAerJob.in_final_state()">
Return whether the job is in a final job state such as `DONE` or `ERROR`.
**Return type**
`bool`
</Function>
### job\_id
<Function id="qiskit.providers.basicaer.BasicAerJob.job_id" signature="BasicAerJob.job_id()">
Return a unique id identifying the job.
**Return type**
`str`
</Function>
### result
<Function id="qiskit.providers.basicaer.BasicAerJob.result" signature="BasicAerJob.result(timeout=None)">
Get job result .
**Returns**
Result object
**Return type**
qiskit.Result
</Function>
### running
<Function id="qiskit.providers.basicaer.BasicAerJob.running" signature="BasicAerJob.running()">
Return whether the job is actively running.
**Return type**
`bool`
</Function>
### status
<Function id="qiskit.providers.basicaer.BasicAerJob.status" signature="BasicAerJob.status()">
Gets the status of the job by querying the Pythons future
**Returns**
The current JobStatus
**Return type**
[qiskit.providers.JobStatus](qiskit.providers.JobStatus "qiskit.providers.JobStatus")
</Function>
### submit
<Function id="qiskit.providers.basicaer.BasicAerJob.submit" signature="BasicAerJob.submit()">
Submit the job to the backend for execution.
**Raises**
[**JobError**](qiskit.providers.JobError "qiskit.providers.JobError") if trying to re-submit the job.
</Function>
### wait\_for\_final\_state
<Function id="qiskit.providers.basicaer.BasicAerJob.wait_for_final_state" signature="BasicAerJob.wait_for_final_state(timeout=None, wait=5, callback=None)">
Poll the job status until it progresses to a final state such as `DONE` or `ERROR`.
**Parameters**
* **timeout** (`Optional`\[`float`]) Seconds to wait for the job. If `None`, wait indefinitely.
* **wait** (`float`) Seconds between queries.
* **callback** (`Optional`\[`Callable`])
Callback function invoked after each query. The following positional arguments are provided to the callback function:
* job\_id: Job ID
* job\_status: Status of the job from the last query
* job: This BaseJob instance
Note: different subclass might provide different arguments to the callback function.
**Raises**
[**JobTimeoutError**](qiskit.providers.JobTimeoutError "qiskit.providers.JobTimeoutError") If the job does not reach a final state before the specified timeout.
**Return type**
`None`
</Function>
## Attributes
### version
<Attribute id="qiskit.providers.basicaer.BasicAerJob.version" attributeValue="1" />
</Class>