cirq_google.engine.EngineJob

A job created via the Quantum Engine API.

Inherits From: AbstractJob

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).

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

project_id A project_id of the parent Google Cloud Project.
program_id Unique ID of the program within the parent project.
job_id Unique ID of the job within the parent program.
context Engine configuration and context to use.
_job The optional current job state.
result_type What type of results are expected, such as batched results or the result of a focused calibration.
job_result_future A future to be completed when the job result is available. If set, EngineJob will await this future when a caller asks for the job result. If the future is completed with a QuantumJob, it is assumed that the job has failed.

project_id A project_id of the parent Google Cloud Project.
program_id Unique ID of the program within the parent project.
job_id Unique ID of the job within the parent program.

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 EngineJob.

batched_results

View source

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

This method is intended for batched jobs. Instead of flattening results into a single list, this will return a List[Result] for each circuit in the batch.

batched_results_async

View source

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

This method is intended for batched jobs. Instead of flattening results into a single list, this will return a Sequence[Result] for each circuit in the batch.

calibration_results

View source

Returns the results of a run_calibration() call.

This function will fail if any other type of results were returned.

calibration_results_async

View source

Returns the results of a run_calibration() call.

This function will fail if any other type of results were returned by the Engine.

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 Engine 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 EngineProcessor 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 Quantum Engine job.

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

id

View source

Returns the job id.

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 EngineProgram object.

remove_labels

View source

Removes labels with given keys from the labels of a previously created quantum job.

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

Returns
This EngineJob.

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 EngineJob.

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 EngineJob.

status

View source

Return the execution status of the job.

update_time

View source

Returns when the job was last updated.

__getitem__

View source

__iter__

View source

__len__

View source