警告
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
RuntimeJob¶
- class RuntimeJob(backend, api_client, credentials, job_id, program_id, params=None, creation_date=None, user_callback=None, result_decoder=<class 'qiskit.providers.ibmq.runtime.program.result_decoder.ResultDecoder'>, image='')[ソース]¶
ベースクラス:
object
Representation of a runtime program execution.
A new
RuntimeJob
instance is returned when you callIBMRuntimeService.run
to execute a runtime program, orIBMRuntimeService.job
to retrieve a previously executed job.If the program execution is successful, you can inspect the job’s status by calling
status()
. Job status can be one of theJobStatus
members.Some of the methods in this class are blocking, which means control may not be returned immediately.
result()
is an example of a blocking method:job = provider.runtime.run(...) try: job_result = job.result() # It will block until the job finishes. print("The job finished with result {}".format(job_result)) except RuntimeJobFailureError as ex: print("Job failed!: {}".format(ex))
If the program has any interim results, you can use the
callback
parameter of therun()
method to stream the interim results. Alternatively, you can use thestream_results()
method to stream the results at a later time, but before the job finishes.RuntimeJob constructor.
- パラメータ
backend (
Backend
) – The backend instance used to run this job.api_client (
RuntimeClient
) – Object for connecting to the server.credentials (
Credentials
) – Account credentials.job_id (
str
) – Job ID.program_id (
str
) – ID of the program this job is for.params (
Optional
[Dict
]) – Job parameters.creation_date (
Optional
[str
]) – Job creation date, in UTC.user_callback (
Optional
[Callable
]) – User callback function.result_decoder (
Type
[ResultDecoder
]) – AResultDecoder
subclass used to decode job results.image (
Optional
[str
]) – Runtime image used for this job: image_name:tag.
Methods
Return the backend where this job was executed.
Cancel the job.
Cancel result streaming.
Returns the reason if the job failed.
Return a unique ID identifying the job.
Return job logs.
Return the results of the job.
Return the status of the job.
Start streaming job results.
Poll the job status until it progresses to a final state such as
DONE
orERROR
.Attributes
- creation_date¶
Job creation date in local time.
- 戻り値の型
Optional
[datetime
]- 戻り値
The job creation date as a datetime object, in local time, or
None
if creation date is not available.
- image¶
Return the runtime image used for the job.
- 戻り値
image_name:tag or 「」 if the default image is used.
- 戻り値の型
Runtime image
- inputs¶
Job input parameters.
- 戻り値の型
Dict
- 戻り値
Input parameters used in this job.
- program_id¶
Program ID.
- 戻り値の型
str
- 戻り値
ID of the program this job is for.