Tutorials#

Each tutorial is a Python script you can run, open in Code Studio, or open in Colab. The site runs every one each time it’s built, so the outputs on each page are the code’s own. On each page, Open in Code Studio opens the script in Identity Quantum Computing’s IDE, and Open in Colab opens a notebook made from the same script. You can also download the script and run it where you installed cosmiq:

python 01_detuning_sweep.py
COSMIQ_TUTORIAL_QUICK=1 python 01_detuning_sweep.py   # a quick version, in a few seconds

Tutorial

What it does

Needs

1. A detuning sweep, trained

prepares an ordered state, trains the sweep with exact gradients, estimates the same gradient from shots, and samples the result

cosmiq

2. A variational circuit in PennyLane

single-qubit gates around an analog block, trained with torch; the gradient from shots by SPSA

the pennylane extra

3. Maximum independent set in PennyLane

an MIS cost from PennyLane observables, an adiabatic sweep trained to minimise it, read with shots

the pennylane extra

4. Remote jobs, offline

cq.remote.local(): training through remote results, SPSA in one job, submit and collect, all on your machine

cosmiq

5. A digital circuit through Qiskit

a GHZ circuit transpiled to cosmiq-ref-1’s digital profile, checked against Qiskit’s own simulator, run with the profile’s noise; a CZ out of range refused

the qiskit extra

6. Error correction with atom loss

a repetition-code memory experiment with atom loss as heralded erasures, decoded loss-blind and loss-aware on the same shots, and compared

the qec extra

7. A practice run before the virtual QPU

a training loop as a runtime: checkpoints, a stop and a resume that ends where an uninterrupted run does, then a rehearsal of its virtual QPU jobs on this machine

cosmiq