Dual-rail encoding names a qubit by which physical path carries the photon. In this toy ledger, logical zero means one count in the upper rail and none in the lower rail, while logical one reverses those counts. Real optical qubits also require checks for photon loss, path alignment, detector efficiency, dark counts, and finite-count uncertainty.

An optical qubit basis can be taught as a checked upper-versus-lower rail label. Exact arithmetic here means exact results for the stated model inputs; measured inputs still carry uncertainty and significant-figure limits.

highlighted = computed this step

Logical zero occupies the upper rail

The basis binding for logical zero is upper count 1 and lower count 0.

∣0⟩rail:Nupper=1|0\rangle_{\text{rail}}:\quad N_{\text{upper}}=1
Dual rail zeroThe rail bars bind the logical value.1upper0lowerdual rail

Logical one occupies the lower rail

The basis binding for logical one is upper count 0 and lower count 1.

∣1⟩rail:Nlower=1|1\rangle_{\text{rail}}:\quad N_{\text{lower}}=1
Dual rail oneThis is a basis label, not an analyzer claim.0upper1lowerdual rail