cirq_google.engine.AbstractJob

An abstract object representing a quantum job execution.

This represents the state of a possibly asynchronous Job being executed by a simulator, the cloud Engine service, or other means.

This is an abstract interface that implementers of services or mocks should implement. It generally represents the execution of a circuit using a set of parameters called a sweep. It can also represent the execution of a batch job (a list of circuit/sweep pairs) or the execution of a calibration request.

This job may be in a variety of states. It may be scheduling, it may be executing on a machine, or it may have entered a terminal state (either succeeding or failing).

AbstractJobs can be iterated over, returning Results. These Results can also be accessed by index. Note that this will block until the results are returned.

Methods

add_labels

View source

Adds new labels to a previously created quantum job.

Params
labels New labels to add to the existing job labels.

Returns
This AbstractJob.

cancel

View source

Cancel the job.

create_time

View source

Returns when the job was created.

delete

View source

Deletes the job and result, if any.

description

View source

Returns the description of the job.

engine

View source

Returns the parent AbstractEngine object.

execution_status

View source

Return the execution status of the job.

failure

View source

Return failure code and message of the job if present.

get_calibration

View source

Returns the recorded calibration at the time when the job was run, if one was captured, else None.

get_processor

View source

Returns the AbstractProcessor for the processor the job is/was run on, if available, else None.

get_repetitions_and_sweeps

View source

Returns the repetitions and sweeps for the job.

Returns
A tuple of the repetition count and list of sweeps.

id

View source

Returns the id of this job.

labels

View source

Returns the labels of the job.

processor_ids

View source

Returns the processor ids provided when the job was created.

program

View source

Returns the parent AbstractProgramobject.

remove_labels

View source

Removes labels with given keys.

Params
label_keys Label keys to remove from the existing job labels.

Returns
This AbstractJob.

results

View source

Returns the job results, blocking until the job is complete.

results_async

View source

Returns the job results, blocking until the job is complete.

set_description

View source

Sets the description of the job.

Params
description The new description for the job.

Returns
This AbstractJob.

set_labels

View source

Sets (overwriting) the labels for a previously created quantum job.

Params
labels The entire set of new job labels.

Returns
This AbstractJob.

update_time

View source

Returns when the job was last updated.

__getitem__

View source

__iter__

View source

__len__

View source