Back to News
quantum-computing

The Steane Code Explained

Futurist
Loading...
23 min read
0 likes
⚡ Quantum Brief
The Steane code is the seven-qubit error-correcting code that shows how classical coding theory becomes quantum, with seven physical qubits standing guard over one logical qubit. It corrects any single error on any one of them. The trick is to take a classical code from 1950 and use it twice over, once for each of the two ways a qubit can fail. That double use makes it the smallest clean example of the CSS construction, the recipe that turns classical codes into quantum ones. Two ideas central to fault tolerance start here.
AI Audio Summary
0:00 / 0:00
Click to play
page-006-object-017.webp
Quantum News · Media Library

The Steane code is the seven-qubit error-correcting code that shows how classical coding theory becomes quantum, with seven physical qubits standing guard over one logical qubit. It corrects any single error on any one of them. The trick is to take a classical code from 1950 and use it twice over, once for each of the two ways a qubit can fail. That double use makes it the smallest clean example of the CSS construction, the recipe that turns classical codes into quantum ones. Two ideas central to fault tolerance start here. One is the transversal gate, which applies a single operation to each qubit separately so that a faulty component leaves one error rather than several. The other is the T gate, whose cost is the largest item in most published resource estimates. Introduced by Andrew Steane, 1996 Parameters [[7,1,3]], seven physical qubits, one logical qubit, distance three Corrects Any single-qubit error, whether a bit flip, a phase flip, or both Type A CSS code that contains its own dual, built from the classical [7,4,3] Hamming code Also known as The distance-three colour code, its geometric equivalent Transversal gates The full Clifford group, Hadamard and phase within a block, CNOT between blocks Key takeaways Seven qubits protect one, with distance three. That is written [[7,1,3]], and distance three means any single error is detected and corrected. It is one classical Hamming code doing two jobs. The [7,4,3] Hamming code catches bit flips in one basis and phase flips in the other, and it contains its own dual, which is what lets the two sets of checks run without interfering. It is the smallest clean CSS code. The Calderbank-Shor-Steane recipe builds quantum codes from classical ones, and the Steane code is its most-taught example. Its Clifford gates are transversal. Hadamard and phase are applied qubit by qubit with no interaction, so a single fault stays a single error, which is what makes the code fault tolerant. The T gate is the catch. Clifford gates alone cannot express every quantum algorithm, and an ordinary computer can simulate them, so the missing T gate has to come from elsewhere. It usually comes from magic states, extra qubits prepared at high quality and spent one per gate. It is the same object as the distance-three colour code. That geometric view connects it to the colour codes now being run on real hardware. On this page Seven physical qubits protecting one logical qubit A qubit fails in two ways, not one Steane’s code needs seven qubits where Shor’s needed nine Two classical codes doing one quantum job One Hamming code doing both jobs Why dual-containment is the hinge Six operators are the whole definition Reading the error without reading the qubit The lightest escaping operator weighs three A transversal gate keeps one fault as one error The gate the code cannot do is the one that matters It is also the smallest colour code Easier to compute with, harder to build than the surface code Concatenation squares the reliability at every level Innsbruck, Harvard, Quantinuum and Google have run it It corrects one error, not any error Thirty years on, still the standard teaching example Frequently asked questions Seven physical qubits protecting one logical qubit Andrew Steane introduced the Steane code in 1996, in a short paper in Physical Review Letters and a longer companion in the Proceedings of the Royal Society. A year earlier Peter Shor had shown, with a nine-qubit code, that quantum error correction was possible at all. Steane’s version is more economical. It uses seven physical qubits to protect one logical qubit at a distance of three, and it carries far more structure to work with. The notation [[7,1,3]] carries all three facts. Seven physical qubits, one logical qubit encoded in them, and a code distance of three, which as in the classical case means the code can correct any single error. The double brackets, rather than the single brackets of a classical code, signal that this is a quantum code. Its value is not its size but its transparency, and almost everything important about fault-tolerant quantum computing appears in it in the simplest form. That is why it turns up so often as a first example. A qubit fails in two ways, not one A classical bit fails in one way. It flips, from zero to one or back, and a code only has to worry about that single kind of error. A qubit is richer and can fail in two independent ways, which is the fact the whole construction is organised around. The first is a bit flip, the quantum version of the classical error, swapping the roles of the two basis states. The second has no classical counterpart at all. It is a phase flip, which leaves the basis states alone but flips the sign of the relationship between them, and it corrupts the superposition that makes a qubit more than a bit. A general error is some mixture of the two. Correcting both types independently turns out to be enough to correct any single-qubit error whatsoever, and that takes a continuous range of possible errors down to two discrete ones. A finite code is then enough, and classical coding ideas apply. Steane’s code needs seven qubits where Shor’s needed nine It did not arrive in isolation. In 1995 Peter Shor published the first quantum error-correcting code, using nine physical qubits to protect one, by concatenating a bit-flip code with a phase-flip code in a fairly direct way. It proved the thing was possible and was not especially efficient. Andrew Steane, working at Oxford, set the problem in the language of classical coding theory, and his 1996 papers build the code from a classical Hamming code rather than from scratch. A good classical code could be repurposed for the quantum setting, and a code built that way needs seven qubits where Shor’s construction needed nine. It also produced a code with far more structure to exploit. The same year, Robert Calderbank and Peter Shor published the general framework that made this systematic, and the combined result is the CSS construction that carries all three names. The Steane code is both a specific code and an early demonstration of a general method. Two classical codes doing one quantum job A qubit fails in two ways, and each way resembles a classical bit flip in its own basis, so perhaps two classical codes could handle a quantum error between them. That is the insight behind the CSS construction, named for Robert Calderbank, Peter Shor and Andrew Steane, who developed it in 1996. The recipe has three steps. Take a classical code to protect against bit flips, take another to protect against phase flips, and combine them so the two corrections do not interfere. The result is a quantum code assembled entirely from classical parts. Not every pair of classical codes can be combined this way. There is a compatibility condition to meet, and the Steane code is what you get by meeting it in the simplest way, using one well-behaved classical code for both jobs. One Hamming code doing both jobs The classical code the Steane code uses is the [7,4,3] Hamming code, the error-correcting code Richard Hamming published in 1950. It takes four data bits and adds three parity bits. When some of those parity checks fail, the pattern of failures reads as a binary address that points straight at the position of the error. The Steane code uses that Hamming code twice over. Its parity checks catch bit flips in the computational basis, and the very same checks catch phase flips in the conjugate basis, the description that asks about phases rather than values. That is legal because the Hamming code contains its own dual, the [7,3,4] simplex code. Hamming’s construction is not an analogy here. It is a literal component, doing the job it was designed for, inside a quantum code invented forty-six years later. This is one of the more satisfying continuities in the subject. Thomas Thompson’s 1983 history, From Error-Correcting Codes through Sphere Packings to Simple Groups, records why Hamming wanted one. The reason was mundane. On weekdays the Bell relay computer stopped at an error and flashed its lights, and an operator restarted the job by hand. Unattended at weekends it skipped the failed job outright and moved on, so the weekend’s work was gone by Monday. A piece of 1950 telephone engineering turned out to be exactly the ingredient quantum error correction needed. Why dual-containment is the hinge CSS codes need their two classical codes to fit together in a specific algebraic sense, and the Hamming code satisfies that in the easiest way available, by containing its own dual. That dual is the code built from Hamming’s own parity checks. A code with that property is called dual-containing, and it is why one classical code can do both jobs. Containment is the point, not equality, because a genuinely self-dual code would need exactly half of its bits as data and seven bits cannot be halved. The consequence is physical rather than abstract. The checks that detect bit flips and the checks that detect phase flips must be measurable at the same time without disturbing one another, which in quantum terms means they must commute. Dual-containment is precisely what guarantees they do. Without that property, measuring the X checks would scramble the phase information, and the other set of checks would return nonsense. The whole construction rests on one algebraic fact that Hamming had no reason to care about in 1950, and it turned out to be load-bearing. Six operators are the whole definition The checks can be written down explicitly. Number the qubits one to seven and take the three groups from the classical Hamming matrix. Those groups are qubits four, five, six and seven, then two, three, six and seven, then one, three, five and seven. Applying Z to every qubit in one of those groups gives a check that catches bit flips, and applying X to the same group gives one that catches phase flips. Those six operators are the whole definition of the code, and the literature calls them stabilisers, the checks an encoded state must always pass. Written out this way, the compatibility requirement becomes arithmetic. The check on qubits two, three, six and seven shares qubits six and seven with the check on four, five, six and seven. That is two places, which is an even number, so the two commute, and every pair of these groups meets in an even number of places. Dual-containment is that same fact stated about operators rather than about codewords. Reading the error without reading the qubit The central trick of all quantum error correction is to extract information about the error without extracting information about the encoded state. Measure a qubit directly and you destroy the superposition you are trying to protect. The Steane code shows it plainly. The way around this is to measure only the parity checks, never the data. Each check asks the same narrow question, which is whether a particular group of qubits still agrees with itself, and it gets an answer without disturbing anything else. That answer says whether an error happened, and where. It says nothing about which logical state is stored, and that silence is the whole reason the trick works at all. The collection of check results is called the syndrome, exactly as in classical coding. For the Steane code the syndrome is read by six checks, three for bit flips and three for phase flips. Each triple works just like Hamming’s. The pattern of results gives the binary position of the error, and the logical qubit passes through untouched, which is what makes the whole thing possible. The address works exactly as it does classically. Suppose a bit flip lands on qubit six. Of the three Z checks, the one on qubits four, five, six and seven contains it, and so does the one on two, three, six and seven. The one on one, three, five and seven does not, so the three answers read one, one, zero, which is six in binary. A phase flip is caught by the other set and behaves the same way. A Z error on qubit three misses the check on four, five, six and seven and hits the other two. That gives zero, one, one, which is three. Neither measurement touches the encoded state, because each check asks about the joint parity of four qubits rather than about any single qubit on its own. Each error is tested against the three checks of the opposite kind. The pattern of hits is the binary position of the qubit that went wrong, which is Hamming’s trick carried over intact. Diagram by Quantum Zeitgeist. The lightest escaping operator weighs three Distance is defined the same way as in the classical case, but the objects being weighed are operators rather than words. The weight of an operator is the number of qubits it actually touches, and the distance is the weight of the lightest operator that changes the encoded qubit while escaping every check. For the Steane code that number is three. The demonstration is short. Applying X to all seven qubits performs a logical flip and commutes with all six checks, so it is a logical operator of weight seven. Multiply it by the X check on qubits one, three, five and seven and you are left with X on qubits two, four and six. A check acts as the identity on encoded states, so the result performs the same logical flip at weight three. Nothing lighter can do the job. Every check touches four qubits, and so does every product of checks, so a weight-three operator that commutes with all of them cannot itself be a check. Any operator on one or two qubits crosses some check an odd number of times, which is exactly what the syndrome reports. Three simultaneous errors in the right places therefore change the encoded qubit in silence, while one error is corrected and two are detected, and that is what the third number in [[7,1,3]] records. The lightest logical operator weighs three, not seven. X on qubits two, four and six flips the encoded qubit, raises no syndrome, and is not itself a check. Diagram by Quantum Zeitgeist. A transversal gate keeps one fault as one error Correcting errors is only half the requirement, since you also have to compute on the encoded data. You have to do it without letting one faulty component spread its error across the whole block, because a distance-three code cannot repair two errors at once. A transversal gate applies the same operation to each qubit independently, so a single fault stays a single error. The Steane code has transversal Clifford gates, but not a transversal T gate. Diagram by Quantum Zeitgeist. The safest way to compute on encoded qubits is a transversal gate. It applies the same physical operation to each qubit in the block separately, so that no qubit ever interacts with another in the same block and the qubits stay independent throughout. A fault in one of them produces exactly one error, which the code can still fix. Fault tolerance then follows from the structure rather than from extra machinery. The Steane code is unusually generous here. Its Hadamard gate and its phase gate are both transversal, which means every single-qubit Clifford gate can be run this way, one qubit at a time, with no interaction inside the block. The controlled-NOT between two blocks is transversal too, as it is for every CSS code, so a logical CNOT costs nothing extra. That is much of why the code is so heavily studied. The gate the code cannot do is the one that matters There is a catch. It is not specific to the Steane code, but it shows up here with very little around it. The Clifford gates the code performs so easily are not enough to compute with on their own. An ordinary classical computer can simulate them efficiently, a result known as the Gottesman-Knill theorem, so a machine limited to them offers no quantum advantage. To reach the full power of quantum algorithms you need at least one gate from outside the Clifford set, and the usual choice is the T gate. The T gate is exactly the operation the Steane code cannot perform transversally. That is not an accident of this particular code, because a theorem by Eastin and Knill forbids any code from having a gate set that is both transversal and universal. So the easy gates are the ones that do not pay, and the gate that pays is the hard one. The standard workaround is magic state distillation, which builds a few high-quality states out of many noisy ones and then spends one of them on each T gate. Those distillation factories dominate the footprint of a fault-tolerant machine. The T gates are the largest expense in most published resource estimates. It is also the smallest colour code The code has a second identity. It is the smallest instance of the colour code, a family of codes laid out on a lattice of coloured tiles, and that view is what connects it to hardware being built now. Those are topological codes, which hold the logical qubit in the shape of the lattice rather than in any single qubit. At the smallest size the distance-three colour code and the Steane code are the same object. Colour codes are being built and tested on real hardware now, and the transversal gates the Steane code displays are a large part of the reason. Seeing it as a colour code links its algebra to a geometric picture that scales up to larger, more protective codes on bigger lattices. It also sits in the wider family of topological codes, the best known of which is the surface code, itself one of several emerging codes under active study. The two make different trade-offs. Within the same broad approach they pull in different directions, and the small Steane code is the standard way in to the larger ones. Easier to compute with, harder to build than the surface code The natural comparison is with the surface code, which most large-scale hardware efforts have chosen. Neither wins outright. It is a genuine trade-off, and each of the two codes is better at something the other one handles badly. Steane code Surface code Smallest distance-three block, counted as data qubits 7 data qubits, plus ancillas for syndrome extraction 9 data qubits in the rotated layout, or 13 unrotated, plus ancillas Transversal gates The full Clifford group, including CNOT between blocks Fewer, more operations need other methods Parity checks Six checks, each of weight four, with an X and a Z check on the same four qubits Also weight four, but only ever between nearest neighbours on a square grid Error threshold, as a code family Lower, less noise-tolerant Higher, around 1 per cent Main appeal Clean gates, small size, teaching clarity Practical for large planar chips The Steane code is easier to compute with and harder to build, while the surface code is easier to build and harder to compute with. The difficulty is layout rather than check weight. The surface code repeats one nearest-neighbour pattern across a flat chip, while the larger colour codes need a more demanding wiring plan and checks on six qubits in the bulk. Much current research is about getting the best of both, including schemes that convert between codes to borrow each one’s strengths. Concatenation squares the reliability at every level A distance-three code corrects one error. That is not enough for a long computation, where the errors pile up faster than a single round of repair can clear them. One historically important way to do better is concatenation. That means encoding each physical qubit of a Steane code inside another Steane code, and then repeating the trick. Each level of concatenation squares the effective reliability, so a small physical error rate becomes a very small logical one after a few levels. The price is a rapidly growing number of physical qubits. Seven becomes forty-nine, then three hundred and forty-three, and so on. This is the construction behind the original threshold theorem, which proved that arbitrarily reliable quantum computation is possible provided the physical error rate stays below some fixed value. Concatenation has largely given way to the surface code for large-scale proposals, because the extra qubits pile up less steeply there. It remains the clearest way to see why a threshold exists at all, and it was the vehicle for the threshold theorem rather than an illustration of it. Innsbruck, Harvard, Quantinuum and Google have run it It has moved off the page. Small Steane-code and colour-code experiments have run on trapped ions in Innsbruck and at Honeywell Quantum Solutions, now Quantinuum. They have also run on neutral atoms at Harvard and, most recently, on Google’s superconducting hardware. Between them they have demonstrated syndrome extraction, transversal gates and, in the better recent results, error rates on the logical qubit lower than on the physical qubits it is built from. The Innsbruck group went furthest on gates, running a fault-tolerant universal set across two seven-qubit blocks. The strongest error-rate figures for the code itself, between 9.8 and 500 times below the physical level, come from a joint Quantinuum and Microsoft paper. Its authors add a caveat of their own. Paetznick and colleagues note that the figures depend on “the judicious use of post-selection”, meaning that runs failing a check are discarded rather than counted. That last milestone, the logical qubit outliving its components, is what the whole field is aiming at, and reaching it even for a distance-three code is a genuine result. Keep the size of it in proportion. A distance-three code corrects one error, and a useful computation needs codes correcting far more, which means far larger blocks and many more physical qubits. The code is best understood as a proving ground. It is where the ideas get demonstrated cleanly before anyone tries to scale them, and it is probably not the code a fault-tolerant machine will end up running. It corrects one error, not any error A few things about the Steane code are routinely stated slightly wrong. It is often said to correct any error, without qualification. What it corrects is any single-qubit error, and two errors in the same block defeat it, which is exactly what distance three means. Pretending otherwise obscures why larger distances are needed. It is also described as making a qubit reliable, which overstates the case. The code makes a logical qubit more reliable than its physical parts only when those parts are already good enough, below the code’s break-even point. Above that error rate the encoding makes things worse, because seven mediocre qubits fail more often than one. That crossover is the whole game in current experiments. The transversal gates are sometimes presented as making the code fully fault tolerant on their own. They do not. The T gate is missing, and a machine that cannot perform a T gate cannot run the algorithms that motivate building it. The code is a fault-tolerant memory and a fault-tolerant Clifford processor, which is a precise and limited claim. Thirty years on, still the standard teaching example Thirty years after Steane wrote it down, the code remains central for reasons that have little to do with whether it ends up in a data centre. It is a compact worked example of every important idea in fault-tolerant computing, small enough to hold in your head and rich enough to contain the real difficulties. It shows how classical codes become quantum, and why dual-containment is the hinge. It shows how syndromes reveal errors without revealing states, why transversal gates give fault tolerance, and why the T gate is the expensive exception that no code escapes. Follow all that and you have the shape of quantum error correction as a whole, which is why the code is usually taught first. Its final lesson is one of continuity. A quantum code at the frontier of a twenty-first-century technology has a 1950 telephone-engineering code sitting at its heart, unchanged, doing exactly the job it was built for. Frequently asked questions What is the Steane code? The Steane code is a quantum error-correcting code that protects one logical qubit using seven physical qubits, correcting any single-qubit error. Written [[7,1,3]], it was introduced by Andrew Steane in 1996 and is built from the classical Hamming code. Why does the Steane code use seven qubits? Seven is the size of the classical Hamming code it is built from, the [7,4,3] code. That code corrects a single bit error in seven bits, and the Steane construction uses it once for bit-flip errors and once, in the conjugate basis, for phase-flip errors, giving a seven-qubit quantum code. What is a CSS code? A CSS code, named for Calderbank, Shor and Steane, is a quantum error-correcting code built from two classical codes, one protecting against bit-flip errors and one against phase-flip errors. The Steane code is the best-known example, using the Hamming code and its dual. What are transversal gates? A transversal gate applies the same physical operation to each qubit in a code block independently, with no interaction between them. Because a single fault then affects only one qubit, transversal gates are automatically fault tolerant. The Steane code can perform all single-qubit Clifford gates transversally. Why can’t the Steane code do a T gate transversally? No quantum code can have a transversal set of gates that is also universal, a result known as the Eastin-Knill theorem. The Steane code’s transversal gates are the Clifford gates, which are not universal on their own, so the non-Clifford T gate must be supplied another way, usually through magic state distillation. Is the Steane code the same as the colour code? The distance-three colour code is exactly the Steane code. The colour code is a family of topological codes on a lattice, and its smallest member is the seven-qubit code, which is why the two names refer to the same object at that size. How does the Steane code compare to the surface code? The Steane code has more transversal gates and uses fewer qubits, making it cleaner to compute with, but its checks are harder to lay out on a chip and it tolerates less noise. The surface code needs only nearest-neighbour connections on a grid and has a higher error threshold, which is why large hardware efforts favour it despite its more awkward gates. Has the Steane code been built? Yes, in small experiments. Trapped-ion, neutral-atom and superconducting systems have all demonstrated the Steane code or closely related colour codes. That includes cases where the encoded logical qubit has a lower error rate than the physical qubits composing it. The strongest of those figures still depend on discarding some runs through post-selection. Read next Quantum error correction The surface code Richard Hamming Claude Shannon Quantum algorithms More like thisQuantum ComputingMegaquop, What a Million Reliable Quantum Operations Would BuyQuantum PeopleChad Rigetti, The Mind Behind One Of The Early Quantum InnovationsQuantum FeaturesHow To Build A Quantum Computer: The Beginner’s Guide and Minimum RequirementsQuantum FeaturesSEALSQ Corp (LAES): A Complete Commercial HistoryStay currentSee today’s quantum computing news on Quantum Zeitgeist for the latest breakthroughs in qubits, hardware, algorithms, and industry deals. Tags:

Read Original

Tags

quantum-algorithms
quantum-hardware

Source Information

Source: Quantum Zeitgeist

Discussion

0 professional contributions

Sign in to join this professional discussion.

Be the first to add a constructive contribution.