liveBook · Manning

Binary representation

As explained in Quantum Programming in Depth

Binary notation represents an integer or index as an ordered sequence of bits.

Binary representation writes an integer or matrix index as an ordered string of bits. For an n-qubit system, indices range from 0 through 2^n − 1 and correspond to n-bit basis-state labels. section 3.9.1 section 4.1.1

Use the representation to connect integer indices with quantum-register structure:

  • For k < 2^(n−1), k has an n-bit representation whose most significant bit is 0; 2^(n−1) + k has the same remaining bits with leading bit 1. section 3.9.1
  • In little-endian notation, the n−1-bit representation of k specifies the control pattern for a controlled single-qubit gate. section 3.9.1
  • For a measured n-qubit superposition, the binary notation of index k is returned with probability equal to the square of its amplitude. section 4.1.1

Three-qubit index pairing

With n = 3 and k = 2, the indices k and 2^(n−1) + k are 2 and 6. Their three-bit representations differ only in the most significant bit, pairing the matrix rows and columns affected by the controlled operation. section 3.9.1

Figure 4.2 Measuring two qubits in a superposition of all basis states can give any of the results 00, 01, 10, and 11, with probabilities equal to squares of the amplitudes of the corresponding basis states in the superposition state. When we measure a system that is in a specific basis state, we can only get the result that corresponds to that state, with 100% probability.
figure

Relate binary basis-state labels to measurement outcomes: a superposition can produce 00, 01, 10, or 11, while a definite basis state produces its corresponding bit string with certainty. section 4.1.1

How Quantum Programming in Depth covers it

How deep it goes
Derives bit patterns for paired indices and controlled gates, then applies them to probabilistic measurement outcomes.
Examples
Uses the n = 3, k = 2 index pair and two-qubit outcomes 00, 01, 10, and 11.
What it assumes
Assumes familiarity with qubits, matrices, amplitudes, basis states, and controlled gates.
What you can do after
Evaluate quantum indices as bit strings and interpret their roles in controlled operations and measurement results.
How it connects
Links binary representation to matrix indices, controlled gates, little-endian notation, basis states, superposition, and quantum measurement.

Also explained in

Compare how 6 books explain binary representation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quantum Programming in Depth. The section links point to the parts of the book it draws on.