Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
RigettiQCSService
✓ from cirq_rigetti import RigettiQCSService
✗ from cirq.rigetti import RigettiQCSService
cirq-rigetti is a separate package; do not import from cirq.rigetti.
get_rigetti_sample_device
✓ from cirq_rigetti import get_rigetti_sample_device
✗ from cirq import rigetti
Old import path no longer works; use cirq_rigetti directly.
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}')
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'cirq_rigetti'
cirq-rigetti is not installed or is no longer included with cirq since 1.5.0.
fixpip install cirq-rigetti==1.5.0
ImportError: cannot import name 'RigettiQCSService' from 'cirq.rigetti' (unknown location)
Attempting to import from cirq.rigetti instead of cirq_rigetti.
fixUse from cirq_rigetti import RigettiQCSService
AttributeError: module 'cirq_rigetti' has no attribute 'get_rigetti_sample_device'
Outdated version of cirq-rigetti (<1.5.0) may have different API.
fixpip install cirq-rigetti==1.5.0
Upgrade
Version history
1.5.0latest on PyPI · released Apr 10, 2025
Audit
Dependencies
No dependency data recorded yet.