cirq-workflowslisted
Install: claude install-skill rustcircle/c101
# Cirq workflows
Cirq's model is explicit: a Circuit is a list of Moments, each a set of operations on disjoint
qubits, and every compiled, routed or noisy circuit is a transformation of that list. Values marked
*measured* come from Cirq 1.7.0 (cirq-core) with NumPy 2 on Python 3.13.
```bash
python -c "import cirq; print(cirq.__version__)" # cirq-google and qsimcirq are separate packages
```
## 1. Core objects
| Object | Construct | Notes |
|---|---|---|
| LineQubit | `cirq.LineQubit(3)`, `cirq.LineQubit.range(n)` | 1D, ordered by index |
| GridQubit | `cirq.GridQubit(r, c)`, `cirq.GridQubit.rect(rows, cols)` | Google device layouts |
| NamedQubit | `cirq.NamedQubit("anc")` | ordered by name |
| Moment | `cirq.Moment([ops])` | operations on disjoint qubits, one time slice |
| Circuit | `cirq.Circuit(ops_or_moments)`, `.append(ops, strategy=...)` | ordered list of moments |
`cirq.InsertStrategy` members: EARLIEST (default for append), NEW, INLINE, NEW_THEN_INLINE, LATEST
(measured). EARLIEST slides each operation to just after the last moment touching its qubits, so the
order of appends decides the packing: ZZ gates on the 4-cycle edges appended as (0,1), (1,2), (2,3),
(3,0) take 4 moments; as (0,1), (2,3), (1,2), (3,0) they take 2.
Qubit order and endianness: Cirq sorts qubits, and the first qubit is the most significant bit of
state-vector indices and histogram integers (measured: X on q0, then `cirq.measure(q0, q1, key="m")`
gives histogram key 2 = binary 10). Qiski