TopoLS: Lattice Surgery Compilation via Topological Program Transformations

arXiv:2601.23109 · quant-ph · Submitted 2026-01-30 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Quantum Radio. Generated commentary on the latest quantum physics and condensed matter papers.

Kai: I'm Kai.

Mira: And I'm Mira, here with Lev.

Kai: We're looking at the paper: "TopoLS: Lattice Surgery Compilation via Topological Program Transformations".

Title and authors: Kai: So we're looking at this paper, "TopoLS: Lattice Surgery Compilation via Topological Program Transformations," and it’s by Zhou, Liu, Decker, Kalloor, Weiden, Chen, Iancu and Li. It sounds like they are tackling a big problem in surface code quantum computing where you need to implement these fault-tolerant logical operations.

Mira: Yeah it really does sound like they're shifting the focus from just gate sequences to the underlying topology of the circuit. The title itself tells you they are using topological program transformations, which is a big shift for how we think about compiling these things.

Lev: From an engineering standpoint, I wonder if using ZX diagrams as an intermediate representation makes sense because existing compilers are so circuit-centric and that's where the bottleneck is for real hardware.

Kai: Exactly Lev, because those existing tools operate directly on gate sequences, which limits their ability to exploit the topological flexibility of merge-split operations and minimize space time volume.

Mira: So they’re proposing a new way to look at this problem that lets them use ZX diagrams instead of just the gates themselves for the compilation process.

Lev: And what's interesting is that they are focusing on minimizing space time volume, which is a primary objective in fault-tolerant quantum computation.

Kai: Right, and they identify three key challenges when compiling and optimizing lattice surgery programs on the surface code list: the representation challenge, the layout synthesis challenge, and the scalability challenge.

Mira: That sounds like a comprehensive approach to solving what used to be a very hard combinatorial optimization problem for layout synthesis.

Lev: The main thing I'm hearing is that they are trying to make sure this doesn't just work on small circuits but can actually handle large programs efficiently without the search space exploding.

The paper's summary: Kai: So what TopoLS actually does, based on the summary, is present a topology-centric compiler that uses ZX diagrams as an intermediate representation to enable topological program transformations. It basically takes those complex lattice surgery programs and simplifies them using things like spider fusion and topology-aware slicing.

Mira: That means they are using the ZX calculus formalism to expose the topological structure of the program, which is inherently what lattice surgery is all about, rather than treating it as a simple sequence of gates.

Lev: So the process isn't just one step; it’s an integrated framework that combines those ZX-level transformations with MCTS-based three dee layout synthesis that jointly optimizes placement and routing in space time <ref:2601.23109#pg1>.

Kai: That integration is key, because they are not just transforming the program structure; they are actively optimizing where things go in three dimensional space time to minimize the resulting pipe diagram's volume.

Mira: And what makes this framework scalable is that they introduce topology-aware partitioning techniques that bound the routing frontier during compilation, which helps them synthesize large lattice surgery programs.

Lev: So, the summary points to a multi-stage workflow: first transforming at the ZX level, then constructing and optimizing in three dee space time using Monte Carlo Tree Search <ref:2601.23109#pg1>.

Kai: It sounds like they are trying to solve the representation problem by using topology-aware slicing for parallel execution right there in that first step.

The paper's improvements: Mira: One of the main improvements they highlight is this integrated compilation framework, combining ZX-level transformations with MCTS-based three dee layout synthesis to jointly optimize placement and routing in space time <ref:2601.23109#pg1>.

Lev: That joint optimization of placement and routing in three dimensional space time sounds like it directly tackles the layout synthesis challenge by finding layouts with smaller space time volume.

Kai: They also introduce topology-aware partitioning techniques that decompose large ZX diagrams into bounded subproblems based on connectivity structure, which is what limits the routing frontier during compilation.

Mira: That partitioning idea addresses the scalability challenge directly because it prevents the search space from growing exponentially when dealing with very large programs.

Lev: And they claim substantial reductions in space time volume, specifically an average of forty-six percent improvement across different hardware configurations and strong empirical scalability across benchmark algorithms.

Kai: So, to summarize the improvements, they’ve got better ways to represent the program topologically, a joint search for layout optimization in space time, and partitioning to keep it scalable.

Conclusion: Kai: So we’re wrapping up on this TopoLS paper. The implication is that using ZX diagrams as an intermediate representation can expose the topological structure needed for better compilations and layout synthesis, which is a huge step for implementing lattice surgery operations efficiently.

Mira: It seems like they are providing a practical tool, publicly available in the TQEC ecosystem, that moves us closer to compiling these complex quantum programs without getting stuck in purely circuit-centric methods.

Lev: For me it’s about the empirical scalability; they show near linear growth in compilation time with respect to circuit size on large benchmark families, which is what you need when you actually try to run this on real hardware.

Kai: Exactly, and they prove correctness by showing that the ZX diagram induced by the pipe diagram implements the same linear map as the original circuit.

Mira: So it’s a solid piece of work that combines topological reasoning with search-based layout synthesis to make quantum program execution more efficient for surface code systems.

Lev: It gives us a path forward on how to tackle those large programs that are currently intractable with SAT-based formulations, which is what really matters for moving toward actual hardware.

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor, Mathias Weiden, Kean Chen, Costin Iancu, Gushu Li

University of Pennsylvania · Lawrence Berkeley National Laboratory

quant-ph

Submitted: 2026-01-30

Updated: 2026-11-22

Code: https://github.com/tqec/TopoLS

License: http://creativecommons.org/licenses/by-nc-nd/4.0/

Importance score: 100/100

The gist: Lattice surgery is a leading approach for implementing faulttolerant logical operations in surface code quantum computing…

Key concepts

Lattice Surgery
This is a leading method for implementing fault-tolerant logical operations in surface code quantum computing. It involves breaking down complex logical gates into simpler, manageable pieces that can be implemented on the physical lattice structure.
ZX Diagram
This is the specific intermediate representation used by TopoLS. It's a topological way to describe quantum circuits, focusing on the connectivity and structure of the operations rather than just sequential gates, which helps in identifying inherent topological properties.
MCTS-Based Embedding Search
This is a search method used during layout synthesis. MCTS incrementally builds the final 3D pipe diagram by exploring possible placements and routings. It guides the search toward layouts that minimize the space-time volume, which represents how much physical area and time are needed for the circuit.
Topology-Aware Partitioning
This technique breaks down very large quantum programs into smaller, manageable subproblems based on their connectivity structure. This limits the search space during layout construction, preventing the problem from becoming computationally impossible for large circuits.

Terminology

Summary

Lattice surgery is a leading approach for implementing faulttolerant logical operations in surface code quantum computing, but compiling efficient lattice surgery layouts remains challenging. p. 0

Where the paper says it

gov Gushu Li University of Pennsylvania Philadelphia, USA gushuli@seas. edu Abstract Lattice surgery is a leading approach for implementing faulttolerant logical operations in surface code quantum computing, but compiling efficient lattice surgery layouts remains challenging.

<ref:2601.23109#pg1>. TopoLS presents a topology-centric compiler that uses ZX diagrams as an intermediate representation for lattice surgery compilation. p. 0
Where the paper says it

Existing compilers are largely circuit-centric and operate directly on gate sequences, limiting their ability to exploit the topological flexibility of merge-split operations and minimize space–time volume. We present TopoLS, a topology-centric compiler that uses ZX diagrams as an intermediate representation for lattice surgery compilation.

<ref:2601.23109#pg4>.

The core problem addressed

The paper identifies three key challenges in compiling and optimizing the lattice surgery program on the surface code list.<ref:2601.23109#pg5>. These challenges include:

  1. Representation Challenge: Lattice surgery is inherently topological, and existing compilers remain largely circuit-centric. p. 1

    Where the paper says it

    However, existing compiler frameworks remain largely circuit-centric [33, 46], and ZX-based approaches have primarily been used for analysis rather than as a practical intermediate representation for scalable compilation and optimization. As a result, current compilers do not fully exploit the flexibility of topological rewrites to reduce space–time volume.

    <ref:2601.23109#pg5>.

  2. Layout Synthesis Challenge: Constructing an efficient lattice surgery layout is a high-dimensional combinatorial optimization problem. p. 1

    Where the paper says it

    Second, Layout Synthesis Challenge. Given a topological description, constructing an efficient lattice surgery layout is a high-dimensional combinatorial optimization problem.

    <ref:2601.23109#pg5>.

  3. Scalability Challenge: The compiler must remain efficient for large programs, as naive exploration leads to exponential growth. p. 1

    Where the paper says it

    The compiler must remain efficient for large programs. Naively exploring the full embedding space leads to exponential growth, while overly restrictive heuristics sacrifice optimization quality.

    <ref:2601.23109#pg5>.

The TopoLS methodology

TopoLS addresses these challenges through an integrated design that combines topological reasoning, search-based layout synthesis, and scalability-aware decomposition.<ref:2601.23109#pg5>. The workflow involves two main stages:

  1. ZX-level Program Transformation: This step simplifies the structure by performing spider fusion and topology-aware slicing on the ZX diagram IR. p. 0

    Where the paper says it

    We present TopoLS, a topology-centric compiler that uses ZX diagrams as an intermediate representation for lattice surgery compilation. TopoLS combines semantic-preserving ZX-level program transformations, including spider fusion and topology-aware slicing, with a Monte Carlo Tree Search (MCTS)-based synthesis procedure that constructs pipe-diagram embeddings by jointly optimizing placement and routing in 3D space– time.

    <ref:2601.23109#pg8>. Spider fusion preserves semantics, as shown by Proposition 4. p. 8
    Where the paper says it

    Topological optimization via ZX representation Proof. The spider fusion rule is a sound rewrite rule of ZXcalculus that preserves the linear map semantics of ZX diagrams [7].

    1.<ref:2601.23109#pg8>.

  2. ZX-to-Pipe Construction and Optimization: This stage uses a Monte Carlo Tree Search (MCTS)-based synthesis framework to construct pipe diagrams by jointly optimizing placement and routing in 3D space–time. p. 0

    Where the paper says it

    We present TopoLS, a topology-centric compiler that uses ZX diagrams as an intermediate representation for lattice surgery compilation. TopoLS combines semantic-preserving ZX-level program transformations, including spider fusion and topology-aware slicing, with a Monte Carlo Tree Search (MCTS)-based synthesis procedure that constructs pipe-diagram embeddings by jointly optimizing placement and routing in 3D space– time.

    <ref:2601.23109#pg9>.

Optimization techniques employed

The optimization process utilizes several advanced techniques to minimize the space–time volume of the resulting pipe diagram.<ref:2601.23109#pg5>. Key ideas include:

**)& **

Idea 1: Deriving an Execution Structure via ZX-Level Transformation: This involves simplifying the ZX diagram through spider fusion and deriving an execution structure using layer slicing based on graph connectivity.<ref:2601.23109#pg9>.

Idea 2: MCTS-Based Embedding Search: MCTS is used to incrementally construct pipe diagrams, guiding the search toward layouts with smaller space–time volume by defining the reward as the negative space–time volume.<ref:2601.23109#pg11>.

Idea 3: Topology-Aware Circuit Partitioning: This technique decomposes large ZX diagrams into bounded subproblems based on connectivity structure to limit the routing frontier and ensure scalability.<ref:2601.23109#pg5>.

Performance and correctness validation

TopoLS achieves an average 46% reduction in space–time volume over prior circuit-centric compilers across evaluated benchmarks.<ref:2601.23109#pg8>. The compilation time exhibits near-linear growth with circuit size, demonstrating strong empirical scalability. p. 1

Where the paper says it

These gains remain consistent across the hardware configurations we study, with 35% to 38% reductions observed on grids of varying shapes and sizes. In addition, TopoLS shows strong empirical scalability: on the evaluated benchmark families, compilation time exhibits near-linear growth with circuit size.

<ref:2601.23109#pg8>. The correctness of the compilation is formally proven by showing that the ZX diagram induced by the pipe diagram implements the same linear map as the original circuit. p. 7
Where the paper says it

Here𝑉 (𝑃) denotes the space–time volume of pipe diagram 𝑃, measured as the volume of the bounding box enclosing all cubes in 𝑃. The first constraint enforces semantic correctness by requiring that the ZX diagram induced by the pipe diagram implements the same linear map as the ZX representation of the input circuit.

<ref:2601.23109#pg13>.

Hardware and scalability analysis

The paper evaluates TopoLS across different hardware structures, including 6×3 grid, 8×2 grid, and linear 16×1 grid.<ref:2601.23109#pg8>. The topology-aware partitioning method is designed to bound the number of placeholder ports by the number of logical qubits, preventing the embedding space from growing unboundedly. p. 1

Where the paper says it

This search-based formulation enables the compiler to jointly optimize spatial and temporal resources, capturing cross-layer tradeoffs that directly impact space–time volume. Third, to ensure scalability, we further develop topology-aware partitioning techniques that decompose large ZX diagrams into bounded subproblems based on their connectivity structure, effectively limiting the size of the routing frontier in each stage of compilation and preventing the search space from growing unboundedly.

<ref:2601.23109#pg5>. This strategy allows TopoLS to remain practical for large circuits where SAT-based formulations become intractable. p. 0
Where the paper says it

Across evaluated benchmarks, TopoLS achieves an average 46% reduction in space–time volume over prior circuit-centric compilers, with improvements ranging from 25% to 90%, and exhibits strong empirical scalability on large benchmark families. Compared with SAT-based formulations that become intractable on larger instances, TopoLS offers a practical end-to-end solution for optimized lattice surgery compilation.

<ref:2601.23109#pg8>.

Evaluation against baselines

The results show that TopoLS consistently reduces space–time volume and compilation time compared to state-of-the-art baselines.<ref:2601.23109#pg8>. For instance, on the sparse layout configuration, TopoLS achieves an average reduction of 73% in space–time volume for the Bernstein-Vazirani benchmark. p. 0

Where the paper says it

To scale to large circuits, TopoLS further introduces topology-aware partitioning that decomposes the compilation task into bounded subproblems and limits the routing frontier during embedding. Across evaluated benchmarks, TopoLS achieves an average 46% reduction in space–time volume over prior circuit-centric compilers, with improvements ranging from 25% to 90%, and exhibits strong empirical scalability on large benchmark families.

<ref:2601.23109#pg15>. The compilation time increases nearlinearly with system size. p. 1
Where the paper says it

This search-based formulation enables the compiler to jointly optimize spatial and temporal resources, capturing cross-layer tradeoffs that directly impact space–time volume. Third, to ensure scalability, we further develop topology-aware partitioning techniques that decompose large ZX diagrams into bounded subproblems based on their connectivity structure, effectively limiting the size of the routing frontier in each stage of compilation and preventing the search space from growing unboundedly.

<ref:2601.23109#pg8>.

Conclusion on impact

TopoLS demonstrates the potential of topology-centric compilation for improving the efficiency of fault-tolerant quantum program execution by leveraging ZX diagrams to expose topological structure and combining them with MCTS for optimized 3D embedding.<ref:2601.23109#pg8>. The tool is publicly available in the TQEC ecosystem. p. 0

Where the paper says it

Compared with SAT-based formulations that become intractable on larger instances, TopoLS offers a practical end-to-end solution for optimized lattice surgery compilation. TopoLS has been integrated into the TQEC ecosystem, enabling downstream circuit-level simulation and resource estimation workflows.

<ref:2601.23109#pg9>.

--- Page 1 ---

TopoLS: Lattice Surgery Compilation via Topological Program Transformations

Junyu Zhou

University of Pennsylvania

Philadelphia, USA

junyuzh@seas.upenn.edu

Yuhao Liu

University of Pennsylvania

Philadelphia, USA

liuyuhao@seas.upenn.edu

--- Page 2 ---

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor, Mathias Weiden, Kean Chen, Costin Iancu, and Gushu Li

IR Construction TopoLS: Topology-Centric Compilation

ZX-Level Program Transformation

ZX-to-Pipe Construction

1 &!

&"

--- Page 3 ---

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor, Mathias Weiden, Kean Chen, Costin Iancu, and Gushu Li

--- Page 4 ---

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

Data qubit Ancilla qubit

Figure 2. Logical qubit and patch abstraction. p. 2

Where the paper says it

TopoLS: Lattice Surgery Compilation via Topological Program Transformations 1 2 3 A 4 5 6 Abstract 7 8 9 Data qubit Ancilla qubit Figure 2. Logical qubit and patch abstraction The major contributions of this paper can be summarized as follows: 1.

--- Page 5 ---

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

TopoLS: Lattice Surgery Compilation via Topological Program Transformations

Abstract

--- Page 6 ---

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

TopoLS: Lattice Surgery Compilation via Topological Program Transformations

  1. ZX Simplification

  2. Layer Slicing for Parallel Execution

--- Page 7 ---

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

Section 4.1

--- Page 8 ---

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

Section 4.2

--- Page 9 ---

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

Section 5

--- Page 10 ---

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

Figure 18. Expansion example

--- Page 11 ---

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

Section 4.3

--- Page 12 ---

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

Figure 20. Circuit partition example

--- Page 13 ---

TopoLS: Lattice Surgery Compilation via Topological Program Transformations

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

Table 4. Compilation results for two benchmarks of various sizes. p. 1

Where the paper says it

Across evaluated benchmarks, TopoLS achieves an average 46% reduction in space–time volume over state-of-the-art baselines [33, 46], with improvements ranging from 25% to 90%. These gains remain consistent across the hardware configurations we study, with 35% to 38% reductions observed on grids of varying shapes and sizes.

--- Page 14 ---

TopoLS: Lattice Surgery Compilation via Topological Program Transformations

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

Table 5. Comparison with LaSsynth

--- Page 15 ---

TopoLS: Lattice Surgery Compilation via Topological Program Transformations

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

Table 3. Compilation results under different hardware structures. p. 2

Where the paper says it

We introduce topology-aware partitioning techniques that bound the routing frontier during compilation, enabling scalable synthesis of large lattice surgery programs. We demonstrate that TopoLS achieves substantial reductions in space–time volume (46% on average), with consistent improvements across different hardware configurations and strong empirical scalability across benchmark algorithms.

--- Page 16 ---

--- Page 17 ---

TopoLS: Lattice Surgery Compilation via Topological Program Transformations

Junyu Zhou, Yuhao Liu, Ethan Decker, Justin Kalloor

Table 5.

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. The AI system can perform efficient compilation of lattice surgery layouts by using ZX diagrams as an intermediate representation to expose topological structure, which allows for semantic-preserving transformations like spider fusion and topology-aware slicing.

  2. The system can construct pipe diagrams with minimized space time volume by combining ZX-level transformations with a Monte Carlo Tree Search based 3D embedding procedure that jointly optimizes placement and routing in 3D space time.

  3. The AI system can scale to large circuits by introducing topology aware partitioning techniques that decompose the compilation task into bounded subproblems, effectively limiting the routing frontier during embedding to prevent exponential growth of the search space.

  4. The system can achieve near linear growth in compilation time with respect to circuit size on large benchmark families due to a combination of ZX-level optimization and topology aware partitioning, demonstrating strong empirical scalability.

Abstract

Lattice surgery is a leading approach for implementing fault-tolerant logical operations in surface code quantum computing. Current compilers largely treat lattice surgery as a layout problem downstream of a gate-level circuit; this circuit-centric view hinders a substantial optimization opportunity: lattice surgery computations are topological programs whose semantics are determined by connectivity, so different concrete space-time realizations may implement the same computation while offering different space-time volumes. Circuit-centric compilers, however, commit to fixed realizations throughout the program. We tackle this problem by presenting TopoLS, a topology-centric compiler that uses ZX diagrams as the intermediate representation (IR) for automated lattice surgery compilation. Compiler transformations on this graph preserve its semantics, and the backend must produce a valid pipe diagram, i.e., a 3D space-time layout of the lattice surgery program, with the same semantics. TopoLS first simplifies the graph and slices it into layers, and then uses Monte Carlo Tree Search to place the graph's nodes as cubes in a 3D grid and to route its edges as pipes. To scale to large circuits, TopoLS partitions the graph so that each search step routes a bounded number of connections. Across evaluated benchmarks, TopoLS reduces space-time volume by 46% on average over prior circuit-centric compilers, with improvements ranging from 25% to 90%, while exhibiting strong empirical scalability on large benchmark families.

Sources

Related papers