This class supports running circuits on QCS quantum hardware as well as pyQuil's quantum virtual machine (QVM).
cirq_rigetti.service.RigettiQCSService(
quantum_computer: QuantumComputer,
executor: cirq_rigetti.circuit_sweep_executors.CircuitSweepExecutor
= cirq_rigetti.circuit_sweep_executors.with_quilc_compilation_and_cirq_parameter_resolution
,
transformer: cirq_rigetti.circuit_transformers.CircuitTransformer
= cirq_rigetti.circuit_transformers.default
)
When sampling a parametric circuit
across a parameter sweep, use RigettiQCSSampler
instead.
This class also includes a number of convenience static methods for describing
Rigetti quantum processors through the qcs_api_client
.
Args |
quantum_computer
|
A pyquil.api.QuantumComputer against which to run the cirq.Circuit s.
|
executor
|
A callable that first uses the below transformer on cirq.Circuit s and
then executes the transformed circuit on the quantum_computer. You may pass your
own callable or any static method on CircuitSweepExecutors.
|
transformer
|
A callable that transforms the cirq.Circuit into a pyquil.Program.
You may pass your own callable or any static method on CircuitTransformers.
|
Methods
get_instruction_set_architecture
View source
@staticmethod
get_instruction_set_architecture(
quantum_processor_id: str, client: Optional[QCSClient] = None
) -> InstructionSetArchitecture
Retrieve the Instruction Set Architecture of a QuantumProcessor by ID.
This
includes site specific operations and native gate capabilities.
Args |
quantum_processor_id
|
The identifier of the Rigetti QCS quantum processor.
|
client
|
Optional; A QCSClient initialized with Rigetti QCS credentials
and configuration. If not provided, qcs_api_client will initialize a
configured client based on configured values in the current user's
~/.qcs directory or default values.
|
Returns |
A qcs_api_client.models.InstructionSetArchitecture containing the device specification.
|
get_quilt_calibrations
View source
@staticmethod
get_quilt_calibrations(
quantum_processor_id: str, client: Optional[QCSClient] = None
) -> str
Retrieve the calibration data used for client-side Quil-T generation.
Args |
quantum_processor_id
|
The identifier of the Rigetti QCS quantum processor.
|
client
|
Optional; A QCSClient initialized with Rigetti QCS credentials
and configuration. If not provided, qcs_api_client will initialize a
configured client based on configured values in the current user's
~/.qcs directory or default values.
|
Returns |
A qcs_api_client.models.GetQuiltCalibrationsResponse containing the
device calibrations.
|
list_quantum_processors
View source
@staticmethod
list_quantum_processors(
client: Optional[QCSClient] = None
) -> List[str]
Retrieve a list of available Rigetti quantum processors.
Args |
client
|
Optional; A QCSClient initialized with Rigetti QCS credentials
and configuration. If not provided, qcs_api_client will initialize a
configured client based on configured values in the current user's
~/.qcs directory or default values.
|
Returns |
A qcs_api_client.models.ListQuantumProcessorsResponse containing the identifiers
of the available quantum processors..
|
run
View source
run(
circuit: cirq.Circuit,
repetitions: int,
param_resolver: cirq.ParamResolverOrSimilarType = cirq.ParamResolver({})
) -> cirq.Result
Run the given circuit on the QuantumComputer with which the user initialized the service.
Args |
circuit
|
The circuit to run.
|
repetitions
|
The number of times to run the circuit.
|
param_resolver
|
A cirq.ParamResolver to resolve parameters in circuit.
|
sampler
View source
sampler() -> cirq_rigetti.sampler.RigettiQCSSampler
Initializes a cirq.Sampler object for invoking the sampler interface.
Returns |
A cirq.Sampler for running on the requested quantum_computer.
|