cirq-rigetti

raw JSON →
1.5.0 verified Sat May 09 auth: no python deprecated

A Cirq package to simulate and connect to Rigetti quantum computers and Quil QVM. Version 1.5.0 is the final release; the package was deprecated in cirq 1.5.0 and fully removed in cirq 1.6.0. For legacy needs, use version 1.5.0. PyPI releases are driven by Cirq's release cadence.

pip install cirq-rigetti==1.5.0
error ModuleNotFoundError: No module named 'cirq_rigetti'
cause cirq-rigetti is not installed or is no longer included with cirq since 1.5.0.
fix
pip install cirq-rigetti==1.5.0
error ImportError: cannot import name 'RigettiQCSService' from 'cirq.rigetti' (unknown location)
cause Attempting to import from cirq.rigetti instead of cirq_rigetti.
fix
Use from cirq_rigetti import RigettiQCSService
error AttributeError: module 'cirq_rigetti' has no attribute 'get_rigetti_sample_device'
cause Outdated version of cirq-rigetti (<1.5.0) may have different API.
fix
pip install cirq-rigetti==1.5.0
breaking cirq-rigetti has been removed from Cirq 1.6.0+. Install version 1.5.0 explicitly for legacy use.
fix Pin to pip install cirq-rigetti==1.5.0
deprecated cirq-rigetti was deprecated in cirq 1.5.0 and is no longer maintained.
fix Migrate to Rigetti's native Forest SDK or quantum-service package.
gotcha Requires Python >=3.10.0 as of cirq-rigetti 1.5.0.
fix Use Python 3.10 or later.

Minimal example to initialize Rigetti service and get a sample device.

import os
from cirq_rigetti import get_rigetti_sample_device, RigettiQCSService

# Obtain API key from environment
api_key = os.environ.get('RIGETTI_API_KEY', '')
if not api_key:
    print('Set RIGETTI_API_KEY environment variable to run against real QPUs')
else:
    service = RigettiQCSService(api_key=api_key)
    device = get_rigetti_sample_device()
    print(f'Device: {device}')