Installation#

pip install cosmiq   # cosmiq, with a q

cosmiq needs Python 3.11, 3.12 or 3.13, and brings PyTorch, NumPy and pydantic with it. cosmic, with a c, is a different, unrelated package.

Status: alpha (v0.1). The API may still change between minor releases, always with a deprecation first (Deprecations).

The extras#

Each extra adds one optional part:

Extra

Install

Adds

pennylane

pip install "cosmiq[pennylane]"

laser pulses inside PennyLane circuits: the devices cosmiq.emulator and cosmiq.remote, and RydbergEvolution. See PennyLane

qiskit

pip install "cosmiq[qiskit]"

Qiskit circuits on a cosmiq device: SamplerV2, EstimatorV2 and target, and cosmiq.library.iqp. See Qiskit on cosmiq

qec

pip install "cosmiq[qec]"

error correction that uses atom loss when decoding. See QEC

verify

pip install "cosmiq[verify]"

cq.remote.verify, which checks the signed receipts of remote jobs. See Remote jobs

Several at once: pip install "cosmiq[pennylane,qiskit]".

Supported versions: Python 3.11–3.13, PyTorch 2.5 or later (2.2 on Intel Macs), PennyLane 0.45 or 0.46, Qiskit 2.6, and Stim 1.12 or later.

By operating system#

Linux (x86-64). Everything works. PyTorch from PyPI includes CUDA, so cq.Emulator(device="cuda") runs on an NVIDIA GPU. On a machine without a GPU, PyTorch’s CPU build is smaller:

pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install cosmiq

macOS on Apple silicon. Everything works. The emulator runs on the CPU; Apple’s GPU ("mps") isn’t supported.

macOS on Intel. Use Python 3.11 or 3.12. The core works; the pennylane, qiskit and qec extras aren’t available there.

Windows. Windows isn’t supported yet.

Code Studio. The tutorials’ Open in Code Studio buttons open them with cosmiq installed.

With uv#

uv add cosmiq
uv add "cosmiq[pennylane]"   # with an extra

Next#

Check your install, then your first program.