The first agentic OS for Quantum R&D teams is here
Wave Asanoha 2x

Introducing Orqid: Haiqu’s software framework for research and simulation of early fault tolerant algorithms

Blog

We take the near-infallibility of the classical computers which power our digital world for granted, but this is only possible thanks to an invisible layer of error correction. As quantum processors begin to incorporate quantum error correction (QEC), we are entering the era of Early Fault Tolerant Quantum Computing (EFTQC). In this extended regime both limited-scale error correction and NISQ methods like error mitigation must coexist, but currently quantum application developers lack tools to experiment, simulate and optimize their algorithms for EFTQC devices, while QEC researchers cannot easily make their codes widely usable. With Orqid, Haiqu is introducing an open QECX standard for code sharing, a public code library, and a modular framework for EFTQC algorithm research and simulation which uses them. 

Pipeline guided

Introduction: early fault tolerant quantum computing (EFTQC)

Trillions of operations on endless strings of ones and zeros: sent, received, modified, all without fault. This infallibility is an illusion. Errors in classical computations do happen constantly, bits “flip” seemingly spontaneously, and left unattended they’d turn any data into meaningless gibberish. What keeps them in check, from writing data on your laptop’s SSD to communicating with the Voyager probe at the far reaches of the Solar System, is error correction. Error correcting codes redundantly express information using auxiliary bits, and through constant check and correction operations catch and repair errors as they appear.

 

Quantum computing also requires error correction. In fact, much more so than any classical devices, as, in contrast to the classical bits, the quantum states in which data is encoded are extremely fragile. While we currently use the pioneering “Noisy Intermediate Scale Quantum” (NISQ) devices, the very noise in their name limits the complexity and accuracy of the problems they can solve. 

Quantum computing at scale, with its flagship quantum algorithms such as Shor’s or Quantum Signal Processing, and commercial and scientific advantages they promise, is not possible without quantum error correction (QEC).

The very fact that Quantum Error Correction works at all, is a small miracle. Simple generalizations of classical error correction are fundamentally not possible, as quantum states cannot be duplicated or “cloned”, and it took none other than Peter Shor himself to show that truly quantum codes exist. But a quantum code means encoding logical information in (many) more physical qubits and using (many) more quantum gates, all of which are noisy themselves. A foundational result by Knill, Laflamme and Zurek is a “threshold theorem” which shows it is possible to essentially outrun the noise: If the noise of a physical quantum gate can be brought below a small, but finite value, then, as the power (or “distance”) of an error correcting code is increased, it removes more errors than are introduced by the increased number of qubits and gates it requires. You don’t have to build a perfectly noiseless computer – just good enough, and then quantum error correction will do the rest!

 

There is a catch, though: ever more physical qubits are required to bring the “logical” error rate even further down. How many? Thousands per a single logical qubit to run the Shor’s algorithm for cryptographic problems, for instance. The technological regime when this is possible is the large-scale fully Fault Tolerant Quantum Computing, or FTQC. With mere hundreds of physical qubits comprising a whole quantum processor (QPU) today, we are a long way off from fully corrected large-scale logical computations, even though the groundbreaking experiments of Google, QuEra and Quantinuum demonstrated below threshold error scaling on QPUs. Large scale FTQC is thus the long-term goal, and useful theoretical model, but not a near-term reality. 

Early Fault Tolerant Quantum Computing, or EFTQC, in contrast, describes the regime when error correction is possible, but the QPUs architectures only allow a small number of logical qubits, or smaller-distance codes providing moderately reduced error rates, or only for some operations. 

It describes, in other words, the computational model of the next generations of actual, rather than idealised, QPUs, which any researcher and quantum application developer will have to contend with.

 

For quantum algorithms EFTQC means that the errors cannot be simply abstracted away: quantum operations may be better than those on bare physical qubits, but they are not perfect, and resources are finite, imposing tradeoffs between accuracy and size of problems possible to solve. Rather than treating NISQ and FTQC as diametrically opposed and their toolboxes incompatible, it is now understood that the gradual transitionary EFTQC regime requires careful tradeoffs, and combinations of error correction with NISQ techniques, such as error mitigation (EM), to best use the limited quantum resources.

Orqid: a modular framework for EFTQC algorithm simulation

To take advantage of the EFTQC devices a quantum application researcher needs to understand the performance, and optimize their algorithm taking into account all the elements of the error correcting stack: the QPU with its detailed physical noise, distinct error correcting codes with their distance and implementation variants, different decoders and, finally, possible error mitigation methods. Likewise, a QEC researcher may want to investigate the performance of implementation variants of their code, or under different detailed noise models. This is a daunting number of moving parts typically requiring custom code, and while some of them are partially covered by the existing FTQC frameworks, none of them allows to easily end-to-end simulate such scenarios, or even execute them on device.

EFTQC poster 3

This is precisely what Orqid is designed to do. Its modular structure has three levels. First, the open QECX standard for sharing error correcting codes we introduce, which contains their definitions and circuit-level implementations. Second, a QEC compiler, which uses the QECX file to convert arbitrary logical circuits into encoded, physical level ones supplemented by additional information useful downstream. Finally, the simulator module: with the help of compiler information it can apply detailed noise modes, execute the algorithm using different decoders and physical simulators, and return complete physical and logical measurement records, as extracted from an actual QPU. This allows Orqid to integrate with the existing Haiqu quantum middleware, applying e.g. error mitigation, T-gate compression, or state preparation routines, but also, in the future, to execute the circuits on real error corrected processors.

The QECX code exchange standard is at the heart of Orqid, and addresses one of the biggest practical obstacles for anyone exploring error correction: non-existent, incomplete, or hard-coded and incompatible code implementations. 

To apply a QEC code its mathematical description is not sufficient. A usable implementation requires specifying all the qubits and classical registers used, and the quantum circuits for all the “gadgets” such as state preparation, logical measurement, error syndrome extraction, and logical operations. Each of these gadgets, fault-tolerant or not, may have different realizations, scattered in separate papers, or hardcoded in incompatible libraries and research codes. A QECX file provides a complete, consistent and directly usable specification of a QEC code, with all its gadgets or their variants and any code-specific information necessary for decoders. It allows a QECX compatible compiler to return the physical circuits for the input logical algorithm. Comparing different codes is as simple as loading their corresponding QECX files and compiling the algorithm with each of them in a few lines of code, with no arduous re-implementation. The current QECX standard supports stabilizer, CSS and subsystem CSS codes; the standard is being actively extended.

 

To facilitate sharing and using the QECX code files, but also authoring them, we have created a public QECX library. It allows exploring codes and their mathematical properties, downloading and using them directly in simulations. Quantum Error Correction is an active research area, and new codes or implementations are being developed by researchers – to help them share their inventions with the community in a form suited to immediate experimentation we also provide tools to verify the correctness of the files, and of the constructions. With the open specification of the QECX researchers are not locked to a proprietary compiler, they can either use the Orqid one, or build their own.

Library image

Orqid contains a dedicated QECX-compatible compiler as its second layer. For any logical circuits it returns annotated physical circuits giving their physical realization with the selected code or its variant. The annotations preserve the logical identity of different fragments of the physical circuit identifying them, for instance, as a syndrome extraction gadget. This information is both useful for subsequent decoding, but also gives Orqid its unique EFTQC capabilities: annotations can also be used to impose detailed and heterogeneous noise models on different parts of the circuit. Specifying some qubits as error corrected while others noisy to simulate a FTQC device coupled to a NISQ one, or assuming entirely different types of noise on some logical subcircuits to isolate their performance only requires invoking their annotation labels.

 

Finally, Orqid's simulating layer tackles the task of sampling the physical circuit produced by the compiler, decoding it and returning the physical and logical measurement counts. It uses the compiler annotations to apply the noise model supplied in an external file, and executes the circuits on one of the supported simulator backends: the first release supports Clifford simulation with Stim, but in the near future will also integrate near-Clifford and other simulators. Orqid's modular nature allows also to use and compare different decoding backends, for example the MWPM, BP-OSD, Chromobius or Tesseract decoders, and to integrate with further ones.

EFTQC poster 2

The image above illustrates the use of Orqid in a simple but important example. Imagine you want to verify, or find, the “threshold” of an error correcting code, that is the physical noise strength below which enlarging the code (increasing the distance) methodically decreases the logical error. It depends on the code implementation and the noise type, and is a key figure in understanding the potential performance of the QPU, code and algorithm. To measure it, you need to run a sequence of simulations, preparing physical circuits representing the test logical one compiled with different distance versions of the code, simulate them with different noise strengths, decode and compute the logical error rates. 

With Orqid a threshold experiment as simple as supplying the logical test circuit, selecting or providing your own noise model, and letting it iterate over QECX files for different code distances, with the compilation, simulation and decoding all taken care of!

Here we do that for a two-qubit logical Bell state and the triangular 4.8.8 color code for distances d=3,5,7. We selectively chose e.g. not to apply the noise on state preparation and to use the Stim backend with the Tesseract decoder. The bottom left panel shows a neat crossing point of the logical-physical error curves for different distances, indicating the threshold noise strength, while the right one shows the convergence of the measured distribution to the expected one for the Bell state.

 

This is one of the simplest possible experiments, but Orqid allows much more, with equal ease. We will detail its capabilities, particularly different modularity features, resource estimation capabilities, the QECX standard and the integration with NISQ tools critical to EFTQC in the next blogs, and you can also explore them on our website.

The next steps

Orqid is by design modular, and in the coming months we will be extending the range of functionalities, codes and backends it supports. The QECX standard and the compiler currently, for instance, allow transversal and teleportation-based logical gates, but lattice surgery support is planned in the near future. Likewise, the range of supported simulation backends is scheduled to be expanded to near-Clifford and Tensor Network based ones, and we are working on integrating new decoders as well. Finally, Orqid is natively integrated with the remainder of Haiqu SDK quantum software stack, and error corrected execution on actual QPUs will be introduced in the next stages (though it is already possible to export the physical circuits).

The QECX standard is purposefully open to allow QEC researchers to build and verify their own code files. At Haiqu we believe that the practical progress in EFTQC requires a closer and more obstacle-free collaboration between error correction experts, algorithm researchers and quantum applications developers, and this is what Orqid and the QECX facilitates.

To learn more about Orqid and QECX visit our webpage and the code library. The full Orqid and access to the complete Haiqu SDK software stack is available to academic researchers free of any charge via the Haiqu Academic Program, which we encourage you to apply for!