My approach is described in the Preface:
How do you learn to code in this new world that involves both classical and quantum hardware?
One way to do it is to learn classical computing by itself. This is the traditional way of doing it, using a language such as C, C++, JavaScript, Java, Go, or Python. Along the way, you would learn how to use extra functionality in libraries of code along with the programming tools or from a third-party provider. Examples of these are the C++ Standard Library; the Java Platform, Enterprise Edition; the Python Standard Library; or the thousands of Python packages listed in the Python Package Index.
Once you have the philosophy, syntax, structure, and idioms of the classical programming language understood, you then learn quantum computing on top of that. For example, you could use the Qiskit open source quantum computing software development kit (SDK) along with Python. These mesh together and operate exceptionally well. Thousands of people are already Qiskit coders. If you know Python, this is a great approach.
But what if you are learning to code or have only a small amount of experience? What if I could offer you the chance to learn classical and quantum computing in a unified manner? Would it be useful if I could help you understand the concepts of both so that you don’t see them as different disciplines? That’s what I do in this book.
I talk about aspects of quantum computing throughout the book and in many places I provide pointers to sections in my quantum computing book Dancing with Qubits. That book is not a prerequisite for Dancing with Python, but the referenced sections will help you learn more about the topics if you wish to go deeper.
I first talk about qubits, “quantum bits”, in section 1.11. The main chapters that discuss quantum computing are 9 and 11:
9 Understanding Gates and Circuits
Classical computers use logical gates to manipulate bits. Using them, we assemble circuits to implement more complicated processes like addition and multiplication. Eventually, we get all the software that runs on computers everywhere.
Quantum computers use qubits to significantly extend the power of bits, as we saw in section 1.11. We assemble these into quantum circuits to implement algorithms.
There is a strong connection between classical and quantum computing, and a quantum computing system is a classical computing system extended with one or more quantum devices. These devices are the physical implementations of qubits and the software and hardware that control them.
This chapter examines bits and qubits, gates that operate upon them, and how we assemble them into circuits.
9.1 The software stack
9.2 Boolean operations and bit logic gates
9.3 Logic circuits
9.4 Simplifying bit expressions
9.5 Universality for bit gates
9.6 Quantum gates and operations
9.7 Quantum circuits
9.8 Universality for quantum gates
9.9 Summary
11 Searching for the Quantum Improvement
By considering new approaches and getting clever, we can develop classical algorithms that are faster than you might have expected. Using quantum techniques, we can go a step further: perform some operations faster than seems possible.
This chapter compares classical and quantum search techniques to see how extending our basic information unit from the bit to the qubit can show remarkable improvements. Note that I only discuss mainstream “universal” quantum computing and not limited-purpose systems that perform operations like simulated annealing.
11.1 Classical searching
11.2 Quantum searching via Grover
11.3 Oracles
11.4 Inversion about the mean
11.5 Amplitude amplification
11.6 Searching over two qubits
11.7 Summary
If you wish to learn more about quantum computing after reading this book, I suggest you look at