Wire Ranges
Registers are how you tell Qubi which qubits a gate touches. Most forms accept arithmetic - not just literal integers.
| Form | Meaning | Example |
|---|---|---|
N | Single wire index (integer, variable, or expression) | 0, num, sqrt(9), max-1 |
all | Every allocated wire (0 through max) | H all |
max | Last allocated wire index | 12 qubits → max is 11 |
A..B | Inclusive range; endpoints can be expressions | 0..3, 1..max |
A..max | Range through last allocated wire | 0..max |
A.S.E | Stepped list (start.step.end); start, step, and end may be integers, floats, variables, max, or expressions; step may be negative or parenthesized like 0.2.(0.1).0.5 | 0.2.6; 0.2.0.1.0.5; max.-1.0; 0.coffee.max; max.step.0 |
A.S.max | Step through last allocated wire | 0.2.max |
(a,b,c) | Explicit parallel list; items can be expressions | H (0, max, sqrt(4)) |
[a,b,…] | Joint multi-qubit register | CX [0,1], CX ([0,1],[2,3]) |
Parallel lists with math
coffee = 3 H (0, 1, max) RX (0..max) 0.5 H 0.2.max // stepped: 0, 2, 4, … up to max H max.-1.0 // stepped down from max to 0 H (max.-2.0) // parenthesized parallel stepped list X (0.coffee.max) // step may be a variable
Parallel controlled gates
Two bracket groups on one line apply the same gate to multiple control/target pairs in parallel:
CX ([0,1],[2,3]) // CNOT on (0→2) and (1→3) in one column (when scheduling allows)