Rigetti provider

Tip

When you create an Azure Quantum workspace you automatically get USD500 free Azure Quantum Credits for each quantum hardware provider. You can use the Azure Quantum Credits to submit your first quantum programs to real quantum hardware.

Note

The Ankaa-2 QPU is retired from the Azure Quantum service as of October 4, 2024.

Rigetti quantum processors are universal, gate-model machines based on tunable superconducting qubits. System features and device characteristics include enhanced readout capabilities, a speedup in quantum processing times, fast gate times for multiple entangling gate families, rapid sampling via active register reset, and parametric control.

  • Publisher: Rigetti
  • Provider ID: rigetti

The Rigetti provider makes the following targets available:

Target name Target ID Number of qubits Description
Quantum Virtual Machine (QVM) rigetti.sim.qvm - Open-source simulator for Quil, Q#, and Qiskit programs. Free of cost.
Ankaa-9Q-3 rigetti.qpu.ankaa-9q-3 9 qubits

Note

Rigetti simulators and hardware targets do not support Cirq programs.

Rigetti's targets correspond to a QIR Base profile. For more information about this target profile and its limitations, see Understanding target profile types in Azure Quantum.

Quantum computers

All of Rigetti's publicly available QPUs are available through Azure Quantum. This list is subject to change without advance notice.

Ankaa-9Q-3

A 9-qubit quantum processor.

  • Job Type: Quantum Program
  • Data Format: rigetti.quil.v1, rigetti.qir.v1
  • Target ID: rigetti.qpu.ankaa-9q-3
  • Target Execution Profile: QIR Base

Simulators

The Quantum Virtual Machine (QVM) is an open-source simulator for Quil. The rigetti.sim.qvm target accepts a Quil program as text and runs that program on QVM hosted in the cloud, returning simulated results.

  • Job Type: Simulation
  • Data Formats: rigetti.quil.v1, rigetti.qir.v1
  • Target ID: rigetti.sim.qvm
  • Target Execution Profile: QIR Base
  • Pricing: Free ($0)

Pricing

To see Rigetti's billing plan, visit Azure Quantum pricing.

Input format

All Rigetti targets currently accept two formats:

  • rigetti.quil.v1, which is the text of a Quil program.
  • rigetti.qir.v1, which is QIR bitcode.

All targets also take the optional count integer parameter for defining the number of shots to run. If omitted, the program only runs once.

Quil

All Rigetti targets accept the rigetti.quil.v1 input format, which is the text of a Quil program, which stands for Quantum Instruction Language. By default, programs are compiled using quilc before running. However, quilc doesn't support the pulse level control features (Quil-T), so if you want to use those features you must provide a Native Quil program (also containing Quil-T) as input and specify the input parameter skipQuilc: true.

To make constructing a Quil program easier, you can use pyQuil along with the pyquil-for-azure-quantum package. Without this package, pyQuil can be used to construct Quil programs but not to submit them to Azure Quantum.

QIR

All Rigetti hardware supports the execution of Quantum Intermediate Representation (QIR) compliant jobs with the QIR Base Profile, v1 as rigetti.qir.v1. QIR provides a common interface that supports many quantum languages and target platforms for quantum computation and enables communication between high-level languages and machines. For example, you can submit Q#, Quil, or Qiskit jobs to Rigetti hardware, and Azure Quantum automatically handles the input for you. For more information, see Quantum Intermediate Representation.

Selecting the right input format

Should you use Quil or another QIR compliant language? It comes down to your end use case. QIR is more accessible for many users, while Quil is more powerful today.

If you're using Qiskit, Q#, or another toolkit that supports QIR generation, and your application works on Rigetti targets via Azure Quantum, then QIR is right for you! QIR has a rapidly evolving specification, and Rigetti continues to increase support for more advanced QIR programs as time passes - what can't be compiled today may well compile tomorrow.

On the other hand, Quil programs express the full set of functionality available to users of Rigetti systems from any platform including Azure Quantum. If you're looking to tailor the decomposition of your quantum gates or write programs at the pulse level, then you'll want to work in Quil, because those capabilities aren't yet available through QIR.

Examples

The easiest way to submit Quil jobs is using the pyquil-for-azure-quantum package, as it allows you to use the tools and documentation of the pyQuil library.

You can also construct Quil programs manually and submit them using the azure-quantum package directly.

from pyquil.gates import CNOT, MEASURE, H
from pyquil.quil import Program
from pyquil.quilbase import Declare
from pyquil_for_azure_quantum import get_qpu, get_qvm

# Note that some environment variables must be set to authenticate with Azure Quantum
qc = get_qvm()  # For simulation

program = Program(
    Declare("ro", "BIT", 2),
    H(0),
    CNOT(0, 1),
    MEASURE(0, ("ro", 0)),
    MEASURE(1, ("ro", 1)),
).wrap_in_numshots_loop(5)

# Optionally pass to_native_gates=False to .compile() to skip the compilation stage
result = qc.run(qc.compile(program))
data_per_shot = result.readout_data["ro"]
# Here, data_per_shot is a numpy array, so you can use numpy methods
assert data_per_shot.shape == (5, 2)
ro_data_first_shot = data_per_shot[0]
assert ro_data_first_shot[0] == 1 or ro_data_first_shot[0] == 0

# Let's print out all the data
print("Data from 'ro' register:")
for i, shot in enumerate(data_per_shot):
    print(f"Shot {i}: {shot}")