Repository navigation
Add method="auto", which chooses a method for each distance search, and make it the default - #913
Merged
Merged
Conversation
…nd make it the default Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Test that searches by cost check and lift automorphisms on their CSS and connected-cluster sides, and that stepped connected-cluster searches add the states of their sectors and grow per unit of weight. Restructure _search_css around a helper for the sparser sectors of a connected-cluster search, and clarify docstrings, comments, and error messages that omitted "auto". Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…m to "auto" Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…han mock it Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…hresholds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The two exact distance searches of qLDPC win on different codes, often by large factors. The connected-cluster search is far faster than the Brouwer-Zimmermann (BZ) search on many quantum LDPC codes, but much slower on some others, and on classical codes whose checks are only moderately sparse. A user should not have to know which method suits a code.
Changes
method="auto"chooses a method for each search, and becomes the default of the distance functions ofqldpc.codes.distance, ofget_distanceandget_distance_exactof the code classes, ofget_fault_distance, and of the deprecatedget_distance_classicalandget_distance_quantum. The rule is a heuristic, not fitted, which aims to avoid a very slow method rather than to find the fastest: brute force if that is cheap, BZ for classical codes and for functions that take generators, and otherwise a connected-cluster search, which a short BZ probe may finish or cap, and which switches to BZ if BZ is predicted to cost less. The section "Choosing a method" ofsrc/qldpc/codes/distance/README.mdstates the rule, argues that results stay exact, and lists its known losses. Coset searches keep BZ, which they also take for"auto"._auto.pyholds the rule, andcore.pyroutes each kind of search to it. The steppable searches of Step the BZ and connected-cluster searches of several problems through resumable objects #900 gain hooks that report their work and progress, and_tuning.pygains four fields, documented indocs/source/exact_search_tuning.rst.method="brouwer_zimmermann", or no longer say so.Validation
The rule and its budgets came from a study outside the repository, and were checked on held-out codes before implementation. The times below are from an earlier revision of this branch; the routes that
"auto"takes on 13 recorded workloads have not changed since.On the X sectors of 118 quantum codes (bivariate-bicycle, lifted-product, and quantum Tanner codes),
"auto"took 1726 s in total, against 1990 s for the faster method on each code, and 6574 s for BZ, plus 18 searches that BZ did not finish within 300 s or 900 s. No code took"auto"both twice as long as the faster method and at least 1 s longer; the largest excess was 2.3 s. On other kinds of search, with a limit of 300 s:"auto"Explicit
"brouwer_zimmermann"and"connected_cluster"searches are unchanged: on ten workloads,experiments/distance_tuning/trace.py --comparefinds the same decisions as onmain, andsweep.py --worktreesgives median ratios of 0.97 to 1.03 tomain's times.Additional notes
FutureWarning, since results are exact either way. With acutoffof 2 or more, the weight returned can depend on the method, within the documented contract."auto"can take up to about a second longer than BZ on searches that BZ finishes at once, such as of random codes of about 60 bits, which it enumerates or probes."auto"runs connected-cluster searches, which take a keyboard interrupt only between weight limits.