ManagedJob
class ManagedJob(start_index, experiments_count, job=None)
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
]) – Job to be managed, orNone
if not already known.
Methods
cancel
ManagedJob.cancel()
Attempt to cancel the job.
Return type
None
error_message
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.
qobj
ManagedJob.qobj()
Return the Qobj for this job.
Return type
Union
[QasmQobj
, PulseQobj
, None
]
Returns
The Qobj for this job or None
if the Qobj could not be retrieved.
result
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
) – IfTrue
, attempt to retrieve partial job results. - refresh (
bool
) – IfTrue
, re-query the server for the result. Otherwise return the cached value.
Return type
Optional
[Result
]
Returns
Job result or None
if result could not be retrieved.
Raises
IBMQJobTimeoutError – If the job does not return results before a specified timeout.
status
ManagedJob.status()
Query the server for job status.
Return type
Optional
[JobStatus
]
Returns
Current job status, or None
if an error occurred.
submit
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
,Schedule
,List
[Union
[QuantumCircuit
,Schedule
]]]) – Circuits to run. - job_name (
str
) – Name of the job. - backend (
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