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 |
|---|---|---|
|
|
laser pulses inside PennyLane circuits: the devices |
|
|
Qiskit circuits on a cosmiq device: |
|
|
error correction that uses atom loss when decoding. See QEC |
|
|
|
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