Feature highlights: how Orqid enables deep understanding of your EFTQC algorithm
A fault-tolerant quantum algorithm with error correction is not the same algorithm with fewer errors. Between your circuit and the hardware sits a new layer of decisions: how each operation is built, where the noise enters, and how the errors are decoded. Orqid, Haiqu's EFTQC toolkit, puts each of these decisions in your hands and takes care of the scaffolding around them.
Quantum error correction is no longer a moonshot for the distant future. It is increasingly becoming a practical reality. Recent demonstrations of exponential error suppression heralded the beginning of the early fault-tolerant era in quantum computing (EFTQC). In this new regime, a quantum algorithm practitioner is met with significantly reduced, yet still considerable error rates and much more complex implementations of logical quantum circuits. The pursuit of the most performant version of the algorithm, well known from the noisy intermediate-scale quantum (NISQ) setting, continues with added complexity: there are now multiple ways of implementing a logical operation, the measurements of additional qubits required for error correction introduce noise of their own, and the capabilities of the error decoding algorithm are often limited by the type of errors happening in the experiments. In this blog, we will show how Orqid allows you to solve all of these problems more easily than ever before.
The main difference between the familiar NISQ circuits and the error corrected ones is, unsurprisingly, in the error correction subroutines. The figure above showcases this added complexity as the logical circuit gets lowered to its physical representation . In logical circuits, quantum states are encoded in a much larger space made up of many physical qubits, allowing to measure the syndromes signalling an error without destroying the logical information. Such measurement requires a set of additional ancilla qubits, and entangling gates between them and the data qubits. Once the ancilla qubits are measured, a change in the outcome can signal that an error has occurred. Usually, such measurements are repeated several times, forming an error correction cycle, as shown in yellow in the graphic. Once the measurement outcomes, also called syndromes, signalling an error event, are collected a classical algorithm, a decoder, is used to infer, which exact error is the most likely to have caused such an outcome. An identified error can be corrected.
Using many physical qubits to encode information means large logical operations, with many more physical gates. Each of those gates is still subject to hardware noise, and so are the ones used in the error correction cycles. By encoding our algorithm in a logical circuit, we thus make it considerably noisier before we can even begin to correct the errors.
Fault-tolerance turns into a race against the noise: can my logical circuit correct more errors than its complex components produce?
For an algorithm developer this raises three practical questions:
Answering any of these usually means writing custom code for each experiment, and rewriting it whenever a single piece changes. With Orqid, each of them becomes a change of one line.
Annotated circuits and exchangeable gate implementations
When a logical circuit is compiled into a physical one, most frameworks return a long, flat list of gates. The logical structure is lost: which gates belong to a CNOT, which to the third syndrome extraction round, which to the final logical measurement. The Orqid QEC compiler retains this information. Every fragment of the physical circuit it produces carries an annotation, a label identifying the operation it implements, the logical qubits it acts on and its position in the algorithm.
These annotations are more than bookkeeping. The decoder uses them to build the detector structure of the circuit, and they are the handles through which you can address any part of the encoded algorithm in later steps, as we show in the next sections. Annotations also make it easy to exchange different versions of each logical operation.
Haiqu introduced QECX, a file format to specify and exchange compiler-usable descriptions of error correcting codes. The QECX file for a code can contain several implementations of the same logical operation: for example, different schedules of the syndrome extraction cycle, various versions of state preparation, or logical gates.
In Orqid, switching between them requires no re-implementation. You select a different variant at compile time, and the compiler stitches the circuit together consistently, with all the downstream information updated automatically.
For instance, one of the critical decisions in selecting the right implementation is the choice of the correct syndrome measurement variant. An error correcting code has a finite number of syndromes one can measure, and thus a finite number of errors it can detect and correct. By increasing the size of the code, also called a code distance, one can measure more syndromes and correct more errors. The exponential logical error reduction with the distance only happens when the physical error rates of the device are below a certain value, referred to as the threshold. The higher the threshold, the looser the constraints on the quantum computer, the lower the logical error rate one can achieve with a smaller number of physical qubits, ultimately allowing for larger algorithms to run reliably. With Orqid, you can verify how the order in which individual error syndromes are measured affects the ability of the code to correct those errors.
Say, you decide to measure the syndromes one by one, as a sequential operation. The same physical qubit can be measured multiple times when extracting different syndromes. If the measurements are done one by one, there is a high probability that an error on a qubit measured earlier will propagate to the qubits measured later. The number of detected syndromes will increase, making the task harder for the decoder. The quality of error correction will decrease. If, on the other hand, we measured all the syndromes that can be measured independently at the same time, the error happening on one qubit couldn’t possibly propagate to another qubit measured at that moment. The error remains localized, fewer syndromes signal an error, the decoder can make a more accurate prediction. The figure above shows results from an experiment run in Orqid, illustrating how the error correcting threshold dramatically increases when switching from sequential to parallel syndrome measurement, signaling the fault-tolerant behaviour.
Annotation-driven noise modelling
A single number, the final logical error rate, tells you how often your algorithm fails but not why. In an encoded circuit, errors can originate in the logical gates themselves, in the syndrome extraction meant to catch them, in the initial state preparation or in the final measurement. Each contributes differently, and each calls for a different fix: another gadget variant, more measurement rounds, a larger code distance, or an error mitigation layer on top.
Orqid separates these contributions by allowing you to apply the noise in a selective way through the annotations. Instead of one global error rate, you can specify noise per annotation label: for example one strength for the two-qubit gates inside a logical CNOT, another for the syndrome extraction cycles, none at all for state preparation. The noise model lives in a separate file, so the compiled circuit stays untouched while you vary only what is applied to it.
This can be particularly useful when modelling the early fault-tolerant and partially error-corrected architectures, where only some qubits may be fully protected from the effects of the noise.
You can also assign different noise types to different gadgets, for example biased noise during logical gates and depolarizing noise during idling, to see how sensitive each part of the circuit is to the physics of a specific device.
This enables a simple workflow: switch noise on for one logical operation at a time and watch how the logical error responds. The result can be an error budget of your algorithm, broken down by logical operation, which shows where an improvement would pay off most. We already used this in the logical computation example of our introductory blog, where we left the non-fault-tolerant state preparation noiseless to isolate the performance of the rest of the circuit.
In the figure below, using Orqid we demonstrate how the noise acting on the different components of the algorithm contributes to the logical error rate. With a few lines of code you can choose which of the annotated operations will be subject to gate noise, while the rest of the circuit stays untouched. In this distance-5 memory experiment on the color code, the noise in the syndrome measurements dominates the logical error rate at physical error rates above roughly 0.2%. Below that, the non-fault-tolerant state preparation becomes the largest contribution, which tells you where a better implementation would pay off first.
Seamless decoder switching
The decoder is the classical half of error correction. Given the syndrome record, it decides which correction to apply, and a decoder poorly matched to the code or the noise can discard much of the protection the code provides. Decoders differ in speed, in the codes they support, and in the noise structures they handle well. Minimum-weight perfect matching (MWPM) is fast and natural for surface codes, Chromobius is tailored to color codes, and Tesseract can exploit more general noise correlations, but at a higher computational cost.
In most workflows, changing the decoder means reformatting the circuit and syndrome data for a new library, and often re-deriving the detector structure by hand. In Orqid, the information each decoder needs is already produced by the compiler from the annotations and the QECX file. Switching the decoder is a single argument in the simulation call, while the compiled circuit, the noise model and the sampled syndromes stay the same.
Because the measurement samples can be shared, decoders are compared on identical data, so differences in the logical error rate reflect decoders’ performance rather than statistical fluctuations. Combined with selective noise modelling, this also shows how each decoder copes with specific noise acting on specific gadgets, for instance whether a correlation-aware decoder recovers the performance lost to correlated errors during a particular logical gate.
The figure above shows this in practice. We ran the same memory experiment as before, but decoded the same set of samples with three different decoders: Chromobius, Tesseract and BP-OSD. The logical error rates differ noticeably from one decoder to another, and the difference grows with the distance: the more accurate decoders gain the most from a larger code. This is precisely the effect one wants to achieve to win the race against the noise. That accuracy costs time. Chromobius finishes almost immediately, while Tesseract, which reaches the lowest logical error rate, takes far longer to run, and its run time rises quickly with the distance. BP-OSD sits between the two on both counts. Which decoder is the right one therefore depends on what you need: a fast first look at many configurations, or the best logical error rate your code can deliver. With Orqid, you can find out by changing a single argument.
Putting it together
Individually, each of these features removes a piece of tedious, error-prone custom code. Together, they turn the study of an EFTQC algorithm into a systematic exploration. Choose the logical operation variants, decide where noise acts and how, pick a decoder, and change any of them independently, while the rest of the pipeline stays fixed.
The question is no longer how to set an experiment up, but which configuration gives your algorithm the best performance on a given device. And now you can answer this question with much less effort.
Since Orqid is natively integrated with the rest of the Haiqu SDK, the same annotated circuits can be combined with techniques such as error mitigation, a combination we expect to be essential throughout the early fault-tolerant era. We will cover this, along with resource estimation, in upcoming posts.
The full Orqid toolkit and the complete Haiqu SDK are available free of charge to academic researchers through the Haiqu Academic Program. We encourage you to apply and start exploring!