Registry / ai-ml / cirq
library1.6.1pypypiunverified

Cirq is an open-source Python framework developed by Google for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits. It provides tools for designing quantum algorithms and running them on simulators or quantum hardware. Cirq maintains an active release schedule, typically with major updates every 1-2 months, focusing on new features, performance improvements, and compatibility with Google's quantum hardware.

pip install cirq
INSTALL
IMPORT
SIG · CIRQ
C
cirq
ai-mlpythonv1.6.1
Install
28.2s avg
Import
6255ms
Disk
606MB
Pass rate
6/ 10
Env Coverage6 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 31.15s
py 3.11
✕ build_error
✓ 29.65s
py 3.12
✕ build_error
✓ 28.2s
py 3.13
✕ build_error
✓ 28.4s
py 3.9
✓ 0.1s
✓ 51.4s
606MB installed
● package 606MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Circuit
import cirq circuit = cirq.Circuit(...)
Simulator
import cirq simulator = cirq.Simulator()
GridQubit
import cirq q = cirq.GridQubit(0, 0)
H
import cirq circuit = cirq.Circuit(cirq.H(q))
rigetti
pip install cirq-rigetti==1.5.0 import cirq_rigetti
import cirq.rigetti
The `cirq-rigetti` subpackage was removed from the main `cirq` installation in v1.5.0 and fully removed in v1.6.0. It must now be installed separately for legacy access to v1.5.0 functionality, or use newer Rigetti SDKs.
cirq_ft
pip install qualtran import qualtran
import cirq_ft
The `cirq-ft` package was moved from `cirq` to its own repository and is now part of the `qualtran` library. Direct imports from `cirq_ft` will fail in recent Cirq versions.

This quickstart demonstrates how to construct a simple Bell state quantum circuit, print its representation, and then simulate it using Cirq's built-in simulator to obtain measurement results.

import cirq # Define a qubit q0 = cirq.GridQubit(0, 0) # Create a quantum circuit for a Bell state circuit = cirq.Circuit( cirq.H(q0), # Apply Hadamard gate cirq.CNOT(q0, cirq.GridQubit(0, 1)), # Apply CNOT with another qubit cirq.measure(q0, cirq.GridQubit(0, 1), key='result') # Measure both qubits ) print("Circuit:") print(circuit) # Simulate the circuit simulator = cirq.Simulator() result = simulator.run(circuit, repetitions=100) # Run 100 times print("\nResults:") print(result.histogram(key='result')) # Print measurement outcome histogram
cirq --version
Debug
Known issues
breakingThe `cirq-rigetti` subpackage was fully removed from Cirq as of v1.6.0. Attempts to import it from `cirq` will fail.
fix
For legacy code requiring `cirq-rigetti`, explicitly install `cirq-rigetti==1.5.0`. For new development, use Rigetti's current SDK or relevant integration libraries.
affects: >=1.6.0
breakingThe `cirq-ft` package was removed from Cirq as of v1.4.0, having moved to its own repository under the `qualtran` library. Direct imports will fail.
fix
Install `qualtran` (`pip install qualtran`) and import functionality from there. Replace `cirq_ft` imports with `qualtran`.
affects: >=1.4.0
breakingCirq v1.6.0 and later versions require Python 3.11 or higher.
fix
Upgrade your Python environment to version 3.11 or newer. If you must use an older Python version, pin Cirq to `<1.6.0`.
affects: >=1.6.0
gotchaSupport for NumPy 2.x was added in Cirq v1.5.0. Older Cirq versions may have compatibility issues or breakages if used with NumPy 2.x.
fix
Ensure you are using Cirq v1.5.0 or newer when working with NumPy 2.x. If using an older Cirq version, pin NumPy to `<2.0.0`.
affects: <1.5.0
gotchaCirq has undergone significant API stabilization since its v1.0.0 release. Code written for pre-1.0 versions may use deprecated or removed symbols.
fix
Consult the official Cirq migration guides for updates related to major version changes. Update your code to use the modern v1.x API.
affects: <1.0.0
Upgrade
Version history
1.6.1latest on PyPI · released Aug 14, 2025
Audit
Dependencies
pythonrequiredMinimum Python version required for Cirq >= 1.6.0
numpyrequiredCore numerical operations; compatibility with NumPy 2.x added in Cirq 1.5.0
Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
1
Resources