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), visiblemax-1 |
all | Every allocated wire (0 through max) | H all |
visible | Every visible wire (0 through visiblemax) | H visible |
max | Last allocated wire index | 12 qubits → max is 11 |
visiblemax | Last visible wire index | 3 visible rows → visiblemax is 2 |
A..B | Inclusive range; endpoints can be expressions | 0..3, 1..visiblemax |
A..max | Range through last allocated wire | 0..max |
A..visiblemax | Range through last visible wire | 0..visiblemax |
A.S.E | Stepped list (start.step.end); start, step, and end may be integers, variables, max, visiblemax, or expressions; step may be negative | 0.2.6; visiblemax.-1.0; 0.coffee.max; max.step.0 |
A.S.max | Step through last allocated wire | 0.2.max |
A.S.visiblemax | Step through last visible wire | 0.2.visiblemax |
(a,b,c) | Explicit parallel list; items can be expressions | H (0, visiblemax, sqrt(4)) |
[a,b,…] | Joint multi-qubit register | CX [0,1], CX ([0,1],[2,3]) |
Parallel lists with math
H (0, 1, visiblemax) RX (0..visiblemax) 0.5 H 0.2.visiblemax // stepped: 0, 2, 4, … up to visiblemax H visiblemax.-1.0 // stepped down from visiblemax to 0 H max.-1.visiblemax // stepped from max down to visiblemax H (max.-2.0) // parenthesized parallel stepped list X (0.coffee.max) // step may be a variable (coffee = 3)
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)