cirq_rigetti.service.RigettiQCSService

This class supports running circuits on QCS quantum hardware as well as pyQuil's quantum virtual machine (QVM).

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.

quantum_computer A pyquil.api.QuantumComputer against which to run the cirq.Circuits.
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

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

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

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

Returns
A cirq.Result.

sampler

View source

Initializes a cirq.Sampler object for invoking the sampler interface.

Returns
A cirq.Sampler for running on the requested quantum_computer.