RapunSL: Untangling Quantum Computing with Separation, Linear Combination and Mixing

Yusuke Matsushita, Kengo Hirata, Ryo Wakizaka, Emanuele D'Osualdo

TL;DR

RapunSL is a groundbreaking quantum separation logic that makes verifying quantum programs much easier by breaking them down into "local" pieces. By introducing new ways to reason about superpositions and measurement outcomes as if they were independent resources, it allows researchers to formally prove the correctness of complex systems like the 9-qubit Shor error-correcting code without drowning in mathematical complexity.

What Problem Does This Paper Address?

Formal verification—the act of mathematically proving a program does exactly what it's supposed to—is notoriously difficult in the quantum world. Quantum states are "global" by nature; thanks to entanglement, changing one qubit can affect the entire system.

Traditional "Separation Logic" works great for classical computers because it lets you reason about one piece of memory at a time (the "heap"). However, quantum computing introduces two massive hurdles that classical logic can't handle:

  1. Superposition: A qubit isn't just 0 or 1; it's a linear combination of both.
  2. Measurement: Measuring a qubit causes the state to "collapse" into a probabilistic mixture of outcomes.

Previous quantum logics either struggled to scale or had to throw away "global phase" information, which made it impossible to use simple "linearity" arguments (e.g., "if it works for $|0\rangle$ and $|1\rangle$, it works for their sum").

Methods

The authors introduce RapunSL, a logic built on three distinct "locality" principles:

  • Entanglement-locality: Using the standard "separating conjunction" ($*$) to reason about qubits that aren't entangled with each other.
  • Basis-locality: A new approach that allows a programmer to prove a property for simple basis states (like $|0\rangle$ and $|1\rangle$) and then automatically "lift" that proof to any superposition using a new sum connective ($+$).
  • Outcome-locality: A way to handle measurements by treating each possible result as a separate branch in a mixing connective ($\oplus$).

Crucially, RapunSL tracks global phase. While global phase is physically unobservable in a final measurement, it is mathematically essential for "basis-locality" to work. To support this, the authors modeled quantum states as multisets of outcomes, allowing the logic to track probabilities and states across complex branching paths.

Datasets

As a theoretical paper in formal methods, RapunSL does not use traditional training datasets. Instead, its "evaluation" consists of rigorous formal proofs for a suite of challenging quantum "case studies" that serve as benchmarks in the field:

  • Dirty Qubits: Implementing a CCCX (triple-controlled NOT) gate using an auxiliary qubit in an unknown state.
  • Quantum Teleportation: Verifying the protocol that moves quantum information using entanglement and classical bits.
  • Lattice Surgery: Verifying a CNOT gate implementation that relies on 2-qubit measurements (common in fault-tolerant architectures).
  • Error Correction: Verifying the 3-qubit Bit-Flip code and the complex 9-qubit Shor Code.

Key Insights and Ideas

  • The "Linearity" Breakthrough: The authors realized that measurement isn't an "anti-linear" wall. By using the mixing connective, they show that a program remains linear on each outcome. This allows the hoare-sum rule to function even when measurements are involved.
  • Phase Matters for Modularity: Most quantum logics ignore global phase because "it doesn't affect measurement." RapunSL shows that if you want modularity (the ability to reuse proofs), you must track the phase, or your "sums" won't add up correctly.
  • Frameability: They identified a specific class of "well-behaved" assertions (called frameable) that can be easily moved in and out of logical "frames." This significantly simplifies the complexity of proofs for engineers.

Key Results

The paper demonstrates a dramatic improvement in the scalability of manual quantum proofs:

  • The Shor Code Success: They successfully verified the 9-qubit Shor code. In a standard mathematical model, this involves a 512-dimensional vector space ($2^9$). RapunSL reduces this to a series of small, local proofs that are manageable for a human to write.
  • Context-Independence: They proved that a "dirty qubit" implementation of a gate works regardless of what the rest of the computer is doing, a feat previous logics struggled to achieve when the dirty qubit was entangled with the input.
  • Probabilistic Total Correctness: The logic can prove not just that a program is correct if it finishes, but the exact probability that it will finish (almost-sure termination).

Limitations and Future Work

  • Automation: Currently, RapunSL is a "pen-and-paper" logic. While the authors outline how it could be automated (using tools like AutoQ 2.0), a fully automated solver does not yet exist.
  • Mechanization: The proofs have not yet been encoded into a proof assistant like Coq or Isabelle, which would provide the highest level of "machine-checked" certainty.
  • Relational Reasoning: The current version is "unary" (reasoning about one program). The authors suggest extending it to "relational" logic to compare two different programs (e.g., proving an optimized circuit is equivalent to a simple one).

Summary updated

BibTeX
@inproceedings{matsushita2026rapunsl,
  author = {Yusuke Matsushita and Kengo Hirata and Ryo Wakizaka and Emanuele D'Osualdo},
  title = {{RapunSL: Untangling Quantum Computing with Separation, Linear Combination and Mixing}},
  booktitle = {Proceedings of the ACM on Programming Languages},
  year = {2026},
  url = {https://openreview.net/forum?id=3M9qknS43S},
}
Figure