cirq_google.engine.AbstractEngine

An abstract object representing a collection of quantum processors.

Each processor within the AbstractEngine can be referenced by a string identifier through the get_processor interface.

The Engine interface also includes convenience methods to access programs, jobs, and sampler.

This is an abstract interface and inheritors must implement the abstract methods.

Methods

get_processor

View source

Returns an EngineProcessor for a Quantum Engine processor.

Args
processor_id The processor unique identifier.

Returns
A EngineProcessor for the processor.

get_program

View source

Returns an existing AbstractProgram given an identifier.

Args
program_id Unique ID of the program.

Returns
An AbstractProgram object for the program.

get_sampler

View source

Returns a sampler backed by the engine.

Args
processor_id String identifier, or list of string identifiers, determining which processors may be used when sampling.

list_jobs

View source

Returns the list of jobs that match the specified criteria.

All historical jobs can be retrieved using this method and filtering options are available too, to narrow down the search based on:

  • creation time
  • job labels
  • execution states

Args
created_after retrieve jobs that were created after this date or time.
created_before retrieve jobs that were created before this date or time.
has_labels retrieve jobs that have labels on them specified by this dict. If the value is set to *, jobs having the label regardless of the label value will be returned. For example, to query programs that have the shape label and have the color label with value red can be queried using

{'color': 'red', 'shape':'*'}

execution_states retrieve jobs that have an execution state that is contained in execution_states. See quantum.ExecutionStatus.State enum for accepted values.

list_processors

View source

Returns all processors in this engine visible to the user.

list_programs

View source

Returns a list of previously executed quantum programs.

Args
created_after retrieve programs that were created after this date or time.
created_before retrieve programs that were created before this date or time.
has_labels retrieve programs that have labels on them specified by this dict. If the value is set to *, programs having the label regardless of the label value will be returned. For example, to query programs that have the shape label and have the color label with value red can be queried using {'color': 'red', 'shape': '*'}