We're celebrating World Quantum Day 2022! Join us

cirq_google.engine.SimulatedLocalEngine

Collection of processors backed by local samplers.

Inherits From: AbstractLocalEngine, AbstractEngine

This class is a wrapper around AbstractLocalEngine and adds no additional functionality and exists for naming consistency and for possible future extension.

This class assumes that all processors are local. Processors are given during initialization. Program and job querying functionality is done by serially querying all child processors.

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 exsiting AbstractProgram given an identifier.

Iteratively checks each processor for the given id.

Args
program_id Unique ID of the program within the parent project.

Returns
An AbstractProgram for the program.

Raises
KeyError if program does not exist

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.
gate_set Determines how to serialize circuits when requesting samples.

Raises
ValueError if multiple processor ids are given.

list_jobs

View source

Returns the list of jobs in the project.

All historical jobs can be retrieved using this method and filtering options are available too, to narrow down the search baesd 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 after this date or time.
has_labels retrieve jobs that have labels on them specified by this dict. If the value is set to *, filters having the label regardless of the label value will be filtered. 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.enums.ExecutionStatus.State enum for accepted values.

list_processors

View source

Returns a list of Processors that the user has visibility to in the current Engine project. The names of these processors are used to identify devices when scheduling jobs and gathering calibration metrics.

Returns
A list of EngineProcessors to access status, device and calibration information.

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 after this date or time.
has_labels retrieve programs that have labels on them specified by this dict. If the value is set to *, filters having the label regardless of the label value will be filtered. 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:*'}