qiskit-documentation/docs/api/qiskit/0.42/qiskit.providers.ibmq.manag...

152 lines
6.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: ManagedJob
description: API reference for qiskit.providers.ibmq.managed.ManagedJob
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.providers.ibmq.managed.ManagedJob
---
<Admonition title="Warning" type="caution">
The package `qiskit-ibmq-provider` is being deprecated and its repo is going to be archived soon. Please transition to the new packages. More information in [https://ibm.biz/provider\_migration\_guide](https://ibm.biz/provider_migration_guide)
</Admonition>
# ManagedJob
<Class id="qiskit.providers.ibmq.managed.ManagedJob" isDedicatedPage={true} github="https://github.com/qiskit/qiskit-ibmq-provider/tree/stable/0.20/qiskit/providers/ibmq/managed/managedjob.py" signature="ManagedJob(start_index, experiments_count, job=None)" modifiers="class">
Bases: `object`
Job managed by the Job Manager.
ManagedJob constructor.
**Parameters**
* **start\_index** (`int`) Starting index of the experiment set.
* **experiments\_count** (`int`) Number of experiments.
* **job** (`Optional`\[[`IBMQJob`](qiskit.providers.ibmq.job.IBMQJob "qiskit.providers.ibmq.job.ibmqjob.IBMQJob")]) Job to be managed, or `None` if not already known.
## Methods
<Admonition title="Warning" type="caution">
The package `qiskit-ibmq-provider` is being deprecated and its repo is going to be archived soon. Please transition to the new packages. More information in [https://ibm.biz/provider\_migration\_guide](https://ibm.biz/provider_migration_guide)
</Admonition>
### cancel
<Function id="qiskit.providers.ibmq.managed.ManagedJob.cancel" signature="ManagedJob.cancel()">
Attempt to cancel the job.
**Return type**
`None`
</Function>
<Admonition title="Warning" type="caution">
The package `qiskit-ibmq-provider` is being deprecated and its repo is going to be archived soon. Please transition to the new packages. More information in [https://ibm.biz/provider\_migration\_guide](https://ibm.biz/provider_migration_guide)
</Admonition>
### error\_message
<Function id="qiskit.providers.ibmq.managed.ManagedJob.error_message" signature="ManagedJob.error_message()">
Provide details about the reason of failure.
**Return type**
`Optional`\[`str`]
**Returns**
An error report if the job failed or `None` otherwise.
</Function>
<Admonition title="Warning" type="caution">
The package `qiskit-ibmq-provider` is being deprecated and its repo is going to be archived soon. Please transition to the new packages. More information in [https://ibm.biz/provider\_migration\_guide](https://ibm.biz/provider_migration_guide)
</Admonition>
### qobj
<Function id="qiskit.providers.ibmq.managed.ManagedJob.qobj" signature="ManagedJob.qobj()">
Return the Qobj for this job.
**Return type**
`Union`\[[`QasmQobj`](qiskit.qobj.QasmQobj "qiskit.qobj.qasm_qobj.QasmQobj"), [`PulseQobj`](qiskit.qobj.PulseQobj "qiskit.qobj.pulse_qobj.PulseQobj"), `None`]
**Returns**
The Qobj for this job or `None` if the Qobj could not be retrieved.
</Function>
<Admonition title="Warning" type="caution">
The package `qiskit-ibmq-provider` is being deprecated and its repo is going to be archived soon. Please transition to the new packages. More information in [https://ibm.biz/provider\_migration\_guide](https://ibm.biz/provider_migration_guide)
</Admonition>
### result
<Function id="qiskit.providers.ibmq.managed.ManagedJob.result" signature="ManagedJob.result(timeout=None, partial=False, refresh=False)">
Return the result of the job.
**Parameters**
* **timeout** (`Optional`\[`float`]) Number of seconds to wait for job.
* **partial** (`bool`) If `True`, attempt to retrieve partial job results.
* **refresh** (`bool`) If `True`, re-query the server for the result. Otherwise return the cached value.
**Return type**
`Optional`\[[`Result`](qiskit.result.Result "qiskit.result.result.Result")]
**Returns**
Job result or `None` if result could not be retrieved.
**Raises**
[**IBMQJobTimeoutError**](qiskit.providers.ibmq.job.IBMQJobTimeoutError "qiskit.providers.ibmq.job.IBMQJobTimeoutError") If the job does not return results before a specified timeout.
</Function>
<Admonition title="Warning" type="caution">
The package `qiskit-ibmq-provider` is being deprecated and its repo is going to be archived soon. Please transition to the new packages. More information in [https://ibm.biz/provider\_migration\_guide](https://ibm.biz/provider_migration_guide)
</Admonition>
### status
<Function id="qiskit.providers.ibmq.managed.ManagedJob.status" signature="ManagedJob.status()">
Query the server for job status.
**Return type**
`Optional`\[[`JobStatus`](qiskit.providers.JobStatus "qiskit.providers.jobstatus.JobStatus")]
**Returns**
Current job status, or `None` if an error occurred.
</Function>
<Admonition title="Warning" type="caution">
The package `qiskit-ibmq-provider` is being deprecated and its repo is going to be archived soon. Please transition to the new packages. More information in [https://ibm.biz/provider\_migration\_guide](https://ibm.biz/provider_migration_guide)
</Admonition>
### submit
<Function id="qiskit.providers.ibmq.managed.ManagedJob.submit" signature="ManagedJob.submit(circuits, job_name, backend, executor, submit_lock, job_share_level=None, job_tags=None, **run_config)">
Submit the job.
**Parameters**
* **circuits** (`Union`\[[`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit"), [`Schedule`](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule"), `List`\[`Union`\[[`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit"), [`Schedule`](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule")]]]) Circuits to run.
* **job\_name** (`str`) Name of the job.
* **backend** ([`IBMQBackend`](qiskit.providers.ibmq.IBMQBackend "qiskit.providers.ibmq.ibmqbackend.IBMQBackend")) Backend to execute the experiments on.
* **executor** (`ThreadPoolExecutor`) The thread pool used to submit the job.
* **submit\_lock** (`allocate_lock`) Lock used to synchronize job submission.
* **job\_share\_level** (`Optional`\[`ApiJobShareLevel`]) Job share level.
* **job\_tags** (`Optional`\[`List`\[`str`]]) Tags to be assigned to the job.
* **\*\*run\_config** Extra arguments used to configure the run.
**Return type**
`None`
</Function>
</Class>