compute the minimum distance of QLDPC using Mixed Integer Programming#439
compute the minimum distance of QLDPC using Mixed Integer Programming#439Krastanov merged 55 commits intoQuantumSavory:masterfrom
Conversation
…ixed Integer Programming (MIP)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #439 +/- ##
==========================================
+ Coverage 82.82% 83.42% +0.60%
==========================================
Files 70 73 +3
Lines 4651 4808 +157
==========================================
+ Hits 3852 4011 +159
+ Misses 799 797 -2 ☔ View full report in Codecov by Sentry. |
|
Please help review this PR, thank you :) Thanks to GNU for open-souring GLPK. I have tested all the instances of 2bga codes using Possible Future TODOs include:
|
|
This is really interesting and deserving of a bounty. Regrettably there are a few merge conflicts related to the doc fixes in an earlier PR. Could you fix those? I also probably would suggest looking into a slightly different API, or at least some easier way to support independent solvers. But that can be discussed after the first round of review. |
Krastanov
left a comment
There was a problem hiding this comment.
I pushed a few minor changes:
- making sure the docs build correctly and list the new content
- a different more idiomatic way to give hints about what needs to be imported
- other mixed cleanup
Could you:
- check the changes in my last commit and make sure I have not broken anything
- fix the existing latex in the docstring you have added (if you render the docs and open the ECC_API page, you will see that your docstring is not formatted correctly (the latex in it is not formatted))
- add a docstring to the struct where I have left a bunch of TODOs. You can used DocStringExtensions to simplify that by putting a docstring for each struct field (QuantumSavory.ProtocolZoo uses that a lot)
To build the docs locally you can do
cd QuantumClifford.jl
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()';
julia --project=docs -i docs/make.jl
# and then the docs are in the build folder
If you do that you will see that currently there are a few issues:
The admonitions are note rendered correctly:

The latex is not rendered (just one example, make sure to correct all of the latex in your pr):
This is a great addition! We should push it out soon and make sure the bounty for it is claimed.
ec8d3db to
4643f75
Compare
|
Thank you very much for the amazing improvements and suggestions on the documentation build!! Nothing appears to be broken by the changes. Regarding LaTeX rendering: I tried building the documentation locally, but since I don’t yet have VSCode installed, I didn’t get the HTML link of documentation after processing the commands. For LaTeX, I used A few other fixes to the aforementioned issues: resolved the formatting error with The CI documentation error is unrelated to this PR—it occurs because |
Not immediately important, but just posting for future reference: VS Code should not be related or necessary for the doc building. You probably did not get the |
Krastanov
left a comment
There was a problem hiding this comment.
Thanks! This looks great. One last comment left below.
After you address that comment, please go ahead and officially claim the bounty, no need to wait for review. It would be convenient for me if you make the claim promptly, as otherwise some of the processing can be significantly delayed.
src/ecc/ECC.jl
Outdated
| """when `true` (default=`false`), computes the code distance for each logical qubit and returns the minimum value across all | ||
| logical operators of the specified type (`X` or `Z`)""" | ||
| all_logical_qubits::Bool=false | ||
| """type of logical operator to consider (:X or :Z, defaults to :X) - both types yield identical distance results for CSS stabilizer codes.""" | ||
| logical_operator_type::Symbol=:X |
There was a problem hiding this comment.
Probably last comment on this:
These two configuration options are not "orthogonal". Can we simplify them a bit. For instance, it looks like we can just completely drop all_logical_qubits as logical_qubit === nothing can already unambiguously mean "all logical qubits".
There was a problem hiding this comment.
Absolutely agree!! Thank you very much!!
Thank you for your amazing suggestions!! That's awesome news!! Thank you very much for helpful suggestion!! Incorporated the code review suggestion and added remaining distance test for the remaining GB codes in ( |
|
Hi Stefan, Please help review this PR when you have a moment! Once it’s pushed, I’m excited to start working on the satisfiability formulation of minimum distance problem as we discussed in the meeting! Really appreciate your very helpful suggestions in shaping this work! Thank you! 😀 |
|
I have added All the tests related to this PR pass. The failing CI JET =true/false tests fail on master CI so they are not related to this PR. This PR is ready for review! Thank you! |
|
Hi, @Krastanov, just a friendly bump on this PR! Thank you! |
|
Thank you, this is great! |
|
Thank you! 😃 |


This PR implements the Mixed Integer programming (MIP) approach to compute the minimum distance of QLDPC using GNU's Linear Programming Kit. This method is used by Panteleev and Kalachev and by Bravyi et. al.. The latter reference mentioned that this MIP approach was originally developed in 2011 and used in this reference
This PR allows the users to compute the minimum distance with ease and also provide the necessary documentation along with the relevant modern usecases. The tests have been conducted in #435
ILP/MILP methods: https://quantumcomputing.stackexchange.com/questions/37289/compute-the-exact-minimum-distance-of-a-qecc-with-integer-linear-programming-met
P.S. Mixed Integer Programming (MIP) or mixed integer linear program refer to same thing in the literature, in this context.
Edit: