A Quantinuum-led team has built the quantum programming tools for real-time magic state distillation on a quantum computer

Researchers at Quantinuum and Microsoft’s Azure Quantum used the Quantum Intermediate Representation (QIR) to demonstrate a magic state distillation protocol for the first time on quantum hardware – a key element necessary for universal, fault-tolerant quantum computing

October 24, 2023

Building a quantum computer that offers advantages over classical computers is the goal of quantum computing groups worldwide. A competitive quantum computer must be “universal”, requiring the ability to perform all operations already possible on a classical computer, as well as new ones specific to quantum computing. Of course, that’s just the beginning – it should also be able to do this in a reasonable amount of time, to deal effectively with noise from the environment, and to perform computations to arbitrary accuracy.

This is a lot to get right, and over the years quantum computer scientists have described ways to solve these often-overlapping challenges. To deal with noise from the environment and achieve arbitrary accuracy, quantum computers need to be able to keep going even as noise accumulates on the quantum bits, or qubits, which hold the quantum information. Such fault-tolerance may be achieved using quantum error correction, where ensembles of physical qubits are encoded into logical qubits and those are used to counteract noise and perform computational operations called gates. Unfortunately, no single quantum error correction code plays well with the goal of universality because all codes lack a complete universal set of fault-tolerant gates (the technical reason for this comes down to the way quantum gates are executed between logical qubits – the native gate set on error-corrected logical qubits are known by experts as transversal gates, and they do not include all the gates needed for universal quantum computing).

The solution to this obstacle to universality is a magic state, a quantum state which provides for the missing gate when error correcting codes are used. High fidelity magic states are achieved by a process of distillation, which purifies them from other noisier magic states. It is widely recognized that magic state distillation is one of the totemic challenges on the path towards universal, fault-tolerant quantum computing. Quantinuum’s scientists, in close collaboration with a team at Microsoft, set out to demonstrate the distillation process in real-time using physical qubits on a quantum computer for the first time.

The results of this work are available in a new paper, Advances in compilation for quantum hardware -- A demonstration of magic state distillation and repeat until success protocols.

Magic state distillation

How does magic state distillation work? Imagine a factory, taking in many qubits in imperfect initial states at one end. Broadly speaking, the factory distills the imperfect states into an almost pure state with a smaller error probability, by sending them through a well-defined process over and over. In this case, the process takes in a group of five qubits. It applies a quantum error correcting code that entangles these five qubits, with four used to test whether the fifth, target qubit has been purified. If the process fails, the ensemble is discarded and the process repeats. If it succeeds, the newly distilled target qubit is kept and combined with four other successes to form a new ensemble, which then rejoins the process of continued purification. By undertaking this process many times, the purity of the magic state increases at each step, gradually moving towards the conditions required for universal, fault-tolerant quantum computing.

Despite being the subject of theoretical exploration over decades, real-time magic state distillation had never been realized on a quantum computer. In typical pioneering style, the Quantinuum and Microsoft team decided to take on this challenge. But before they could get started, they recognized that their toolset would have to be significantly sharpened up.

Creating new tools for quantum programming

At the heart of magic state distillation is a highly complex repeating process, which requires state-of-the-art protocols and control flow logic built on a best-in-class programming toolset. The research team turned to Quantum Intermediate Representation (QIR) to simplify and streamline the programming of this complex quantum computing process.

QIR is a is a quantum-specific code representation based on the popular open-sourced classical LLVM intermediate language, with the addition of structures and protocols that support the maturation and modernization of quantum computing. QIR includes elements that are essential in classical computing, but which are yet to be standardized in quantum computing, such as the humble programming loop.

Loops, which often take forms like "for...next" or "do...while," are central to programming, allowing code to repeat instructions in a stepwise manner until a condition is met. In quantum computing, this is a tough challenge because loops require control flow logic and mid-circuit measurement, which are difficult to realize in a quantum computer but have been demonstrated in Quantinuum’s System Model H1-1, Powered by Honeywell. Loops are essential for realizing magic state distillation and it’s well-understood that LLVM is great at optimizing complex control flow, including loops. This made magic state distillation a natural choice for demonstrating a valuable application of QIR and making for a great example of the use of a classical technique in a quantum context.

Result: demonstrating a magic state distillation protocol

The team used Quantinuum’s H1-1 quantum computer – benefiting from industry-leading components such as mid-circuit measurement, qubit reuse and feed-forward – to make possible the quantum looping required for a magic state distillation protocol, and becoming the first quantum computing team ever to run a real-time magic state distillation protocol on quantum hardware.

Four ways to achieve a quantum computer programmable loop

Building on this success, the team designed further experiments to assess the potential of four methods for exploring the use of a quantum protocol called a repeat-until-success (RUS) circuit to achieve a loop process. First, they hard-coded a loop directly into the extended OpenQASM 2.0, a widely used quantum assembly language, but which requires additional overhead to target advanced components on Quantinuum's very versatile H-Series quantum computer. Against this, they compared two alternative methods for coding a loop in a standard high-level programming language: controlled recursion, which was directed through both OpenQASM and through QIR; and a native for loop made possible within QIR.

The results were clear-cut: the hard-coded OpenQASM 2.0 loop performed as well as the theoretical prediction, maintaining high quality results after a number of loops, as did the natively-coded QIR for loop. The two recursive loops saw the quality of their results drop away fast as the loop limit was raised. But in a head-to-head between hard-coded OpenQASM and QIR, which converts high-level source code from many prominent and familiar languages into low-level machine code, QIR won hands-down on the basis of practicality.

A graph of a graphDescription automatically generated
Figure 1: comparison of programmed loops by the survival fidelity of the target qubit in the X-basis

Martin Roetteler, Director of Quantum Applications at Microsoft, shared: “This was a very exciting exploration of control flow logic on quantum hardware. In seeking to understand the capabilities of QIR to optimize programming structures on real hardware, we were rewarded with a clear answer, and an important demonstration of the capabilities of QIR.”

H2’s 32 qubits will power the next phase

In follow-up work, the team is now preparing to run a logical magic state protocol on the H2-1 quantum computer with its 32 high-fidelity qubits, and hopes to become the first group to successfully achieve logical magic state distillation. The features and fidelity offered by the H2 make it one of the best quantum computers currently capable of shooting for such a major milestone on the journey towards fault tolerance, while the current work demonstrates that, in QIR, the necessary control flow logic is now available to achieve it.

The paper discussed in this post was authored by Natalie C. Brown, John P. Campora III, Cassandra Granade, Bettina Heim, Stefan Wernli, Ciaran Ryan-Anderson, Dominic Lucchetti, Adam Paetznick, Martin Roetteler, Krysta Svore and Alex Chernoguzov.

About Quantinuum

Quantinuum, the world’s largest integrated quantum company, pioneers powerful quantum computers and advanced software solutions. Quantinuum’s technology drives breakthroughs in materials discovery, cybersecurity, and next-gen quantum AI. With over 500 employees, including 370+ scientists and engineers, Quantinuum leads the quantum computing revolution across continents. 

Blog
May 1, 2025
GenQAI: A New Era at the Quantum-AI Frontier

At the heart of quantum computing’s promise lies the ability to solve problems that are fundamentally out of reach for classical computers. One of the most powerful ways to unlock that promise is through a novel approach we call Generative Quantum AI, or GenQAI. A key element of this approach is the Generative Quantum Eigensolver (GQE).

GenQAI is based on a simple but powerful idea: combine the unique capabilities of quantum hardware with the flexibility and intelligence of AI. By using quantum systems to generate data, and then using AI to learn from and guide the generation of more data, we can create a powerful feedback loop that enables breakthroughs in diverse fields.

Unlike classical systems, our quantum processing unit (QPU) produces data that is extremely difficult, if not impossible, to generate classically. That gives us a unique edge: we’re not just feeding an AI more text from the internet; we’re giving it new and valuable data that can’t be obtained anywhere else.

The Search for Ground State Energy

One of the most compelling challenges in quantum chemistry and materials science is computing the properties of a molecule’s ground state. For any given molecule or material, the ground state is its lowest energy configuration. Understanding this state is essential for understanding molecular behavior and designing new drugs or materials.

The problem is that accurately computing this state for anything but the simplest systems is incredibly complicated. You cannot even do it by brute force—testing every possible state and measuring its energy—because  the number of quantum states grows as a double-exponential, making this an ineffective solution. This illustrates the need for an intelligent way to search for the ground state energy and other molecular properties.

That’s where GQE comes in. GQE is a methodology that uses data from our quantum computers to train a transformer. The transformer then proposes promising trial quantum circuits; ones likely to prepare states with low energy. You can think of it as an AI-guided search engine for ground states. The novelty is in how our transformer is trained from scratch using data generated on our hardware.

Here's how it works:

  • We start with a batch of trial quantum circuits, which are run on our QPU.
  • Each circuit prepares a quantum state, and we measure the energy of that state with respect to the Hamiltonian for each one.
  • Those measurements are then fed back into a transformer model (the same architecture behind models like GPT-2) to improve its outputs.
  • The transformer generates a new distribution of circuits, biased toward ones that are more likely to find lower energy states.
  • We sample a new batch from the distribution, run them on the QPU, and repeat.
  • The system learns over time, narrowing in on the true ground state.

To test our system, we tackled a benchmark problem: finding the ground state energy of the hydrogen molecule (H₂). This is a problem with a known solution, which allows us to verify that our setup works as intended. As a result, our GQE system successfully found the ground state to within chemical accuracy.

To our knowledge, we’re the first to solve this problem using a combination of a QPU and a transformer, marking the beginning of a new era in computational chemistry.

The Future of Quantum Chemistry

The idea of using a generative model guided by quantum measurements can be extended to a whole class of problems—from combinatorial optimization to materials discovery, and potentially, even drug design.

By combining the power of quantum computing and AI we can unlock their unified full power. Our quantum processors can generate rich data that was previously unobtainable. Then, an AI can learn from that data. Together, they can tackle problems neither could solve alone.

This is just the beginning. We’re already looking at applying GQE to more complex molecules—ones that can’t currently be solved with existing methods, and we’re exploring how this methodology could be extended to real-world use cases. This opens many new doors in chemistry, and we are excited to see what comes next.

technical
All
Blog
April 11, 2025
Quantinuum’s partnership with RIKEN bears fruit

Last year, we joined forces with RIKEN, Japan's largest comprehensive research institution, to install our hardware at RIKEN’s campus in Wako, Saitama. This deployment is part of RIKEN’s project to build a quantum-HPC hybrid platform consisting of high-performance computing systems, such as the supercomputer Fugaku and Quantinuum Systems.  

Today, a paper published in Physical Review Research marks the first of many breakthroughs coming from this international supercomputing partnership. The team from RIKEN and Quantinuum joined up with researchers from Keio University to show that quantum information can be delocalized (scrambled) using a quantum circuit modeled after periodically driven systems.  

"Scrambling" of quantum information happens in many quantum systems, from those found in complex materials to black holes.  Understanding information scrambling will help researchers better understand things like thermalization and chaos, both of which have wide reaching implications.

To visualize scrambling, imagine a set of particles (say bits in a memory), where one particle holds specific information that you want to know. As time marches on, the quantum information will spread out across the other bits, making it harder and harder to recover the original information from local (few-bit) measurements.

While many classical techniques exist for studying complex scrambling dynamics, quantum computing has been known as a promising tool for these types of studies, due to its inherently quantum nature and ease with implementing quantum elements like entanglement. The joint team proved that to be true with their latest result, which shows that not only can scrambling states be generated on a quantum computer, but that they behave as expected and are ripe for further study.

Thanks to this new understanding, we now know that the preparation, verification, and application of a scrambling state, a key quantum information state, can be consistently realized using currently available quantum computers. Read the paper here, and read more about our partnership with RIKEN here.  

partnership
All
technical
All
Blog
April 4, 2025
Why is everyone suddenly talking about random numbers? We explain.

In our increasingly connected, data-driven world, cybersecurity threats are more frequent and sophisticated than ever. To safeguard modern life, government and business leaders are turning to quantum randomness.

What is quantum randomness, and why should you care?

The term to know: quantum random number generators (QRNGs).

QRNGs exploit quantum mechanics to generate truly random numbers, providing the highest level of cryptographic security. This supports, among many things:

  • Protection of personal data
  • Secure financial transactions
  • Safeguarding of sensitive communications
  • Prevention of unauthorized access to medical records

Quantum technologies, including QRNGs, could protect up to $1 trillion in digital assets annually, according to a recent report by the World Economic Forum and Accenture.

Which industries will see the most value from quantum randomness?

The World Economic Forum report identifies five industry groups where QRNGs offer high business value and clear commercialization potential within the next few years. Those include:

  1. Financial services
  2. Information and communication technology
  3. Chemicals and advanced materials
  4. Energy and utilities
  5. Pharmaceuticals and healthcare

In line with these trends, recent research by The Quantum Insider projects the quantum security market will grow from approximately $0.7 billion today to $10 billion by 2030.

When will quantum randomness reach commercialization?

Quantum randomness is already being deployed commercially:

  • Early adopters use our Quantum Origin in data centers and smart devices.
  • Amid rising cybersecurity threats, demand is growing in regulated industries and critical infrastructure.

Recognizing the value of QRNGs, the financial services sector is accelerating its path to commercialization.

  • Last year, HSBC conducted a pilot combining Quantum Origin and post-quantum cryptography to future-proof gold tokens against “store now, decrypt-later” (SNDL) threats.
  • And, just last week, JPMorganChase made headlines by using our quantum computer for the first successful demonstration of certified randomness.

On the basis of the latter achievement, we aim to broaden our cybersecurity portfolio with the addition of a certified randomness product in 2025.

How is quantum randomness being regulated?

The National Institute of Standards and Technology (NIST) defines the cryptographic regulations used in the U.S. and other countries.

  • NIST’s SP 800-90B framework assesses the quality of random number generators.
  • The framework is part of the FIPS 140 standard, which governs cryptographic systems operations.
  • Organizations must comply with FIPS 140 for their cryptographic products to be used in regulated environments.

This week, we announced Quantum Origin received NIST SP 800-90B Entropy Source validation, marking the first software QRNG approved for use in regulated industries.

What does NIST validation mean for our customers?

This means Quantum Origin is now available for high-security cryptographic systems and integrates seamlessly with NIST-approved solutions without requiring recertification.

  • Unlike hardware QRNGs, Quantum Origin requires no network connectivity, making it ideal for air-gapped systems.
  • For federal agencies, it complements our "U.S. Made" designation, easing deployment in critical infrastructure.
  • It adds further value for customers building hardware security modules, firewalls, PKIs, and IoT devices.

The NIST validation, combined with our peer-reviewed papers, further establishes Quantum Origin as the leading QRNG on the market.  

--

It is paramount for governments, commercial enterprises, and critical infrastructure to stay ahead of evolving cybersecurity threats to maintain societal and economic security.

Quantinuum delivers the highest quality quantum randomness, enabling our customers to confront the most advanced cybersecurity challenges present today.

technical
All