Introducing the open-source Qiskit textbook

Abraham (Abe) Asfaw
Published in
4 min readSep 4, 2019

Hi! My name is Abraham Asfaw. My background is in experimental quantum computation, developing and testing devices to be used in various parts of a quantum computer.

While I was still in graduate school back in 2016, IBM dramatically changed the field by putting a quantum computer on the cloud. As a result, anyone could run quantum algorithms even without badge access to a corporate or academic laboratory. This is still true today — by going to the IBM Quantum Experience, anyone can build and execute quantum circuits graphically using the circuit composer or programmatically using the open-source software Qiskit.

Figure 1: A screenshot of the circuit composer in the IBM Quantum Experience creating a maximally entangled five-qubit quantum state

This unprecedented access has been exciting. Today, developers from various backgrounds are trying their hands at quantum computation, joining a wonderful community of learners and contributors.

In order to support this growth, we have put together an open-source textbook called Learn Quantum Computation using Qiskit. The textbook aims to be a supplement for university courses on quantum computation and algorithms, as well as a self-learner’s reference for programming quantum computers using Qiskit. It will remain continually updated with the latest version of Qiskit.

Structure of the textbook

Figure 2: Supplementing traditional quantum computation courses using the open-source Learn Quantum Computation using Qiskit textbook

The standard textbooks in the field, as well as several courses at the university level, typically begin by building some of the requisite skills in linear algebra and quantum mechanics. Once this is done, students are introduced to quantum algorithms such as Deutsch-Josza, Bernstein-Vazirani, and Simon before being exposed to more advanced ones like Grover and Shor. Some courses also dedicate time to covering the physical implementations of qubits to give students exposure to the architecture in today’s quantum computers.

Our textbook supplements such a course structure by providing a parallel learning path. Chapter 0 gives the necessary prerequisites in Python and Qiskit, and Chapter 1 builds intuition about how quantum states are written in Qiskit. Once students understand how to write down quantum states, Chapter 2 then explains quantum gates, which are the fundamental blocks needed to construct quantum circuits. These three chapters mesh nicely with the early part of a traditional course on quantum algorithms covering the necessary linear algebra and quantum mechanics concepts.

Chapter 3 of the textbook demonstrates how the standard textbook quantum algorithms are implemented in Qiskit, and then executed both on simulators and real quantum hardware. This gives invaluable insight about the effects of quantum noise in today’s devices, and motivates students to think about how we can squeeze the best performance from today’s non-fault-tolerant quantum devices. We have tried to make these sections as self-contained as possible, with detailed derivations and examples. This chapter provides a practical supplement to the traditional coverage of quantum algorithms at a university, where the emphasis is on understanding the mathematics behind each algorithm.

Figure 3: A screenshot from the Quantum Fourier Transform (QFT) section of Chapter 3, showing the expression for the transform as well as the circuit that achieves the transformation

Chapter 4 provides coverage of quantum algorithms that are designed to squeeze the best performance out of today’s noisy quantum devices. In a fast-paced field like quantum computation, this gallery of algorithms grows rapidly, so we have curated a list of algorithms that are useful to build intuition before surveying the field for novel methods. This material is rarely taught in a standard quantum algorithms course, and is typically scattered across several research papers. As such, it can be invaluable to students who intend to join the field.

Figure 4: A screenshot of the Variational Quantum Eigensolver section of Chapter 4, showing the outline and a quick review of the variational method in quantum mechanics

Chapter 5 shows how Qiskit can be used to understand the properties of today’s non-fault-tolerant quantum devices. Typical laboratory measurements like T1 and T2, as well as novel methods like measurement error mitigation are covered.

The textbook is written by experts in the field including several from IBM Research, as well as professors who have used some of the material in prior university courses. We hope that you are able to use it in your coursework as well. Each section has suggested problems, and solutions are provided to professors upon request. To facilitate use of the material in coursework, we are also making the source code available in the IBM Quantum Experience, where students can simply log in and execute the code using Qiskit on the cloud. In the true spirit of open-source, the code for all the chapters is also available on Github, and anyone can contribute sections to the textbook.

Welcoming self-learners

While much of the above has described the textbook as a resource for university courses, it can also be used as a self-learner’s guide into the field of quantum computation. The necessary prerequisites for understanding quantum algorithms, particularly linear algebra, and Python, are covered in the first three chapters. We have tried to make each section as self-contained as possible, and provided interesting problems at the end of each chapter. As a result, motivated self-learners can use the open-source textbook in conjunction with standard textbooks in the field like Nielsen and Chuang (Mike & Ike), Mermin, Yanofsky and Mannucci, and Rieffel and Polak as well as related resources like our Coding with Qiskit YouTube videos.

If you have any questions or suggestions, or would like to use the textbook in your curriculum, please contact me at



Abraham (Abe) Asfaw
Writer for

Global Quantum Education & Open Science Lead at IBM Quantum, PhD candidate at Princeton in experimental quantum computation