cirq_google.engine.AbstractLocalJob

A job that handles labels and descriptions locally in-memory.

Inherits From: AbstractJob

This class is designed to make writing custom AbstractJob objects
that function in-memory easier.  This class will handle basic functionality
expected to be common across all local implementations.

Implementors of this class should write the following functions:

  - Status functions: execution_status, failure
  - Action functions: cancel, delete
  - Result functions: results, batched_results, calibration_results

` Attributes: processor_ids: A string list of processor ids that this job can be run on. processor_id: If provided, the processor id that the job was run on. If not provided, assumed to be the first element of processor_ids parent_program: Program containing this job repetitions: number of repetitions for each parameter set sweeps: list of Sweeps that this job should iterate through.

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.

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 List[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.

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 program's 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 created, from the parent Engine object.

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 identifier 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 AbstractLocalProgram 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 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