liveBook · Manning

What you will learn in Building Quantum Software with Python

A developer’s guide

by Constantin Gonciulea and Charlee Stefanski
Foreword by Heather Higgins

Chapter by chapter

Chapter 1: Advantages and challenges of programming quantum computers

1.1 Why quantum computing? · 1.2 Becoming quantum ready · 1.3 The superpowers of quantum computing · 1.3.1 The power of quantum parallelism · 1.3.2 The random nature of quantum measurement · 1.4 The anatomy of a quantum computation · 1.4.1 Computing with a single classical bit · 1.4.2 Computing with a single quantum bit · 1.4.3 Computing with multiple quantum bits · 1.4.4 Putting it together · 1.5 Patterns of quantum computations · 1.5.1 Sampling from probability distributions · 1.5.2 Searching for specific outcomes · 1.5.3 Estimating the probability of specific outcomes · 1.6 Summary

What you learn in chapter 1 →

Chapter 2: A first look at quantum computations: The knapsack problem

2.1 A quick overview of optimization problems · 2.1.1 The knapsack problem · 2.1.2 Problem setup · 2.2 The steps of a quantum computation · 2.2.1 Outcomes as binary strings · 2.2.2 Quantum state and probabilities · 2.3 A quantum solution to the knapsack problem · 2.3.1 Encoding the problem · 2.3.2 Knapsack problem solution · 2.4 Tools for programming a quantum solution · 2.5 Summary

What you learn in chapter 2 →

Chapter 3: Single-qubit states and gates

3.1 Single-qubit state: A pair of complex numbers · 3.1.1 Visualizing single-qubit states with tables · 3.1.2 The general form of a single-qubit state · 3.1.3 Programmatically encoding single-qubit states with lists · 3.1.4 Implementing a single-qubit quantum computing simulator in Python · 3.2 Changing amplitudes with single-qubit gates · 3.2.1 Rotation is multiplication · 3.2.2 Basic single-qubit gates · 3.2.3 The general form of a single-qubit gate · 3.2.4 More basic single-qubit gates · 3.2.5 Single-qubit gate inverses · 3.3 Simulating changing amplitudes with gates · 3.3.1 Printing and visualizing the state · 3.3.2 Transforming a single-qubit state · 3.3.3 Single-qubit circuits · 3.4 Simulating measurement of single-qubit states · 3.4.1 Encoding the uniform distribution in a single-qubit quantum state · 3.5 Applications of single-qubit computations · 3.5.1 Encoding a Bernoulli distribution in a single-qubit quantum state · 3.5.2 Encoding a number with a single qubit · 3.6 Summary

What you learn in chapter 3 →

Chapter 4: Quantum state and circuits: Beyond one qubit

4.1 Computing with more than one qubit · 4.1.1 Measurement counts · 4.1.2 Sampling from a probability distribution · 4.1.3 Understanding quantum computations with a simple Python simulator · 4.2 A quantum state is a list of complex numbers · 4.2.1 Two-qubit states · 4.2.2 Multi-qubit states · 4.2.3 Simulating multi-qubit states in Python · 4.3 Changing amplitudes with quantum transformations · 4.3.1 Selecting pairs of amplitudes based on the target qubit · 4.3.2 Pair selection in Python · 4.3.3 Simulating amplitude changes · 4.3.4 Encoding a uniform distribution in a multi-qubit quantum system · 4.4 Controlled quantum transformations · 4.4.1 Simulating controlled gate transformations in Python · 4.4.2 Simulating multicontrol gate transformations in Python · 4.5 Simulating quantum circuits · 4.5.1 Simulating measurement of multi-qubit states · 4.5.2 Quantum registers and circuits in code · 4.5.3 Reimplementing the uniform distribution with registers and circuits · 4.5.4 Encoding the binomial distribution in a multi-qubit state · 4.5.5 Implementing the Bell states · 4.6 Summary

What you learn in chapter 4 →

Chapter 5: Selecting outcomes with quantum oracles

5.1 Describing outcomes with quantum oracles: Intuition and classical implementation · 5.1.1 Phase oracles · 5.1.2 Bit oracles · 5.2 Quantum implementation of oracles · 5.2.1 Creating quantum circuits from building blocks · 5.2.2 Phase oracle · 5.2.3 Bit oracle · 5.3 Converting between phase and bit quantum oracles · 5.3.1 Converting a phase oracle to a bit oracle · 5.3.2 Converting a bit oracle to a phase oracle · 5.4 Fibonacci numbers and the golden ratio with good outcomes · 5.5 Summary

What you learn in chapter 5 →

Chapter 6: Quantum search and probability estimation

6.1 Amplitude amplification: Intuition and classical implementation · 6.1.1 Finding good outcomes with oracles · 6.1.2 Computing similarity with inner products · 6.1.3 The inversion operator · 6.1.4 Putting it together: The Grover iterate · 6.1.5 A classical but quantum-friendly implementation of the inversion operator · 6.2 Magnitude amplification: Quantum circuit implementation · 6.2.1 Quantum oracle · 6.2.2 The inversion operator · 6.2.3 Grover iterate · 6.2.4 Putting it all together: Grover’s algorithm · 6.3 Summary

What you learn in chapter 6 →

Chapter 7: The quantum Fourier transform

7.1 Periodic patterns in sound waves and quantum states · 7.1.1 Periodic patterns in sound waves · 7.1.2 Periodic patterns in quantum states · 7.1.3 Roots of unity and their geometric sequences · 7.2 Converting from phase to magnitude encoding with the Hadamard gate · 7.3 From classical to quantum Fourier transforms · 7.3.1 The classical (discrete) Fourier transform · 7.3.2 Introducing the QFT and IQFT · 7.4 Quantum circuits for the QFT and IQFT · 7.4.1 Understanding the effect of the IQFT on a geometric sequence state · 7.5 Summary

What you learn in chapter 7 →

Chapter 8: Using the quantum Fourier transform

8.1 The single-slit experiment: Wave diffraction · 8.1.1 Introducing the discrete sinc function · 8.2 Encoding a periodic signal using discrete sinc quantum states · 8.2.1 Phase-to-magnitude frequency encoding with the IQFT · 8.2.2 Some useful numerical forms of the frequency encoding pattern · 8.2.3 Reversed qubit implementation of phased discrete sinc quantum states · 8.3 Discrete sinc as a sequence of coin flips · 8.4 Encoding trigonometric distributions in a quantum state · 8.4.1 Raised cosine · 8.4.2 Other trigonometric functions · 8.5 Summary

What you learn in chapter 8 →

Chapter 9: Quantum phase estimation

9.1 Estimating the frequency of a periodic quantum state · 9.1.1 Getting better angle estimates with more qubits · 9.1.2 Reading between the ticks: Getting better estimates with interpolation · 9.2 Quantum circuits as rotations with eigenstates and eigenvalues · 9.3 The quantum phase estimation algorithm · 9.4 Circuit-level implementation of the quantum phase estimation algorithm · 9.5 An alternative implementation of the phase estimation circuit without qubit swaps · 9.6 Amplitude estimation and quantum counting · 9.6.1 Amplitude estimation · 9.6.2 Estimating the number of good outcomes with quantum counting · 9.6.3 Estimating the probability of good outcomes with amplitude estimation · 9.7 Summary

What you learn in chapter 9 →

Chapter 10: Encoding functions in quantum states

10.1 Encoding function inputs and outputs · 10.1.1 Encoding a simple function · 10.1.2 Encoding the knapsack problem · 10.1.3 Encoding polynomials of binary variables · 10.1.4 Complexity of polynomial-encoding circuits · 10.1.5 Representing negative values · 10.2 Searching for function values · 10.3 Finding zeros of polynomial functions · 10.4 Summary

What you learn in chapter 10 →

Chapter 11: Search-based quantum optimization

11.1 Finding desired outcomes with Grover adaptive search · 11.2 Finding optimal outcomes with the Grover optimizer · 11.3 Solving the knapsack problem with a Grover optimizer · 11.3.1 Preparing the state · 11.3.2 Encoding constraints · 11.3.3 Defining the parameters of the Grover optimizer · 11.4 Summary

What you learn in chapter 11 →

Chapter 12: Conclusions and outlook

12.1 Quantum concepts in review · 12.1.1 Quantum readiness · 12.1.2 Quantum advantage and its limitations · 12.2 Building quantum software and running on real quantum computers · 12.2.1 The importance of a fast, flexible quantum simulator · 12.2.2 Source-level compatibility between Hume and Qiskit · 12.2.3 Running on real quantum hardware · 12.2.4 Quantum assistant · 12.3 Revisiting quantum gates and the butterfly pattern · 12.3.1 Another look at single-qubit gates and the butterfly pattern · 12.4 Quantum states as an image · 12.4.1 Visualizing quantum state evolution · 12.5 Combinatorial optimization problems · 12.5.1 Encoding polynomials with noninteger coefficients · 12.5.2 Shor’s factorization algorithm · 12.6 Summary

What you learn in chapter 12 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.