liveBook · Manning

Binary string

As explained in Building Quantum Software with Python

A binary string is a finite sequence of symbols drawn from the binary alphabet, typically 0 and 1.

A binary string is a finite sequence of 0s and 1s. In quantum computing, measurement returns one binary string, with one digit for each measured qubit; the string is commonly interpreted as a decimal integer. section 1.3.2 section 2.2.1

Use binary strings to represent quantum computation outcomes:

  • An n-qubit system has n-digit binary-string outcomes and 2^n possible strings. section 2.2.1
  • Each execution produces one outcome sampled according to the measurement probabilities defined by the quantum state. section 1.3.2 section 1.4.3
  • Groups of qubits can encode variables in separate quantum registers, such as item selection, value, and weight. section 2.2.1

Three-qubit outcomes

A three-qubit computation can return 000, 001, 010, 011, 100, 101, 110, or 111. Interpreting the result as an integer maps 100 to 4; repeated runs reveal the distribution of possible outcomes. section 1.4.3 section 1.3.2

Figure 1.9 The steps of a quantum computation using quantum bits (qubits). The example in the diagram uses three qubits, so there are eight possible outcomes, each with a certain measurement probability represented by the filled part of the sectors. When a measurement is performed, we get one result according to the probabilities. The result is interpreted as a binary string.
figure

Visualizes a three-qubit computation as several possible binary-string outcomes, each weighted by its measurement probability, followed by selection of one result. section 1.4.3

How Building Quantum Software with Python covers it

How deep it goes
Defines binary strings, relates length to qubit count and outcome count, and demonstrates decimal interpretation without pursuing hardware implementation.
Examples
Uses one-, two-, and three-qubit outcome tables, the outcome 100 interpreted as 4, and registers encoding a knapsack problem.
What it assumes
Assumes basic binary-to-decimal conversion while introducing binary strings as foundational quantum-computing notation.
What you can do after
Evaluate/understand quantum measurement outcomes as bit sequences, integers, probability samples, or register-encoded values.
How it connects
Connects binary strings to qubits, quantum measurement, quantum states, quantum registers, and binary optimization problems.

Also explained in

Compare how 5 books explain binary string →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Quantum Software with Python. The section links point to the parts of the book it draws on.