Skip to content

Fix MIP Infeasibility/Unbounded errors and incorrect distance results by updating project.toml compat#61

Merged
Fe-r-oz merged 19 commits into
QuantumSavory:mainfrom
Fe-r-oz:fa/improve-compact
May 27, 2026
Merged

Fix MIP Infeasibility/Unbounded errors and incorrect distance results by updating project.toml compat#61
Fe-r-oz merged 19 commits into
QuantumSavory:mainfrom
Fe-r-oz:fa/improve-compact

Conversation

@Fe-r-oz

@Fe-r-oz Fe-r-oz commented Mar 17, 2026

Copy link
Copy Markdown
Member

Both HiGHS, and Gurobi yield INFEASIBLE or UNBOUNDED errors if they are unable to find the solution to integer programming problem for code computation. This is resolved by removing the erroneous examples where this occurs, and specifically computing dx, dz. The project.toml is updated to the latest version as well.

  • The code is properly formatted and commented.
  • Substantial new functionality is documented within the docs.
  • All new functionality is tested.
  • All of the automated tests on github pass.
  • We recently started enforcing formatting checks. If formatting issues are reported in the new code you have written, please correct them.

@codecov

codecov Bot commented Mar 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.15%. Comparing base (983a167) to head (64f4bdd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #61      +/-   ##
==========================================
- Coverage   95.52%   95.15%   -0.38%     
==========================================
  Files           8        8              
  Lines         760      763       +3     
==========================================
  Hits          726      726              
- Misses         34       37       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Fe-r-oz

Fe-r-oz commented Apr 5, 2026

Copy link
Copy Markdown
Member Author

There was some issues with compiling QuantumExpanders.jl on wsl locally -- so there is a bit of lag in requesting reviews of these PR -- will pick up speed soon

@Fe-r-oz Fe-r-oz changed the title Update package compatibility versions in Project.toml Update package compatibility versions in Project.toml and address INFEASIBLE errors from MIP solvers Apr 5, 2026
@Fe-r-oz Fe-r-oz changed the title Update package compatibility versions in Project.toml and address INFEASIBLE errors from MIP solvers Fix MIP Infeasibility/Unbounded errors and incorrect distance results; update project.toml compat Apr 6, 2026
@Fe-r-oz Fe-r-oz marked this pull request as ready for review April 6, 2026 15:47
@Fe-r-oz Fe-r-oz changed the title Fix MIP Infeasibility/Unbounded errors and incorrect distance results; update project.toml compat Fix MIP Infeasibility/Unbounded errors and incorrect distance results by updating project.toml compat Apr 6, 2026
@Fe-r-oz

Fe-r-oz commented Apr 6, 2026

Copy link
Copy Markdown
Member Author

Turning to draft to do some more work

@Fe-r-oz Fe-r-oz marked this pull request as draft April 6, 2026 16:45
@Fe-r-oz

Fe-r-oz commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

The following mermaid schematic is added to the ReadME:

graph TD
    QuantumTannerCodes["Quantum Tanner Codes"] --> RandomMethods["Random Methods"]
    QuantumTannerCodes --> DeterministicMethods["Deterministic Methods"]

    subgraph "Random construction"
        RandomMethods --> RandomQuantumTannerCode["`random_quantum_Tanner_code`"]
    end

    subgraph "Deterministic construction"
        DeterministicMethods --> QuantumTannerCode["`QuantumTannerCode`"]
        DeterministicMethods --> GeneralizedQuantumTannerCode["`GeneralizedQuantumTannerCode`"]
    end
Loading

@Fe-r-oz Fe-r-oz marked this pull request as ready for review April 14, 2026 00:11
@Fe-r-oz

Fe-r-oz commented May 20, 2026

Copy link
Copy Markdown
Member Author

@Krastanov, the PR is ready for review. I encountered some issues setting up the library locally due to computer problems, which caused a few mistakes and led to a slight delay in closely investigating everything

@Fe-r-oz Fe-r-oz requested a review from Krastanov May 20, 2026 22:56
@Fe-r-oz

Fe-r-oz commented May 20, 2026

Copy link
Copy Markdown
Member Author

Just to clarify, I meant that some non-functional updates such as compact rounds and documentation were not yet finalized, and there are no issues with correctness of the methods since they are tested

```

Here is an example of `[[72, 14, 4]]` quantum Tanner code from [radebold2025explicit](@cite):
Here is new `[[36, 8, (3,3)]]` code found via random search:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this example involves a random search, it will break again in six months when something else in the Random.jl internals changes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example is fully deterministic. The random search is over input paramters, like what classical code pairs are best, but the code instance itself is fully reproducible.

"""
Here is new [[36, 8, (3,3)]] code found via random search:

julia> F = free_group([:s, :r]);

julia> s, r = gens(F);

julia> rels = [s^2, r^4, s*r*s*r];

julia> G, epimorphism = quo(F, rels);

julia> s, r = epimorphism(s), epimorphism(r);

julia> A = [s, r, r^3];

julia> B = [s*r, s*r^3, r^2];

julia> H_A = [1  0  1; 0  1  1];

julia> G_A = [1  1  1];

julia> H_B = [1  1  1];

julia> G_B = [1  1  0; 1  0  1];

julia> classical_code_pair = ((H_A, G_A), (H_B, G_B));

julia> c = QuantumTannerCode(G, A, B, classical_code_pair);

julia> import JuMP; import HiGHS;

julia> code_n(c), code_k(c), distance(c, DistanceMIPAlgorithm(solver=HiGHS))
(36, 8, 3)

"""

Comment thread README.md
Comment on lines +97 to +99
julia> rng = MersenneTwister(892529278);

julia> hx, hz = random_quantum_Tanner_code(0.74, SL₂, A, B, rng=rng);
julia> hx, hz = random_quantum_Tanner_code(0.75, SL₂, A, B, rng=rng);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pretty weird change, a very good example of some of the weird changes in this PR.

You seem to have changed many of the broken tests with new similar but not the same tests (that now pass). But the broken tests were not actually fixed, they were replaced.

Given the state of the library, this is probably the best way forward and I have no qualms with it. But for the sake of documentation, could you explain why you have made these changes (in comments here). In particular, were the old broken tests wrong? Or were they in a format that was just difficult to reproduce? Are the new tests more "canonical" in some way, or are they also just some arbitrary tests? Why should be expect the new tests to not break in the future given that the old tests broke? Basically, I have the impression that you deleted some example codes and added new different example codes, and it feels kinda arbitrary.

Please try to be brief in your answer. Feel free to just answer whatever you perceive as the most important question above, not to answer them one-by-one. I am looking for a simple reason to trust all these numerous minute changes -- if they were necessary, why are you sure similar changes will not be needed in another year.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “broken” tests were not incorrect implementation of QuantumTannerCode that causes the tests to broke, but examples of quantum Tanner codes whose true minimum distance is poor in one basis. After the compatibility-bound changes in QuantumClifford.jl, I retested the codes more systematically and started reporting the full minimum-distance ($d_X$, $d_Z$) instead of only $d_Z$.

In most cases, I did not replace the tests: they are the same codes as before, but with separate verification of $d_X$ and $d_Z$. For some tests, including the example you pointed out, I changed the parameters to use codes with more meaningful distances (for example, ([[360,8,10,3]])) rather than keeping examples with poor distance in both bases. My goal was to keep examples that are more representative of good codes (from Morgensterns generators) and useful for documentation and regression testing.

Since I have been building much of this library almost from scratch alongside developing new methods for searching quantum Tanner codes, many of the original test instances were exploratory examples generated during that process. At the time, I had not yet systematically validated both their X- and Z-basis minimum distances, whereas these tests now do.

After retesting the codes more carefully, I removed some whose true minimum distance turned out to be 1, since I do not think such examples are especially useful as regression tests. A smaller number of tests were also removed because the HiGHS/MIP minimum-distance computation occasionally returns unstable “INFEASIBLE/UNBOUNDED” behavior on those instances, making the tests unreliable.

@Krastanov Krastanov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to merge, but for dev-documentation purposes, please comment with a brief answer to the questions above.

@Fe-r-oz

Fe-r-oz commented May 22, 2026

Copy link
Copy Markdown
Member Author

Thank you, I have added brief comments addressing the questions above. Please me know if anything else should be clarified

@Fe-r-oz Fe-r-oz merged commit 1b9d5e8 into QuantumSavory:main May 27, 2026
9 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants