View source on GitHub |
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
@abc.abstractmethod
get_processor( processor_id: str ) ->
cirq_google.engine.AbstractProcessor
Returns an EngineProcessor for a Quantum Engine processor.
Args | |
---|---|
processor_id
|
The processor unique identifier. |
Returns | |
---|---|
A EngineProcessor for the processor. |
get_program
@abc.abstractmethod
get_program( program_id: str ) ->
cirq_google.engine.AbstractProgram
Returns an existing AbstractProgram given an identifier.
Args | |
---|---|
program_id
|
Unique ID of the program. |
Returns | |
---|---|
An AbstractProgram object for the program. |
get_sampler
@abc.abstractmethod
get_sampler( processor_id: Union[str, List[str]] ) -> cirq.Sampler
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
@abc.abstractmethod
list_jobs( created_before: Optional[VALID_DATE_TYPE] = None, created_after: Optional[VALID_DATE_TYPE] = None, has_labels: Optional[Dict[str, str]] = None, execution_states: Optional[Set[quantum.ExecutionStatus.State]] = None ) -> List[
cirq_google.engine.AbstractJob
]
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
@abc.abstractmethod
list_processors() -> Sequence[
cirq_google.engine.AbstractProcessor
]
Returns all processors in this engine visible to the user.
list_programs
@abc.abstractmethod
list_programs( created_before: Optional[VALID_DATE_TYPE] = None, created_after: Optional[VALID_DATE_TYPE] = None, has_labels: Optional[Dict[str, str]] = None ) -> List[
cirq_google.engine.AbstractProgram
]
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': '*'}
|