QCHackers / tqec

Design automation software tools for Topological Quantum Error Correction
https://qchackers.github.io/tqec/
Apache License 2.0
74 stars 19 forks source link

Integrate `tqec` with `LaSsynth` #315

Open inmzhang opened 2 months ago

inmzhang commented 2 months ago

Is your feature request related to a problem? Please describe.

What is LaSsynth?

LaSsynth is a synthesis for lattice surgery subroutines. After specifying the desired inputs/outputs ports and the stabilizer flows, it will use a SAT solver to solve the internal structure of the lattice surgery construction under limited spacetime volume. You can take a look at this demo to learn more about it.

Why is it useful for tqec?

  1. LaSsynth provides a way to automatically construct a valid spacetime model but can not run simulations for it. Then it's natural to take the output of LaSsynth as the input of tqec to run and verify the construction at the circuit level.
  2. LaSsynth provides a text format representation(LaSre) of the spacetime model and it can be taken as a starting point for the design of a portable text format of tqec computation structure.
  3. LaSsynth provides the functionality to convert a LaSre file to a .gltf model and visualized the model as well as the correlation surfaces.
  4. LaSsynth provides the functionality to convert a LaSre file to the corresponding zx diagrams(using stimzx) representation and verify the the stabilizer flows.

How it can be used with tqec?

LaSsynth provides a representation of the Lattice Surgery subroutine in a text format called LaSre.

LaSre of CNOT 图片

It can be seen as a complete description of the structure of a 3D spacetime model or our BlockGraph. To be more specific:

As above, the one-to-one translation between LaSre and BlockGraph should be possible.

Limitations

To integrate the two libraries, there are some problems that we need to solve in my mind:

nelimee commented 2 months ago

I agree that this would be a very sensible and interesting addition. It might be too soon though. In my opinion, here are the steps we should focus on right now:

  1. Have a fully working logical CNOT computation. This has been our main goal since the beginning, we are very close now, so we should prioritize as much as possible that goal.
  2. Clean up the code, removing/simplifying/refactoring everything to have a clean code base that can still output a fully functional CNOT. This includes (non-exhaustive):
    • Template refactoring,
    • A huge documentation and testing improvement,
    • Removing now useless code,
  3. Implement new features with the stabilized and cleaned-up code base.

I think this feature is 1) not needed for the completion of our first goal and 2) can wait until we finished cleaning up the codebase. An argument for implementing that now (instead of waiting) is that this feature is, at its core, "just" a translator from LaSre to BlockGraph, which only requires the API to create a BlockGraph instance (i.e., a small portion of the API) and so might not be impacted too much by a refactor. Any opinion?

inmzhang commented 2 months ago

Yes this should not be a goal for the near term and I should note that in the first place. I had conversation with Austin about LaSsynth some times ago but forgot to write it up as an issue... And I do think it won't take too much work to implement this feature after finalizing and refactoring our library.

afowler commented 2 months ago

Would be great to get you to review the current status of this tool in a future meeting.

On Tue, Sep 3, 2024 at 12:27 AM Yiming Zhang @.***> wrote:

Yes this should not be a goal for the near term and I should note that in the first place. I had conversation with Austin about LaSsynth some times ago but forgot to write it up as an issue... And I do think it won't take too much work to implement this feature after finalizing and refactoring our library.

— Reply to this email directly, view it on GitHub https://github.com/QCHackers/tqec/issues/315#issuecomment-2325791640, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKAXTF4ZMFE7SV63K4VI33ZUVQH7AVCNFSM6AAAAABNRFITYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRVG44TCNRUGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>