Researchers at Intelligent Quantum Inception Co., Ltd. and Tsinghua University have developed LuWu, a quantum compilation algorithm that significantly reduces the size of circuits needed for complex calculations. Benchmarking at 8,192 qubits, LuWu achieves 7.3 times higher optimization performance than the Qiskit O3 compiler while completing the compilation process 7.1 times faster. The algorithm, discovered through a human-AI collaboration and based on the ZX-calculus, guarantees circuit equivalence without verification and scales nearly linearly with qubit count, addressing a critical bottleneck in both near-term and fault-tolerant quantum computing.
LuWu Compiler Achieves 8,192 Qubit Scalability
The LuWu compiler reduces the number of T gates in quantum circuits by an average of 57 percent, a key metric for assessing efficiency in quantum computation. This reduction, achieved on benchmarks reaching 8,192 qubits, demonstrates a substantial improvement over existing compilation methods and directly addresses a core challenge in building practical quantum computers. The algorithm also decreased the number of two-qubit gates by approximately 29 percent and circuit depth by 49 percent, further streamlining quantum operations.
These combined reductions in essential resources promise to lower the physical costs associated with both near-term and fault-tolerant quantum computing architectures. The design of LuWu, originating from a collaboration between human researchers and artificial intelligence, operates directly within the ZX-calculus, a mathematical framework for reasoning about quantum circuits.
This approach guarantees exact equivalence between the original and compiled circuits without the need for separate verification steps, a process that can be computationally expensive and prone to error. The compiler’s runtime scales nearly linearly with the number of qubits, with exponents ranging from 1.03 to 1.20 when fitted to a power law, ensuring it remains practical even as circuit sizes continue to grow. This scalability is a critical factor for realizing the potential of large-scale quantum computation.
Optimization rules discovered on small circuits containing at most 28 qubits generalized directly to the larger, unseen circuits. This ability to transfer knowledge from smaller to larger systems represents a significant advantage, reducing the need for extensive retraining or recalibration as quantum computers scale up. “Thus, our compiler, called LuWu, strikes a balance among efficiency, universality, and scalability,” the authors write in their report.
The compiler’s versatility extends beyond standard unitary quantum circuits, encompassing non-unitary operations and dynamic circuits that incorporate mid-circuit measurements, resets and classical feedforward. Across 64 benchmarks using general linear maps and reaching 1,024 qubits, the extended LuWu compiler achieved 100 percent compilation success while reducing composite gate and depth counts by 70 percent. This extension demonstrates the algorithm’s adaptability to a wider range of quantum computing paradigms.
The team evaluated all 34 cumulative generations discovered by the human-AI team within a single C++11 implementation to benchmark universality, scalability and optimization quality under uniform conditions. The compiler’s ability to handle these diverse circuit types positions it as a potentially valuable tool for a broad spectrum of quantum computing applications.
ZX-Calculus Basis Guarantees Exact Equivalence
The LuWu compiler achieves exact equivalence in quantum circuit optimization by operating directly within the ZX-calculus, eliminating the need for post-compilation verification processes that become computationally prohibitive as qubit counts rise. Unlike compilers such as kickmix, which restrict circuit construction to a limited set of reversible logic gates, LuWu uses the full expressiveness of the ZX-calculus to handle arbitrary circuits without sacrificing scalability. This approach circumvents the QMA-hard problem of verifying equivalence, a significant hurdle for many large-scale quantum algorithms.
The design of LuWu prioritizes a deterministic compilation pathway, evolving a compiler restricted to a fixed library of 17 elementary ZX-calculus rewrite rules, rather than relying on generative models that require subsequent verification. This evolutionary process, a human-AI collaboration, focuses on discovering a compiler that consistently reduces circuit complexity while guaranteeing unitary equivalence through construction.
By confining edits to a defined system, the ensures each transformation preserves the underlying linear map, eliminating the exponential cost associated with state simulation. The compiler briefly explores non-circuit ZX diagrams, capturing nonlocal cancellations before converting them back into directly readable circuits, a strategy that maintains linear scalability. The compiler’s architecture is visually represented through ZX diagrams, using colored nodes, green Z spiders and red X spiders, arranged along qubit wires to depict gates.
Plain and Hadamard edges encode CNOT and CZ gates, forming the basis of the circuit representation. This graphical language allows for a clear visualization of the compilation process and facilitates the identification of optimization opportunities. “Since every elementary axiom preserves the underlying linear map exactly, exact unitary equivalence is guaranteed by construction, without an equivalence verifier or the exponential cost of state simulation,” the authors state, highlighting a core benefit of the approach.
LuWu Outperforms Qiskit O3 on Large Benchmarks
The LuWu compiler achieves a 7.3-times higher composite optimization performance than Qiskit O3 on benchmark circuits, a substantial gain in efficiency for large-scale quantum computation. This improvement, detailed in recent work, was observed while simultaneously running 7.1 times faster than the widely used Qiskit O3 compiler, a critical advantage as compilation time becomes a bottleneck with increasing qubit counts. The compiler’s performance was evaluated across 130 previously unseen large circuits, demonstrating its ability to handle complex quantum algorithms beyond the scale of many current quantum systems.
Further analysis revealed that LuWu’s aggregate optimization metric, , reached 46 percent across the benchmark circuits, compared to just 6.4 percent for Qiskit O3. This metric combines reductions in T-gate count, total gate count, circuit depth and two-qubit gate usage, providing a comprehensive measure of optimization effectiveness.
The gains were not limited to initial optimization passes; from optimization rounds G22 to G32, the compiler’s performance plateaued before a dedicated C++ acceleration phase cut runtime by a factor of 2.7. These results indicate a robust and scalable optimization strategy, capable of maintaining performance even as circuit complexity increases. The compiler’s ability to generalize optimization rules discovered on smaller circuits is also noteworthy.
Rules refined on circuits containing 28 qubits or fewer were directly applied to the larger benchmarks, achieving significant reductions in gate count and depth without requiring retraining or modification. This suggests that the underlying principles of optimization are transferable across different circuit scales, simplifying the development process and reducing the need for extensive benchmarking on every new architecture.
Evaluations against five other universal compilers, Qiskit O3, TKET, PyZX Teleport, PyZX FullReduce and QuiZX, showed LuWu consistently outperformed them on most metrics. While some ZX-based baselines matched LuWu in T-gate reductions, LuWu delivered stronger reductions in two-qubit gates, total gate count and circuit depth. “LuWu beats Qiskit O3 and TKET on every metric,” the researchers report, highlighting the compiler’s comprehensive advantage.
Compiler Strategy: Bounded ZX Diagram Excursions
The LuWu compiler employs a unique strategy of bounded excursions into non-circuit ZX diagrams to achieve substantial reductions in quantum circuit complexity, a departure from compilers that remain strictly within circuit-like structures. This approach allows the algorithm to capture nonlocal cancellations without the computational cost of global graph extraction, a key innovation in scaling quantum compilation.
By briefly venturing into diagrams where standard circuit rules are relaxed, represented by a structural distance, D, greater than zero, and then immediately returning to valid circuit form, LuWu avoids becoming trapped in computationally intractable regions. The compiler’s effectiveness is demonstrated through benchmarks, where it achieved an average reduction of 57% in T-gate count, 29% in two-qubit gate count and 49% in circuit depth.
A normalized structural distance, D, is used to quantify the degree to which the compiler deviates from a standard circuit representation, with D equaling zero indicating a valid circuit. The LuWu compiler strategically moves selected subgraphs into transient states where D is greater than zero, then rapidly returns each excursion to D equaling zero, preventing the evolution into deeply non-circuit diagrams. This controlled exploration, visualized through a compilation trace showing structural distance alongside circuit cost reductions, allows the compiler to identify and eliminate redundancies more effectively than traditional methods.
The development of LuWu involved a human-AI collaboration, with a team of large language model agents contributing to the discovery of 34 cumulative generations of optimization strategies. Once evolution is complete, the compiler operates deterministically, eliminating any runtime reliance on language models. The compiler translates any n-qubit quantum circuit into an open ZX diagram, initiating the optimization process.
Optimization Rule Generalization Across Qubit Scales
The LuWu compiler demonstrates a consistent ability to refine as qubit counts scale to 8,192, a level exceeding many currently available quantum processors. Benchmarking against Qiskit O3, the algorithm achieved a 7.3-times higher composite optimization performance on circuits of this size, indicating a substantial reduction in resource requirements for complex quantum computations.
The team attributes this speed to a dedicated acceleration round, generation G33, focused on optimizing C++ data structures and scheduling internals after initial optimization performance plateaued between generations G22 and G32. This focused effort yielded a 2.7-times reduction in runtime, demonstrating the importance of low-level code optimization alongside algorithmic improvements.
This improvement is quantified using a metric, , that calculates the percentage reduction in T-gate count, two-qubit gate count, total gate count and circuit depth. The ability to generalize optimization rules from small to large circuits is a key feature of LuWu, suggesting the underlying principles are transferable. The team evaluated 212 public benchmark circuits, dividing them into a discovery set of 81 circuits with up to 28 qubits and a disjoint large circuit dataset of 131 circuits.
This separation allowed for rigorous testing of the algorithm’s ability to apply knowledge gained from smaller circuits to larger, more complex problems. All benchmarks were executed on a single Intel Xeon Platinum 8378HC core using identical native gate sets, ensuring uniform benchmarking conditions. The resulting compiler offers a substantial improvement in both the speed and efficiency of quantum circuit compilation.
👉 More information
🗞 An Efficient, Universal and Scalable Quantum Compiler
✍️ Tao Zhang and Linghui Chen (Intelligent Quantum Inception Co., Ltd., Haidian, Beijing, China.); Hui Zhai (Department of Physics and State Key Laboratory of Low Dimensional Quantum Physics, Tsinghua University, Beijing, China.)
🧠 ArXiv: https://arxiv.org/abs/2612.04231v1




See today’s quantum computing news on Quantum Zeitgeist for the latest breakthroughs in qubits, hardware, algorithms, and industry deals.
