The least significant bit is the lowest-place bit in a binary representation and carries the smallest positional value. In quantum matrix notation, it identifies one position in each binary row and column index. section 3.5.1
Quantum programming libraries assign different positions to this bit. Qiskit uses little-endian notation, placing the least significant bit first or leftmost; Q# uses big-endian notation, placing it last or rightmost. section 3.5.1
The least significant bit determines how controlled operations are interpreted:
- A controlled gate may use the least significant qubit as its control and the other qubit as its target. section 3.5.1
- For an n-qubit controlled operation, the least significant bits can encode the control pattern for index k in little-endian notation. section 3.9.1
- Correctly identifying the bit prevents mismatches between mathematical matrix blocks and library-native gate behavior. section 3.5.1
Two-qubit controlled gate
For a 4 × 4 matrix, write row and column indices as two-bit strings. Choosing the least significant bit as control produces a controlled-gate variant whose matrix acts on the corresponding basis-state blocks. section 3.5.1
Figure 3.4 The row and column indices of \(4 \times 4\) matrices. The indices are written in binary using little-endian notation: the least significant bit is written first. You can see that the top-left and bottom-right blocks group the elements for which the most significant (the last) bit of the row index equals that of the column index: for the matrix \(A\) in the top-left block, the most significant bit is \(0\), and for the matrix \(B\) in the bottom-right block, the most significant bit is \(1\).
Use the matrix-index figure to compare little-endian bit order with the block structure associated with each significant bit. section 3.5.1
