-
Notifications
You must be signed in to change notification settings - Fork 25
Lattice Surgery Compilation #388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…rstdw) and first mypy adjustments
## Description This PR removes the C++ part of the package since it is no longer actively developed, and its features have largely been replaced by other libraries. In particular, this removes the following features: - C++ implementation of the union-find QLDPC decoder. [ldpc](https://github.com/quantumgizmos/ldpc) is actively maintained and developed for a dedicated package. - Applying error correction to quantum circuits. This functionality is mostly deprecated, not actively developed and no future work is planned. This also removes the necessary CI. This PR also updates the documentation to use `myst` and builds the Python documentation using [sphinx autodoc](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#module-sphinx.ext.autodoc). ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines. --------- Signed-off-by: burgholzer <burgholzer@me.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: burgholzer <burgholzer@me.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so I finished my review until snake_builder.py. Since this is quite a large contribution I would give you the first chunk already and look at the rest later. If some of my questions are resolved by looking at the rest of the code then just ignore them.
The code looks good to me, I just added some suggestions, comments and questions where I thought some things could be improved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are both the rst and the md file in the docs now. I guess the rst file can be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle yes. The rst file is just used as intermediate solution as long as this branch is not merged into main. However, the main branch's readme currently links to this rst file, which is why I would like to keep it for now. I would delete it as soon as we merge my branch into main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I'll leave this comment open until that time so we don't forget.
| def compatible_x_stabs() -> list[dict[str, list[int]]]: | ||
| """Returns the allowed Weight 8 X Stabilizers crossing Steane patches.""" | ||
| return [ | ||
| {"i": [0, 2, 4, 6], "i+1": [0, 2, 4, 6]}, | ||
| {"i": [3, 4, 5, 6], "i+1": [1, 2, 5, 6]}, | ||
| {"i": [3, 4, 5, 6], "i+1": [0, 2, 4, 6]}, | ||
| {"i": [1, 2, 5, 6], "i+1": [1, 2, 5, 6]}, | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have to be a list of dicts instead of a list of tuples?
| @staticmethod | ||
| def compatible_z_stabs_weight_two() -> list[dict[str, int]]: | ||
| """Returns allowed weight-2 z stabilizer connections.""" | ||
| return [ | ||
| {"i": 1, "i+1": 1}, | ||
| {"i": 0, "i+1": 0}, | ||
| {"i": 3, "i+1": 1}, | ||
| {"i": 1, "i+1": 3}, | ||
| {"i": 3, "i+1": 0}, | ||
| {"i": 0, "i+1": 3}, | ||
| {"i": 1, "i+1": 0}, | ||
| {"i": 0, "i+1": 1}, | ||
| ] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
|
|
||
| return None | ||
|
|
||
| def translate_checks(self) -> tuple[list[list[int]], list[list[int]]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some inconsistency here. We have gen_checks, gen_check_matrix and translate_checks in the different classes, respectively.
Also is there a reason these are lists instead of numpy arrays?
| plt.show() | ||
|
|
||
|
|
||
| def convex_hull(points: list[tuple[float, float]]) -> list[tuple[float, float]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity: Is this a version of the Graham Scan 😄 ?
Signed-off-by: Laura S. Herzog <130370753+LSHerzog@users.noreply.github.com>
825be09 to
71e9d04
Compare
…ess restriction in dynamic router
|
|
||
| from __future__ import annotations | ||
|
|
||
| # from . import plots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # from . import plots |
Description
Adds features to perform macroscopic lattice surgery compilation for the color code. Both a routing for CNOT+T gates as well as a hill climbing based qubit label optimization is included. Furthermore, the microscopic construction of the snakes' stabilizers (for long distance lattice surgery) is provided both for the color code and surface code substrate.
Basic usage and how to reproduce benchmarks is described here.
Checklist: