Skip to content

Commit

Permalink
updates for LaSSynth (#770)
Browse files Browse the repository at this point in the history
- Cleaned up code and added comments.
- Adapt to finalized naming in the paper. README and demo notebook also
updated.
- Fixed issue of missing faces when generated GLTF is opened in other
software. Now every face is actually two back-to-back sides both
providing color. User can also opt in to add the IJK axes in the gltf.
- Unified a lot of code in the textfig, zigxag, and graph generator to
Stim ZX. These three now are all based on `ZXGridGraph`.

---------

Co-authored-by: Daniel Tan <[email protected]>
  • Loading branch information
qu-tan-um and Daniel Tan authored May 18, 2024
1 parent 5d7debe commit cdda750
Show file tree
Hide file tree
Showing 37 changed files with 6,409 additions and 7,045 deletions.
9 changes: 0 additions & 9 deletions glue/lattice_surgery/.gitignore

This file was deleted.

40 changes: 34 additions & 6 deletions glue/lattice_surgery/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
# Optimal Lattice Surgery Subroutine Compiler (OLSSCo)
# Lattice Surgery Subroutine Synthesizer (LaSsynth)
A lattice surgery subroutine (LaS) is a confined volume with a set of ports.
Within this volume, lattice surgery merges and splits are performed.
The function of a LaS is characterized by a set of stabilizers on these ports.

## installation
In this directory `pip install .` This will also install a few packages that we need: 3 packaes from pypi `z3-solver`, `networkx`, and `stim`; 1 package from included files `stimzx` [(source)](https://github.com/quantumlib/Stim/tree/0fdddef863cfe777f3f2086a092ba99785725c07/glue/zx).
The lattice surgery subroutine synthesizer (LaSsynth) uses SAT/SMT solvers to synthesize LaS given the volume, the ports, and the stabilizers.
LaSsynth outputs a textual representation of LaS (LaSRe) which is a JSON file with filename extension `.lasre`.
LaSsynth can also generate 3D modelling files in the [GLTF](https://www.khronos.org/gltf/) format from LaSRe files.

The main ideas of this project is provided in the paper [A SAT Scalpel for Lattice Surgery](http://arxiv.org/abs/2404.18369) by Tan, Niu, and Gidney.
For files specific to the paper, please refer to [its Zenodo archive](https://zenodo.org/doi/10.5281/zenodo.11051465).

## Installation
It is recommended to create a virtual Python environment. Once inside the environment, in this directory, `pip install .`
Apart from LaSsynth, this will install a few packages that we need:
- `z3-solver` version `4.12.1.0`, from pip
- `networkx` default version, from pip
- `stim` default version, from pip
- `stimzx` from files included in sirectory `./stimzx/`. We copied these files from [here](https://github.com/quantumlib/Stim/tree/0fdddef863cfe777f3f2086a092ba99785725c07/glue/zx).
- `ipykernel` default version, from pip, to view the demo Jupyter notebook.

We have a dependency [kissat](https://github.com/arminbiere/kissat) which is a SAT solver, not a Python package.
It is recommended to install it and find out the directory of the executable `kissat` because we will need it later.
Our compiler can be used without Kissat, in which case it just uses `z3-solver`, but on certain cases Kissat can offer big runtime improvements.
LaSsynth can be used without Kissat, in which case it just uses `z3-solver`, but on certain cases Kissat can offer big runtime improvements.

## How to use
See the [demo notebook in the docs directory](docs/demo.ipynb)

## how to use
See the [demo notebook in the docs directory](docs/demo.ipynb)
## Cite this work
```bibtex
@inproceedings{tan-niu-gidney_lattice_surgery,
author = {Tan, Daniel Bochen and Niu, Murphy Yuezhen and Gidney, Craig},
title = {A {SAT} Scalpel for Lattice Surgery: Representation and Synthesis of Subroutines for Surface-Code Fault-Tolerant Quantum Computing},
shorttitle = {A {SAT} Scalpel for Lattice Surgery},
booktitle = {2024 ACM/IEEE 51st Annual International Symposium on Computer Architecture ({ISCA})},
year = {2024},
url = {http://arxiv.org/abs/2404.18369},
}
```
729 changes: 263 additions & 466 deletions glue/lattice_surgery/docs/demo.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions glue/lattice_surgery/lassynth/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .lattice_surgery_synthesis import LatticeSurgerySynthesizer
from .lattice_surgery_synthesis import LatticeSurgerySolution
Loading

0 comments on commit cdda750

Please sign in to comment.