Wire Ranges

Registers are how you tell Qubi which qubits a gate touches. Most forms accept arithmetic - not just literal integers.

FormMeaningExample
NSingle wire index (integer, variable, or expression)0, num, sqrt(9), visiblemax-1
allEvery allocated wire (0 through max)H all
visibleEvery visible wire (0 through visiblemax)H visible
maxLast allocated wire index12 qubits → max is 11
visiblemaxLast visible wire index3 visible rows → visiblemax is 2
A..BInclusive range; endpoints can be expressions0..3, 1..visiblemax
A..maxRange through last allocated wire0..max
A..visiblemaxRange through last visible wire0..visiblemax
A.S.EStepped list (start.step.end); start, step, and end may be integers, variables, max, visiblemax, or expressions; step may be negative0.2.6; visiblemax.-1.0; 0.coffee.max; max.step.0
A.S.maxStep through last allocated wire0.2.max
A.S.visiblemaxStep through last visible wire0.2.visiblemax
(a,b,c)Explicit parallel list; items can be expressionsH (0, visiblemax, sqrt(4))
[a,b,…]Joint multi-qubit registerCX [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)