About this textbook#
The Deltakit Textbook is a hands-on introduction to Quantum Error Correction (QEC) concepts.
QEC is a key ingredient to unlock the full potential of quantum computers. To build large-scale error-corrected quantum computers with hundreds to thousands of logical qubits running millions to billions of operations, we will need the participation of experts across various disciplines, and they will all need to upskill in QEC. Today, QEC talent is rare, and awareness about QEC concepts is the most frequently reported challenge as quantum computing teams begin their journeys toward fault tolerance.
This textbook aims to bridge the gap between the understanding of QEC and the practice of QEC. The core principles for the textbook are:
Hands-on: to encourage experimentation with QEC, and enable the learner to reproduce recent research results using state-of-the-art QEC tools,
Detailed: explain every step before using an advanced QEC tool that hides all the details, so that learners understand the nuances of QEC,
Interactive: allowing readers to experiment while reading the textbook,
Open-source: so that QEC experts contribute modern QEC concepts to the textbook, helping modern QEC learners.
Prerequisites#
We assume that a reader is familiar with quantum states, gates, circuits, and measurements. We also assume familiarity with the matrix manipulation associated with quantum circuits, and the matrices for the Pauli gates.
Some examples of concepts that we assume the reader has seen before
If \(\vert\psi\rangle\) is an eigenstate of the operator \(U\), then \(U\vert\psi\rangle = u\vert\psi\rangle\) and the state remains unchanged by the action of \(U\) aside from scaling by the constant \(u\). Specifically, when \(U\) is a unitary operator, the complex magnitude of \(u\) is equal to \(1\), which means it can be written in the form \(e^{i\theta_u}\) for some angle \(\theta_u\).
The Pauli operators \(X\), \(Y\), \(Z\) are Hermitian (eg \(X^\dagger = X\)) and unitary (\(X^\dagger = X^{-1}\)). Together, that means \(U^\dagger U = I\) for all of them as well.
Circuit identities like \(HZH = X\) and \(HXH = Z\) can be understood by writing down the matrices for each of these operations.
We typically measure Hermitian operators, and these have real-numbered eigenvalues. Measuring a Hermitian operator \(O\) on state \(\vert\psi\rangle\) comes down to creating a circuit that can implement \(\langle\psi\vert O \vert\psi\rangle\). Typically, \(O = Z\), and measurements at the ends of quantum circuits implement \(Z\) operator measurements. That means \(Z\)-basis measurements project the outcomes onto the eigenstates of \(Z\) (\(\vert0\rangle\) and \(\vert1\rangle\)). To measure in the \(X\)-basis (where the eigenstates are \(\vert+\rangle\) and \(\vert-\rangle\)) when only \(Z\)-basis measurements are available, note that \(\langle\psi\vert X \vert\psi\rangle = \langle\psi\vert HZH \vert\psi\rangle = \left(\langle\psi\vert H\right)Z \left(H \vert\psi\rangle\right)\). That means measuring \(\vert\psi\rangle\) in the \(X\) basis boils down to applying a Hadamard gate \(H\) to \(\vert\psi\rangle\) before measuring it. Similarly, to measure in the \(Y\) basis, apply \(S^\dagger H\) to \(\vert\psi\rangle\) first.
If these concepts are familiar to you, then you will have minimal challenge reading through the content. If not, it may be helpful to have Mermin’s Quantum Computer Science textbook on the side as you explore quantum error correction. Alternatively, you can also explore these concepts in one of many online tutorials – an example is the first 3 lecture videos of the Qiskit Global Summer School 2020.
The code in the textbook is largely written using Python. To build and run circuits, we use Cirq for the introductory sections and show all details. Familiarity with Cirq will be quite useful, although the code is very readable and can be picked up along the way. Then, we use stim and Deltakit once we progress to more advanced concepts after demonstrating the details earlier in Cirq. We have specifically chosen Cirq due to its compatibility with stim through stimcirq, but learners can easily adapt the examples to other tools such as Qiskit and connect with stim through OpenQASM.
How to best use this textbook for self-learning#
There are several places where you can obtain a deep understanding of QEC concepts. However, fully detailed implementations of quantum circuits in QEC are not widely available. For this reason, this hands-on textbook is best used as a supplement to another textbook that provides grounding in the principles of QEC. Some recommended resources:
Dan Browne’s Lectures on Topological Codes and Quantum Computation
John Preskill’s Ph219 lecture notes (particularly Chapter 7)
Daniel Gottesman’s PhD dissertation on Stabilizer Codes and Quantum Error Correction
How to best use this textbook in a quantum computing course#
The first few weeks of a typical first quantum computing course cover concepts such as qubits and quantum states, gates, measurements, quantum circuits, and circuit identities. Then, the coursework typically branches into various directions – for example, sometimes they enter into extensive discussions of quantum algorithms, or focus on surveying the physics of quantum devices and systems.
The content in this textbook is designed to address the gap between QEC theory and QEC practice. For this reason, it can be used as another branch after the first few weeks of a first quantum computing course, assuming that it is coupled with one of the resources mentioned above.
Contributing to the textbook#
Anyone is welcome to contribute to the textbook! We encourage you to take a look at the list of desired topics in the README on Github. Contributions will be reviewed for clarity and fit – we encourage creating an issue tagged as a contribution to discuss the parameters of the contribution before spending the time creating it. All contributors will be credited in the contributors list of the Deltakit Textbook.
Version History#
v0: Sep 12, 2025, github/@aasfaw