pith. sign in

arxiv: 2605.16595 · v1 · pith:55I3OCDZnew · submitted 2026-05-15 · 🪐 quant-ph

qstack: Compositional End-to-End Compilation for Fault-Tolerant Quantum Programs

Pith reviewed 2026-05-20 18:15 UTC · model grok-4.3

classification 🪐 quant-ph
keywords quantum compilationfault-tolerant quantum computingquantum error correctioncompiler frameworkhybrid quantum-classical programsopaque callbackscompositional compilation
0
0 comments X

The pith

qstack enables compositional end-to-end compilation for fault-tolerant quantum programs by wrapping classical callbacks.

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The paper presents qstack, a compiler framework that incorporates quantum error correction directly into the compilation pipeline for quantum programs. It introduces a purely quantum intermediate representation that treats classical feedback logic from syndrome measurements as opaque callbacks written in any classical language. The central mechanism is callback wrapping, which automatically adapts both quantum operations and the associated classical callbacks during each compiler pass. Any kernel that a callback dynamically generates is itself run through the full compilation pipeline. This design allows passes for different error-correcting codes to be composed without manual rewriting of classical logic, as shown by end-to-end compilation from high-level gates through Clifford gates to trapped-ion native instructions using repetition codes, the Steane code, and the Shor code.

Core claim

qstack's callback wrapping mechanism enables each compiler pass to automatically adapt quantum operations and their associated classical callbacks, with any kernel dynamically generated by a callback also compiled through the full pipeline, allowing ISA translation and quantum error correction to be expressed as composable passes including code concatenation.

What carries the argument

Callback wrapping, which automatically adapts both quantum operations and their associated classical callbacks while routing dynamically generated kernels through the full pipeline.

If this is right

  • ISA translation and quantum error correction can be expressed as composable compiler passes.
  • Concatenation of error-correcting codes such as repetition codes yielding Steane and Shor codes occurs without manual intervention.
  • End-to-end compilation from a high-level gate set through Clifford gates to trapped-ion native operations is achieved.
  • Any kernel dynamically generated by a callback is compiled through the full pipeline.

Where Pith is reading between the lines

These are editorial extensions of the paper, not claims the author makes directly.

  • This wrapping approach could reduce the effort required to add support for new hardware targets or error-correcting codes.
  • The technique may generalize to other hybrid quantum-classical compilation tasks that involve runtime feedback.
  • Limits may appear when classical callbacks contain complex state that interacts with quantum measurements in ways opaque access cannot capture.

Load-bearing premise

That classical logic accessed only through opaque callbacks preserves full program semantics across all compilation stages without requiring inspection or modification of the callback internals.

What would settle it

A concrete quantum program with classical feedback where a compilation pass changes observable behavior unless the callback internals are inspected or rewritten by hand.

Figures

Figures reproduced from arXiv: 2605.16595 by Andres Paz, Dan Grossman.

Figure 1
Figure 1. Figure 1: Gate definitions. Fixed gates specify a unitary matrix directly; [PITH_FULL_IMAGE:figures/full_fig_p002_1.png] view at source ↗
Figure 2
Figure 2. Figure 2: Distribution of measurement outcomes from 1000 simulation runs of [PITH_FULL_IMAGE:figures/full_fig_p003_2.png] view at source ↗
Figure 3
Figure 3. Figure 3: Composability of two compiler passes. Left: the wrapping structure after pass 1 and pass 2 each wrap the original callback. Right: runtime data flow when a measurement triggers the outermost wrapper. Decoders run outside-in (pass 2 then pass 1); if the callback returns a kernel, compilers run inside-out (pass 1 then pass 2). exactly. If a wrapped callback returns a new kernel, the wrap￾per compiles it thro… view at source ↗
Figure 4
Figure 4. Figure 4: Small-step operational semantics for qstack programs. Each rule steps a configuration [PITH_FULL_IMAGE:figures/full_fig_p007_4.png] view at source ↗
Figure 6
Figure 6. Figure 6: Program state after each compilation step for a three-qubit test [PITH_FULL_IMAGE:figures/full_fig_p007_6.png] view at source ↗
read the original abstract

Compiling quantum programs for fault-tolerant execution requires transforming high-level operations through multiple abstraction layers: from logical gates to error-corrected encodings to hardware-native instructions. A key challenge is that quantum error correction turns purely quantum programs into hybrid quantum-classical programs, where classical feedback from syndrome measurements drives quantum corrections at runtime. Existing compilation frameworks handle these quantum and classical components separately, requiring manual adaptation of classical logic at each compilation stage, all while preserving program semantics. We present qstack, a compiler framework built around a purely quantum intermediate representation in which classical logic is accessed only through opaque callbacks, written in any classical language. The framework's central mechanism, callback wrapping, enables compositional compilation: each compiler pass automatically adapts both quantum operations and their associated classical callbacks, and any kernel dynamically generated by a callback is compiled through the full pipeline. This allows ISA translation and quantum error correction to be expressed as composable compiler passes, including concatenation of error-correcting codes, without manual intervention. We demonstrate end-to-end compilation from a high-level gate set through Clifford gates to trapped-ion native operations, with bit-flip and phase-flip repetition codes, the Steane code, and the Shor code obtained by composing two repetition passes.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

2 major / 1 minor

Summary. The manuscript introduces qstack, a compiler framework for end-to-end compilation of fault-tolerant quantum programs. It defines a purely quantum intermediate representation in which classical logic is accessed exclusively through opaque callbacks written in arbitrary classical languages. The central mechanism is callback wrapping, which automatically adapts both quantum operations and their associated classical callbacks during each compiler pass; any kernel dynamically generated by a callback is fed through the full pipeline. This design allows ISA translation and quantum error correction (including concatenation of codes) to be expressed as composable passes without manual adaptation of classical logic. The paper demonstrates the approach by compiling from a high-level gate set through Clifford gates to trapped-ion native operations, obtaining bit-flip and phase-flip repetition codes, the Steane code, and the Shor code via composition of two repetition passes.

Significance. If the semantic-preservation properties hold, the framework would remove the need for manual rewriting of classical feedback logic at each abstraction layer, enabling more reliable compositional construction of fault-tolerant programs. The support for arbitrary classical languages inside opaque callbacks and the explicit handling of dynamically generated kernels are distinctive strengths. The demonstration on repetition, Steane, and Shor codes provides concrete evidence of the compositional workflow, though the absence of formal semantic arguments or equivalence checks limits the immediate impact on verified compilation pipelines.

major comments (2)
  1. [Abstract / Demonstration] Abstract and demonstration section: the central claim that callback wrapping preserves hybrid semantics for dynamically generated kernels (including exact timing, inputs, and outputs of classical feedback relative to syndrome measurements) is not supported by any semantic-preservation argument, error analysis, or equivalence verification. The Shor-code example obtained by composing two repetition passes therefore does not establish that classical control flow remains intact when callbacks remain opaque and may contain implicit dependencies on measurement representation or runtime context.
  2. [Framework description] Framework description (callback-wrapping mechanism): because callbacks are treated as black boxes written in arbitrary classical languages, the paper does not address how an earlier pass (e.g., ISA translation) could alter the effective hybrid program without inspecting or modifying callback internals. This assumption is load-bearing for the compositional claim yet receives no concrete test or counter-example analysis.
minor comments (1)
  1. [Abstract] The abstract refers to a 'purely quantum intermediate representation' without a dedicated figure or early section that defines its syntax and the precise interface to opaque callbacks.

Simulated Author's Rebuttal

2 responses · 0 unresolved

We thank the referee for the constructive comments on our manuscript. We address each major comment below with clarifications on the design and evidence provided. We plan revisions to strengthen the discussion of semantic properties and the opaque callback mechanism.

read point-by-point responses
  1. Referee: [Abstract / Demonstration] Abstract and demonstration section: the central claim that callback wrapping preserves hybrid semantics for dynamically generated kernels (including exact timing, inputs, and outputs of classical feedback relative to syndrome measurements) is not supported by any semantic-preservation argument, error analysis, or equivalence verification. The Shor-code example obtained by composing two repetition passes therefore does not establish that classical control flow remains intact when callbacks remain opaque and may contain implicit dependencies on measurement representation or runtime context.

    Authors: We acknowledge that the manuscript provides no formal semantic-preservation argument, error analysis, or equivalence verification. The Shor-code demonstration via composition of two repetition passes shows that dynamically generated kernels are fed through the full pipeline and that the resulting program executes correctly for the chosen codes. This offers practical evidence that classical feedback logic is preserved in the examples. We agree this does not constitute a rigorous proof for arbitrary opaque callbacks with potential implicit dependencies. In revision we will expand the discussion section with an informal argument describing how wrapping maintains relative timing and input/output interfaces for feedback, and we will note formal verification as future work. revision: partial

  2. Referee: [Framework description] Framework description (callback-wrapping mechanism): because callbacks are treated as black boxes written in arbitrary classical languages, the paper does not address how an earlier pass (e.g., ISA translation) could alter the effective hybrid program without inspecting or modifying callback internals. This assumption is load-bearing for the compositional claim yet receives no concrete test or counter-example analysis.

    Authors: The framework deliberately keeps callbacks opaque to accommodate arbitrary classical languages. Callback wrapping transforms the quantum operations and the calling interface so that the classical code receives measurement outcomes in the representation expected after the pass and returns corrections that are applied in the updated quantum context. No internal inspection or rewriting of the callback occurs; the wrapper supplies the adapted inputs and interprets the outputs according to the new abstraction level. We have added a concrete worked example of a simple syndrome-feedback loop under ISA translation to the revised manuscript to illustrate that the classical logic executes unchanged while the surrounding quantum operations are adapted. revision: yes

Circularity Check

0 steps flagged

No circularity: new framework design with no equations, fits, or self-citation chains

full rationale

The paper introduces qstack as a compiler framework using opaque callbacks and callback wrapping to enable compositional passes for hybrid quantum-classical programs. No mathematical derivations, fitted parameters, or equations appear in the provided text or abstract. Claims about automatic adaptation of quantum operations and callbacks rest on the framework's design and empirical demonstration on repetition, Steane, and Shor codes rather than any reduction to inputs by construction. No self-citations are invoked as load-bearing uniqueness theorems, and the approach does not rename known results or smuggle ansatzes. The central mechanism is presented as an independent engineering contribution without circular dependencies.

Axiom & Free-Parameter Ledger

0 free parameters · 1 axioms · 0 invented entities

The central claim rests on standard compiler assumptions plus one domain-specific premise about opaque callbacks; no free parameters or invented physical entities are introduced.

axioms (1)
  • domain assumption Classical logic can be treated as opaque callbacks without loss of program semantics during quantum compilation passes.
    Invoked as the basis for the IR design and callback wrapping mechanism.

pith-pipeline@v0.9.0 · 5738 in / 1163 out tokens · 59027 ms · 2026-05-20T18:15:25.373310+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Reference graph

Works this paper leans on

20 extracted references · 20 canonical work pages · 1 internal anchor

  1. [1]

    Qiskit: An open-source framework for quantum computing,

    Qiskit contributors, “Qiskit: An open-source framework for quantum computing,” 2023

  2. [2]

    Developers,Cirq, Aug

    C. Developers,Cirq. Zenodo, Apr. 2025. [Online]. Available: https://zenodo.org/doi/10.5281/zenodo.4062499

  3. [3]

    Quipper: a scalable quantum programming language,

    A. S. Green, P. L. Lumsdaine, N. J. Ross, P. Selinger, and B. Valiron, “Quipper: a scalable quantum programming language,” inProceedings of the 34th ACM SIGPLAN conference on Programming language design and implementation, 2013, pp. 333–342

  4. [4]

    Openqasm 3: A broader and deeper quantum assembly language,

    A. Cross, A. Javadi-Abhari, T. Alexander, N. De Beaudrap, L. S. Bishop, S. Heidel, C. A. Ryan, P. Sivarajah, J. Smolin, J. M. Gambettaet al., “Openqasm 3: A broader and deeper quantum assembly language,”ACM Transactions on Quantum Computing, vol. 3, no. 3, pp. 1–50, 2022

  5. [5]

    A Practical Quantum Instruction Set Architecture

    R. S. Smith, M. J. Curtis, and W. J. Zeng, “A practical quantum instruction set architecture,”arXiv preprint arXiv:1608.03355, 2016

  6. [6]

    Q#: Enabling scalable quantum computing and development with a high-level dsl,

    K. Svore, A. Geller, M. Troyer, J. Azariah, C. Granade, B. Heim, V . Kliuchnikov, M. Mykhailova, A. Paz, and M. Roetteler, “Q#: Enabling scalable quantum computing and development with a high-level dsl,” inProceedings of the Real World Domain Specific Languages Workshop 2018, ser. RWDSL2018. New York, NY , USA: Association for Computing Machinery, 2018. [...

  7. [7]

    Silq: A high-level quantum language with safe uncomputation and intuitive semantics,

    B. Bichsel, M. Baader, T. Gehr, and M. Vechev, “Silq: A high-level quantum language with safe uncomputation and intuitive semantics,” in Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation, ser. PLDI 2020. New York, NY , USA: Association for Computing Machinery, 2020, p. 286–300. [Online]. Available: https://do...

  8. [8]

    Guppy: Pythonic quantum-classical programming,

    M. Koch, A. Lawrence, K. Singhal, S. Sivarajah, and R. Duncan, “Guppy: Pythonic quantum-classical programming,” inInformal Proceedings of the Fourth International Workshop on Programming Languages for Quantum Computing (PLanQC ’24), 2024. [Online]. Available: https://github.com/quantinuum/guppylang

  9. [9]

    Demonstration of logical qubits and repeated error correction with better-than-physical error rates,

    A. Paetznick, M. P. da Silva, C. Ryan-Anderson, J. M. Bello-Rivas, J. P. Campora III, A. Chernoguzov, J. M. Dreiling, C. Foltz, F. Frachon, J. P. Gaebleret al., “Demonstration of logical qubits and repeated error correction with better-than-physical error rates,” 2024

  10. [10]

    Demonstration of quantum computation and error correction with a tesseract code,

    B. W. Reichardt, D. Aasen, R. Chao, A. Chernoguzov, W. van Dam, J. P. Gaebler, D. Gresh, D. Lucchetti, M. Matheny, A. Munsonet al., “Demonstration of quantum computation and error correction with a tesseract code,” 2024

  11. [11]

    Fault-tolerant quantum computation with a neutral atom processor,

    B. W. Reichardt, A. Paetznick, D. Aasen, I. Basov, J. M. Bello-Rivas, P. Bonderson, R. Chao, W. van Dam, M. B. Hastings, A. Pazet al., “Fault-tolerant quantum computation with a neutral atom processor,” 2024

  12. [12]

    A race-track trapped-ion quantum processor,

    S. A. Moses, C. H. Baldwin, M. S. Allman, R. Ancona, L. Ascarrunz, C. Barnes, J. Bartolotta, B. Bjork, P. Blanchard, M. Bohnet al., “A race-track trapped-ion quantum processor,”Physical Review X, vol. 13, no. 4, p. 041052, 2023

  13. [13]

    Logical quantum processor based on reconfigurable atom arrays,

    D. Bluvstein, S. J. Evered, A. A. Geim, S. H. Li, H. Zhou, T. Manovitz, S. Ebadi, M. Cain, M. Kalinowski, D. Hangleiteret al., “Logical quantum processor based on reconfigurable atom arrays,”Nature, vol. 626, no. 7997, pp. 58–65, 2024

  14. [14]

    Topological quantum memory,

    E. Dennis, A. Kitaev, A. Landahl, and J. Preskill, “Topological quantum memory,”Journal of Mathematical Physics, vol. 43, no. 9, pp. 4452– 4505, 2002

  15. [15]

    Pymatching: A python package for decoding quantum codes with minimum-weight perfect matching,

    O. Higgott, “Pymatching: A python package for decoding quantum codes with minimum-weight perfect matching,”ACM Transactions on Quantum Computing, vol. 3, no. 3, pp. 1–16, 2022

  16. [16]

    Pyquil documentation,

    Rigetti Computing, “Pyquil documentation,” https://pyquil-docs.rigetti. com/en/stable/, 2023, accessed: June 29, 2025

  17. [17]

    Qunity: A unified language for quantum and classical computing,

    F. V oichick, L. Li, R. Rand, and M. Hicks, “Qunity: A unified language for quantum and classical computing,”Proceedings of the ACM on Programming Languages, vol. 7, no. POPL, pp. 921–951, 2023

  18. [18]

    Stim: a fast stabilizer circuit simulator,

    C. Gidney, “Stim: a fast stabilizer circuit simulator,”Quantum, vol. 5, p. 497, Jul. 2021. [Online]. Available: https://doi.org/10.22331/ q-2021-07-06-497

  19. [19]

    Qiskit qec: Quantum error correction frame- work,

    Qiskit Community, “Qiskit qec: Quantum error correction frame- work,” GitHub repository, 2025, https://github.com/qiskit-community/ qiskit-qec

  20. [20]

    Litinski

    D. Litinski, “A Game of Surface Codes: Large-Scale Quantum Computing with Lattice Surgery,”Quantum, vol. 3, p. 128, Mar. 2019. [Online]. Available: https://doi.org/10.22331/q-2019-03-05-128