Korean
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

IBMQJob

class IBMQJob(backend, api_client, job_id, creation_date, status, kind=None, name=None, time_per_step=None, result=None, qobj=None, error=None, tags=None, run_mode=None, share_level=None, client_info=None, experiment_id=None, **kwargs)[소스]

기반 클래스: JobV1

Representation of a job that executes on an IBM Quantum Experience backend.

The job may be executed on a simulator or a real device. A new IBMQJob instance is returned when you call IBMQBackend.run() to submit a job to a particular backend.

If the job is successfully submitted, you can inspect the job’s status by calling status(). Job status can be one of the JobStatus members. For example:

from qiskit.providers.jobstatus import JobStatus

job = backend.run(...)

try:
    job_status = job.status()  # Query the backend server for job status.
    if job_status is JobStatus.RUNNING:
        print("The job is still running")
except IBMQJobApiError as ex:
    print("Something wrong happened!: {}".format(ex))

참고

An error may occur when querying the remote server to get job information. The most common errors are temporary network failures and server errors, in which case an IBMQJobApiError is raised. These errors usually clear quickly, so retrying the operation is likely to succeed.

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 = backend.run(...)

try:
    job_result = job.result()  # It will block until the job finishes.
    print("The job finished with result {}".format(job_result))
except JobError as ex:
    print("Something wrong happened!: {}".format(ex))

Job information retrieved from the server is attached to the IBMQJob instance as attributes. Given that Qiskit and the server can be updated independently, some of these attributes might be deprecated or experimental. Supported attributes can be retrieved via methods. For example, you can use creation_date() to retrieve the job creation date, which is a supported attribute.

IBMQJob constructor.

매개변수
  • backend (IBMQBackend) – The backend instance used to run this job.

  • api_client (AccountClient) – Object for connecting to the server.

  • job_id (str) – Job ID.

  • creation_date (str) – Job creation date.

  • status (str) – Job status returned by the server.

  • kind (Optional[str]) – Job type.

  • name (Optional[str]) – Job name.

  • time_per_step (Optional[dict]) – Time spent for each processing step.

  • result (Optional[dict]) – Job result.

  • qobj (Union[dict, QasmQobj, PulseQobj, None]) – Qobj for this job.

  • error (Optional[dict]) – Job error.

  • tags (Optional[List[str]]) – Job tags.

  • run_mode (Optional[str]) – Scheduling mode the job runs in.

  • share_level (Optional[str]) – Level the job can be shared with.

  • client_info (Optional[Dict[str, str]]) – Client version.

  • experiment_id (Optional[str]) – ID of the experiment this job is part of.

  • kwargs (Any) – Additional job attributes.

Methods

backend

Return the backend where this job was executed.

backend_options

Return the backend configuration options used for this job.

cancel

Attempt to cancel the job.

cancelled

Return whether the job has been cancelled.

circuits

Return the circuits or pulse schedules for this job.

creation_date

Return job creation date, in local time.

done

Return whether the job has successfully run.

error_message

Provide details about the reason of failure.

header

Return the user header specified for this job.

in_final_state

Return whether the job is in a final job state such as DONE or ERROR.

job_id

Return the job ID assigned by the server.

name

Return the name assigned to this job.

properties

Return the backend properties for this job.

qobj

Return the Qobj for this job.

queue_info

Return queue information for this job.

queue_position

Return the position of the job in the server queue.

refresh

Obtain the latest job information from the server.

result

Return the result of the job.

running

Return whether the job is actively running.

scheduling_mode

Return the scheduling mode the job is in.

share_level

Return the share level of the job.

status

Query the server for the latest job status.

submit

Unsupported method.

tags

Return the tags assigned to this job.

time_per_step

Return the date and time information on each step of the job processing.

update_name

Update the name associated with this job.

update_tags

Update the tags associated with this job.

wait_for_final_state

Wait until the job progresses to a final state such as DONE or ERROR.

Attributes

client_version

Return version of the client used for this job.

반환 형식

Dict[str, str]

반환

Client version in dictionary format, where the key is the name

of the client and the value is the version.

experiment_id

Return the experiment ID.

반환 형식

str

반환

ID of the experiment this job is part of.

version = 1