diff --git a/src/qldpc/codes/distance/README.md b/src/qldpc/codes/distance/README.md index a963fdddb..520fb28fd 100644 --- a/src/qldpc/codes/distance/README.md +++ b/src/qldpc/codes/distance/README.md @@ -128,7 +128,7 @@ The documentation cites the other names at `qldpc.codes.distance`. | To change… | Look in (this directory) | | --- | --- | -| A method, or the validation of method names | the method type of each problem and its validator: `DistanceMethod` in `distances.py`, `CosetMethod` in `coset_leaders.py`, and `LogicalCountMethod` in `logical_counts.py`; the early checks of `src/qldpc/circuits/certification/fault_propagation.py` and `src/qldpc/circuits/certification/fault_distance.py`; where `logical_counts.py`, `_get_coset_weight` of `distances.py`, and `get_distance_exact` in `src/qldpc/codes/common.py` dispatch on the method name, and where `get_distance` validates it; and the `brute_force` flag that `logical_counts.py` passes to `_counting/scan.py` | +| A method, or the validation of method names | the method type of each problem and its validator: `DistanceMethod` in `distances.py`, `CosetMethod` in `coset_leaders.py`, and `LogicalCountMethod` in `logical_counts.py`; the early checks of `src/qldpc/circuits/certification/fault_propagation.py` and `src/qldpc/circuits/certification/fault_distance.py`; where `logical_counts.py`, `_get_coset_weight` of `distances.py`, and `get_distance_exact` in `src/qldpc/codes/common.py` dispatch on the method name, and where `get_distance` validates it; and `count_words` of `_counting/scan.py`, which scans the whole basis for the `brute_force` method of `logical_counts.py` | | The automatic choice of a method (`method="auto"`): which searches take which method, and when a connected-cluster search switches to the BZ method | `distances.py`, where the distance functions dispatch on the method; `_auto.py`, which estimates and compares the costs; `_get_coset_search_method` of `coset_leaders.py`, where coset searches take BZ; and `_get_logical_count_method` of `logical_counts.py`, where counts take BZ | | The counter, its deformed counters, or `compile_search_setup` | `logical_counts.py` | | The coset-leader search, which `src/qldpc/circuits/certification/` and `src/qldpc/experimental/circuits/benchmarking/residual_weights.py` use, and how its queries split into coset searches | `coset_leaders.py` | @@ -288,3 +288,5 @@ It affects only qLDPC, whereas `NUMBA_DISABLE_JIT=1` also runs other packages th Section 5 of `brouwer_zimmermann_code.md` and of `connected_cluster.md` names these tests and lists the writes that they miss. Review checks those writes. - `_readme_test.py` fails if "Where to look" omits a module, if "Layout" omits a top-level module or subpackage, or if this page or `problems.md` names, in a code span, a Python file of this package that does not exist. + It also fails if a file of this package cites by number a section that its guide lacks, as in "Section 3.9" or "Section 3.6 of `connected_cluster.md`", or if a Markdown file of the repository, outside hidden directories, links to an anchor of a guide of this package that no heading has. + Its docstrings say how it tells which guide a citation refers to, and that it reads citations that break across lines. diff --git a/src/qldpc/codes/distance/_readme_test.py b/src/qldpc/codes/distance/_readme_test.py index 85f94dd5e..33aa8d9c3 100644 --- a/src/qldpc/codes/distance/_readme_test.py +++ b/src/qldpc/codes/distance/_readme_test.py @@ -1,10 +1,18 @@ # SPDX-License-Identifier: Apache-2.0 -"""Tests that the README of this package names the modules that the package has.""" +"""Tests that the README and the guides of this package match the files and sections they cite.""" +import bisect import re from pathlib import Path +# The guides whose numbered sections the package cites: the two files of the Brouwer-Zimmermann +# guide number their sections as one guide. +_GUIDES = { + "brouwer_zimmermann": ("brouwer_zimmermann.md", "brouwer_zimmermann_code.md"), + "connected_cluster": ("connected_cluster.md",), +} + def test_the_readme_names_every_module_and_no_other_file() -> None: """The README maps every module, and neither it nor problems.md names a missing file. @@ -34,6 +42,55 @@ def test_the_readme_names_every_module_and_no_other_file() -> None: assert not named - files, f"The guides name missing files {sorted(named - files)}" +def test_cited_sections_and_anchors_exist() -> None: + """Each section that the package cites by number, and each anchor of a guide, exists. + + A citation such as "Section 3.9" or "Sections 3.6 and 3.11" refers to the guide that follows it, + as in "of ``connected_cluster.md``"; otherwise to the guides that a module says it cites, the + connected-cluster guide in ``_connected_cluster/``, or else the Brouwer-Zimmermann guide. + A citation may break across lines of a docstring, comment, or paragraph. Citations of sections + of other works, such as papers in the references of a guide, are skipped. Links into the guides + from Markdown files of the repository, outside hidden directories, must name existing headings. + """ + package = Path(__file__).parent + headings = { + guide: { + number + for name in names + for number in re.findall( + r"^#{2,4} (\d+(?:\.\d+)*)\.? ", _read(package / name), re.MULTILINE + ) + } + for guide, names in _GUIDES.items() + } + # This file quotes citations as examples, so it is skipped. + files = [*package.rglob("*.py"), *package.rglob("*.md")] + missing = [ + f"{path.relative_to(package)}:{line} cites Section {number}" + for path in sorted(path for path in files if path.name != Path(__file__).name) + for number, guides, line in _get_citations(path, package) + if not any(number in headings[guide] for guide in guides) + ] + assert not missing, "\n".join(missing) + + # Links from Markdown files of the repository, outside hidden directories, into the guides of + # this package, or within them. + root = Path(__file__).parents[4] + links = [ + (path, match, (path.parent / (match.group(1) or path.name)).resolve()) + for path in sorted(root.rglob("*.md")) + if not any(part.startswith(".") for part in path.relative_to(root).parts) + for match in re.finditer(r"\]\(([^)\s#:]*\.md)?#([^)\s]+)\)", _read(path)) + ] + broken = [ + f"{path.relative_to(root)} links to {match[0]}" + for path, match, target in links + if target.is_relative_to(package.resolve()) + and not (target.exists() and match.group(2) in _get_anchors(target)) + ] + assert not broken, "\n".join(broken) + + def _get_section(text: str, title: str) -> str: """The text of a section of the README, up to the next section of the same level.""" return text.split(f"\n## {title}\n", 1)[1].split("\n## ", 1)[0] @@ -47,3 +104,70 @@ def _get_named_files(text: str) -> set[str]: """ names = re.findall(r"`((?:[A-Za-z0-9_]+/)*[A-Za-z0-9_]+\.py)`", text) return {name for name in names if not name.startswith("src/")} + + +def _read(path: Path) -> str: + """The text of a file.""" + return path.read_text(encoding="utf-8") + + +def _get_citations(path: Path, package: Path) -> list[tuple[str, set[str], int]]: + """The section numbers that a file of this package cites, each with its guides and line. + + The references of a guide, which cite sections of other works, are skipped. + """ + text = _read(path).split("\n## References\n", 1)[0] + defaults = _get_default_guides(path.relative_to(package).as_posix(), text) + # Join the lines, without their indentation and comment marks, so that a citation that breaks + # across lines matches, and keep where each line starts in the joined text. + lines = [re.sub(r"\A\s*(?:#:?\s+)?", "", line) for line in text.split("\n")] + starts = [0] + for joined in lines[:-1]: + starts.append(starts[-1] + len(joined) + 1) + text = " ".join(lines) + citations = [] + for match in re.finditer( + r"Sections? (\d+(?:\.\d+)?)((?:(?:,| and| or| to|, and) \d+(?:\.\d+)?)*)", text + ): + after = text[match.end() : match.end() + 80] + before = text[max(0, match.start() - 20) : match.start()] + # Skip sections of other works, as in "Section 4.3.2", "its Section 5.1", and "Section 6 of + # Tillmann's preprint". + if re.match(r"\A(?:\.\d|[\s,]*of (?:\[?arXiv|the guide of|its |their |[A-Z]))", after): + continue + if re.search(r"\b(?:its|their|[A-Z]\w*'s)\s*\Z", before): + continue + # A citation followed by the name of a guide, as in "of ``connected_cluster.md``", refers to + # that guide. + named = re.match(r"\A[\s,]*(?:of|in) \[?`{0,2}(?:[\w./]*/)?(\w+\.md)", after) + guide = _get_guide(named.group(1)) if named else None + guides = {guide} if guide else defaults + line = bisect.bisect_right(starts, match.start()) + for number in [match.group(1), *re.findall(r"\d+(?:\.\d+)?", match.group(2))]: + citations.append((number, guides, line)) + return citations + + +def _get_default_guides(name: str, text: str) -> set[str]: + """The guides whose sections a file of this package cites when it names no guide.""" + if name.startswith("_connected_cluster/") or name == "connected_cluster.md": + return {"connected_cluster"} + declared = re.search(r"Sections cited in this module are those of(.{0,200})", text, re.DOTALL) + if declared: + names = re.findall(r"\w+\.md", declared.group(1)) + return {guide for name in names if (guide := _get_guide(name))} + return {"brouwer_zimmermann"} + + +def _get_guide(name: str) -> str | None: + """The guide of which a Markdown file of this package is part, if any.""" + return next((guide for guide, names in _GUIDES.items() if name in names), None) + + +def _get_anchors(path: Path) -> set[str]: + """The anchors of the headings of a Markdown file, as GitHub makes them.""" + titles = re.findall(r"^#{1,6} (.+?)\s*$", _read(path), re.MULTILINE) + return { + re.sub(r"[^\w\- ]", "", title.replace("`", "").lower()).replace(" ", "-") + for title in titles + } diff --git a/src/qldpc/codes/distance/brouwer_zimmermann_code.md b/src/qldpc/codes/distance/brouwer_zimmermann_code.md index cb916b13d..ee3c6e590 100644 --- a/src/qldpc/codes/distance/brouwer_zimmermann_code.md +++ b/src/qldpc/codes/distance/brouwer_zimmermann_code.md @@ -126,29 +126,29 @@ The tests `test_brouwer_zimmermann_setup_exits`, `test_brouwer_zimmermann_setup_ | Concept | Code | | --- | --- | -| Upper bound `U` | `best`, or `upper_bound` as a parameter | -| Lower certificate `L` | `lower_bound` of a search, computed by `Certificate.lower_bound(completed_weight)` from the certificate's `dimension`, `ranks`, `weight_divisor`, and `max_coverage` | -| Certificate within a layer `L(t, j)` | `Certificate.step_lower_bound(weight, num_completed)` and the table of `get_step_lower_bounds`, which `Certificate.get_weight_bounds` rounds and divides for coset searches; `get_num_sets_to_certify`, `find_stopping_step`, and `plan_steps` find stopping steps ([Section 4.1](#41-how-the-searches-use-the-modules)) | +| Upper bound `U` | The best weight of `BrouwerZimmermannSearch` and of `_SectorSearch`, as their docstrings describe, and the cap on the result that `get_distance_brouwer_zimmermann` takes | +| Lower certificate `L` | The lower bound of `_SectorSearch` (its docstring), computed by `Certificate.lower_bound` from `Certificate.dimension`, `ranks`, `weight_divisor`, and `max_coverage` | +| Certificate within a layer `L(t, j)` | `Certificate.step_lower_bound` and the table of `get_step_lower_bounds`, which `Certificate.get_weight_bounds` rounds and divides for coset searches; `get_num_sets_to_certify`, `find_stopping_step`, and `plan_steps` find stopping steps ([Section 4.1](#41-how-the-searches-use-the-modules)) | | Family of search bases | `BasisFamily` of [_information_sets/basis_families.py](_information_sets/basis_families.py), which stacks the search bases into arrays and gives their `Certificate`; packed in an `AffineInstance`, and, in coset searches, with the tables of `CosetSearchTables` and `CosetTails` of [_brouwer_zimmermann/coset_tables.py](_brouwer_zimmermann/coset_tables.py) | -| Automorphisms, generators of `Γ` | `automorphisms`, whose row `i` maps column `j` to column `automorphisms[i, j]`, as returned by `get_automorphisms`; `_known_permutation_automorphisms` and `_get_permutation_automorphisms` of `QuditCode` and of `ClassicalCode` | -| Automorphism family | `get_automorphism_family` of [_information_sets/automorphism_families.py](_information_sets/automorphism_families.py), which returns a `BasisFamily` of the scanned set and the `Certificate` of all of its images; `_switch_to_automorphism_family` adopts them, and sets `uses_automorphism_family` of the search | -| Last completed layer `t`, next layer | `completed_weight`, `next_weight` | +| Automorphisms, generators of `Γ` | The generators that a search gets, whose rows permute columns as the docstrings of `get_distance_brouwer_zimmermann` and of `verify_automorphisms` of [_information_sets/automorphism_families.py](_information_sets/automorphism_families.py) say; `_known_permutation_automorphisms` and `_get_permutation_automorphisms` of `QuditCode` and of `ClassicalCode` | +| Automorphism family | `get_automorphism_family` of [_information_sets/automorphism_families.py](_information_sets/automorphism_families.py), which returns a `BasisFamily` of the scanned set and the `Certificate` of all of its images; `_SectorSearch._switch_to_automorphism_family` adopts them, and marks the search as using the family (the docstring of `_SectorSearch`) | +| Last completed layer `t`, next layer | The argument of `Certificate.lower_bound` (the docstring of `Certificate`), and `next_weight` of `_SectorSearch` | | Divisor `D` | `Certificate.weight_divisor`, in Hamming units of the searched basis | | Maximum coverage `C` | `Certificate.max_coverage` | -| Dimension `r`, block rank `r_i` | `dimension`, `ranks` (`BasisFamily.ranks`, `AffineInstance.ranks`) | -| Search basis and its block | One set of a `BasisFamily`: its entries of `generators`, `labels`, `pivots`, and `ranks`; the recorded block is the pivot subset, as explained below | -| Number of coordinates `N` | `num_columns`, the number of nonzero columns (the length of `columns` or `nonzero_columns`), in the functions of [_information_sets/basis_families.py](_information_sets/basis_families.py) | -| Stored width `N_stored` | `basis.shape[1]` before pivot deletion, including any all-zero columns; `num_columns` in [_information_sets/automorphism_families.py](_information_sets/automorphism_families.py), and in the `BasisFamily` docstring for the last axis of `generators` | -| Labels `M` | `labels`, which has no columns for a classical problem | +| Dimension `r`, block rank `r_i` | `Certificate.dimension` and `Certificate.ranks`; `BasisFamily` and `AffineInstance` also hold the ranks (their docstrings) | +| Search basis and its block | One set of a `BasisFamily`, whose docstring describes the arrays of each set; the recorded block is the pivot subset, as explained below | +| Number of coordinates `N` | The number of columns that `get_nonzero_columns` of [_code_matrices.py](_code_matrices.py) returns, which the docstrings of `_PartitionPlan` and `_has_pruned_disjoint_rank_bound` in [_information_sets/basis_families.py](_information_sets/basis_families.py) call `N` | +| Stored width `N_stored` | The number of columns of a basis before pivot deletion, including any all-zero columns: the columns that the automorphisms of `verify_automorphisms` in [_information_sets/automorphism_families.py](_information_sets/automorphism_families.py) permute, and the last axis of the generators of a `BasisFamily` (its docstring) | +| Labels `M` | The labels of a `BasisFamily` (its docstring), which have no columns for a classical problem | | Eligible rows | `get_eligible_rows` of [_code_matrices.py](_code_matrices.py): every row of a classical basis; rows with nonzero labels for a quantum problem | -| Support, prefix XORs | `support` and `prefixes` in `_SectorSearch._scan_set`, in each thread of `_SectorSearch._scan_set_on_threads`, and in the scans of [_brouwer_zimmermann/affine_search.py](_brouwer_zimmermann/affine_search.py), which step through a layer with `advance_support` of [_information_sets/support_stepping.py](_information_sets/support_stepping.py) | -| Packed generators | `generators` of the `AffineInstance` of a distance search: `uint64` words, after deleting pivot columns. `widths` counts the valid words for each search basis. | -| Packed labels | `labels` of the `AffineInstance` of a distance search: `uint64` quotient-label words, without pivot-column deletion | -| Batch of a compiled scan | `batch_size`, equal to `1 << search_chunk_exponent` supports, or supports and lookups together in a scan with completion tables; on threads, a chunk of each thread holds `batch_size * num_threads` ([Section 4.5](#45-behavior-spanning-files)) | -| Work item of a layer, and the threads that scan it ([Section 4.5](#45-behavior-spanning-files)) | `_WorkItems` and `_SectorSearch._scan_set_on_threads` of [_brouwer_zimmermann/distance.py](_brouwer_zimmermann/distance.py), `start_set_items` and `scan_set_items`, and `run_work_items` of [_threads.py](_threads.py); `num_threads` of a search | -| Split work, and the blocks of a batch of coset queries that threads search ([Section 4.5](#45-behavior-spanning-files)) | `run_blocks` of [_threads.py](_threads.py), which runs a batch on the calling thread until its work reaches the split work, and the rest in blocks with `run_work_items`; `_find_first_on_threads` and `_find_min_weights_on_threads` of [_brouwer_zimmermann/coset.py](_brouwer_zimmermann/coset.py); `num_threads` and `split_work` of a `CosetLeaderSearch` | +| Support, prefix XORs | The support and its prefix XORs, which `_SectorSearch._scan_set`, or each thread of `_SectorSearch._scan_set_on_threads`, passes to the scans of [_brouwer_zimmermann/affine_search.py](_brouwer_zimmermann/affine_search.py) (see the docstring of `scan_set`); the scans step through a layer with `advance_support` of [_information_sets/support_stepping.py](_information_sets/support_stepping.py) | +| Packed generators | The packed rows of the `AffineInstance` of a distance search, as its docstring describes: `uint64` words, after deleting pivot columns, with the number of valid words of each search basis | +| Packed labels | The packed labels of the `AffineInstance` of a distance search (its docstring): `uint64` quotient-label words, without pivot-column deletion | +| Batch of a compiled scan | `_SectorSearch.batch_size`, `1 << search_chunk_exponent` supports, or supports and lookups together in a scan with completion tables; on threads, a chunk of each thread holds that many times the number of threads, as `_SectorSearch._scan_set_on_threads` says ([Section 4.5](#45-behavior-spanning-files)) | +| Work item of a layer, and the threads that scan it ([Section 4.5](#45-behavior-spanning-files)) | `_WorkItems` and `_SectorSearch._scan_set_on_threads` of [_brouwer_zimmermann/distance.py](_brouwer_zimmermann/distance.py), `start_set_items` and `scan_set_items`, and `run_work_items` of [_threads.py](_threads.py); `_SectorSearch`, whose docstring describes its number of threads | +| Split work, and the blocks of a batch of coset queries that threads search ([Section 4.5](#45-behavior-spanning-files)) | `run_blocks` of [_threads.py](_threads.py), which runs a batch on the calling thread until its work reaches the split work, and the rest in blocks with `run_work_items`; `_find_first_on_threads` and `_find_min_weights_on_threads` of [_brouwer_zimmermann/coset.py](_brouwer_zimmermann/coset.py); and the constructor of `CosetLeaderSearch`, which sets the split work from `num_threads` and `search_chunk_exponent` of `SearchTuning` | | Candidate/set evaluation | The unit of the work of `plan_steps`, which `Certificate.work` counts | -| Completion tables ([Section 3.9](brouwer_zimmermann.md#39-skipping-completions-by-completion-tables)) | `CompletionTables` of [_information_sets/completion_bounds.py](_information_sets/completion_bounds.py), chosen by `select_completion_tables` and kept, with the index of their set, in `completion_tables` and `completion_tables_set` of a distance search, in `_StepTables` of a count ([_counting/scan.py](_counting/scan.py)), or in `CosetTails` of a coset search | +| Completion tables ([Section 3.9](brouwer_zimmermann.md#39-skipping-completions-by-completion-tables)) | `CompletionTables` of [_information_sets/completion_bounds.py](_information_sets/completion_bounds.py), chosen by `select_completion_tables` and kept, with the index of their set, by `_SectorSearch` of a distance search (its docstring), in `_StepTables` of a count ([_counting/scan.py](_counting/scan.py)), or in `CosetTails` of a coset search | For the rank-deficient block of [Section 2.4](brouwer_zimmermann.md#24-search-bases-and-rank-deficient-blocks), the implementation records only its `rank` independent pivot columns in its row of `BasisFamily.pivots`, padded with -1, which give the same term `b_i(t)`, and which coverage and pivot-column deletion use. diff --git a/src/qldpc/codes/distance/connected_cluster.md b/src/qldpc/codes/distance/connected_cluster.md index 12addcb33..6768e64b5 100644 --- a/src/qldpc/codes/distance/connected_cluster.md +++ b/src/qldpc/codes/distance/connected_cluster.md @@ -592,29 +592,29 @@ The names below are in `_connected_cluster/search.py`, unless the table says oth | Concept | Code | | --- | --- | -| Pair `(H, G)`, its words and witnesses | `checks` and `excluded` of `SupportSearch` and `get_distance_connected_cluster` | +| Pair `(H, G)`, its words and witnesses | `SupportSearch`, whose docstring defines its checks, excluded rows, words, and witnesses, and `get_distance_connected_cluster` | | Sectors of a CSS code | `_search_css` of `distances.py`, which `get_distance_css` and `get_distance_pauli` call, `get_css_stabilizers` of `_code_matrices.py`, and `get_sector_map` of `_sector_maps.py`, which can leave one sector to search | | Classical codes, and qubit codes that are not CSS | `get_distance_from_checks` and `get_distance_pauli` of `distances.py` | -| Problems of Section 3.7, values, and symbols | `symplectic` of `SupportSearch`, its `_get_symbol_columns`, and `_shift_other_values` | -| Distance over several sectors | `get_distance_connected_cluster`, which advances `ConnectedClusterSearch` one weight limit at a time, as `search_by_cost` of `_auto.py` does for `method="auto"` | -| Distance of a vector `v` from a classical code with generator matrix `G_C` | `_get_coset_weight` of `distances.py`, which `ClassicalCode.get_distance_exact(vector=v)` calls, and which, by the connected-cluster method, searches `([H \| Hv], [G_C \| 0])` and subtracts one ([Section 3.8](#38-vectors-with-a-given-syndrome)) | +| Problems of Section 3.7, values, and symbols | `SupportSearch`, whose docstring defines symplectic problems, values, and symbols, its `_get_symbol_columns`, and `_shift_other_values` | +| Distance over several sectors | `get_distance_connected_cluster`, which advances `ConnectedClusterSearch` one weight limit at a time, as `search_by_cost` of `_auto.py` does for the automatic choice of a method | +| Distance of a vector `v` from a classical code with generator matrix `G_C` | `_get_coset_weight` of `distances.py`, which `ClassicalCode.get_distance_exact` calls for a vector, and which, by the connected-cluster method, searches `([H \| Hv], [G_C \| 0])` and subtracts one ([Section 3.8](#38-vectors-with-a-given-syndrome)) | | Search through a weight limit `W` | `SupportSearch.find_witness` | -| Syndrome query | `SupportSearch.find_vector_with_syndrome`, which coset searches skip for `SupportSearch.find_vector_with_packed_syndrome`, and the sentinel root `-1` of `_search_supports` | -| Overlaps that a syndrome query memoizes within a state | `memoize` of `_search_supports`, and `memos` and `stamp` of `_get_branches` | -| Overlaps of all symbols in one pass, and repairs summed check by check, in distance searches and syndrome queries | `symbol_overlaps` and `symbol_repairs` of `_get_branches` | +| Syndrome query | `SupportSearch.find_vector_with_syndrome`, which coset searches skip for `SupportSearch.find_vector_with_packed_syndrome`, and `_search_supports`, which starts a query from the root `-1` | +| Overlaps that a syndrome query memoizes within a state | `_search_supports`, whose docstring says when a state memoizes, and `_get_branches`, whose docstring describes the memos | +| Overlaps of all symbols in one pass, and repairs summed check by check, in distance searches and syndrome queries | `_get_branches`, whose docstring describes both | | Coset leaders of Pauli errors | `ConnectedClusterCosetSearch` in `_connected_cluster/coset.py`, `CosetLeaderSearch` in `coset_leaders.py`, and `MinWeightBound` in `min_weight_bounds.py`, the bound of one query | | Sparser checks with the same span | `get_sparser_rows` and `_sparsify` in `_connected_cluster/sparse_checks.py`, and `_get_sparser_stabilizers` of `distances.py` | | Rounds of sparsifying | `max_coset_sparsifying_rounds`, `max_distance_sparsifying_rounds`, and `sparsifying_rounds_without_improvement` of `SearchTuning` in `_tuning.py` | -| Table of light vectors, and increasing limits for batches and minimum weights | `ConnectedClusterCosetSearch` in `_connected_cluster/coset.py`, with its `_singles` for single queries, and `_get_min_weight`, which compares syndromes with the checks of symbols and tries increasing limits for batches; and `tabulate_singles` of `_cosets.py` | +| Table of light vectors, and increasing limits for batches and minimum weights | `ConnectedClusterCosetSearch` in `_connected_cluster/coset.py`, with the table of words of weight zero or one that its docstring describes for single queries, and `_get_min_weight`, which compares syndromes with the checks of symbols and tries increasing limits for batches; and `tabulate_singles` of `_cosets.py` | | Logical test | `SupportSearch._get_tests`, and `_is_outside_excluded` | | Roots, ranks, and symmetries | `SupportSearch._use_automorphisms`, and `verify_automorphisms` and `get_orbits` of `_information_sets/automorphism_families.py` | | States, branching, and undoing what a state forbade when the search leaves it | `_search_supports`, whose `levels` mark the available symbols | -| Weight limits on threads: the frontier, work items, replay, claims of one item, ordered commit, and when to split | `_search_on_threads`; `_MAX_ITEMS`; `paths` and `frontier_depth` of `_search_supports`; `num_threads` and `split_minimum_states` of `SupportSearch`; the constructor of `ConnectedClusterSearch`, which computes the gate `split_minimum_states` from `search_chunk_exponent` and `connected_cluster_split_shift`; `ITEMS_PER_THREAD`, `run_work_items`, and `run_items_until_first` of `_threads.py`; and `num_threads`, `search_chunk_exponent`, and `connected_cluster_split_shift` of `SearchTuning` in `_tuning.py` | -| Chunks of a weight limit, on one thread and on threads | `_search_in_chunks`, `resume`, `ends`, and `max_states` of `_search_supports`, `chunk_states` of `SupportSearch`, and `search_chunk_exponent` of `SearchTuning` in `_tuning.py` | +| Weight limits on threads: the frontier, work items, replay, claims of one item, ordered commit, and when to split | `_search_on_threads`, whose docstring sizes the frontier; `_search_supports`, whose docstring describes the paths of work items and the frontier depth; `SupportSearch`, whose docstring describes its threads and the gate of a split; the constructor of `ConnectedClusterSearch`, which computes that gate from `search_chunk_exponent` and `connected_cluster_split_shift`; `run_work_items` and `run_items_until_first` of `_threads.py`; and `num_threads`, `search_chunk_exponent`, and `connected_cluster_split_shift` of `SearchTuning` in `_tuning.py` | +| Chunks of a weight limit, on one thread and on threads | `_search_in_chunks`; `_search_supports`, whose docstring says how a search stops after a budget of states and goes on from where it stopped; `SupportSearch`, whose docstring describes the size of a chunk; and `search_chunk_exponent` of `SearchTuning` in `_tuning.py` | | Batches of syndrome queries on threads | `ConnectedClusterCosetSearch.find_first_not_within_max_weight` and `get_min_weights` in `_connected_cluster/coset.py`, which `CosetLeaderSearch` calls; their compiled loop `_find_min_weights`, which counts the work of each query; and `run_blocks` of `_threads.py` | -| Weights, pruning, and the symbols that a state forbids for its subtree | `_get_branches`, and `restrict_viable_symbols` of `SearchTuning` in `_tuning.py`, whose `False` turns that forbidding off; the test of `b1` that skips a child is in `_search_supports` | +| Weights, pruning, and the symbols that a state forbids for its subtree | `_get_branches`, and `restrict_viable_symbols` of `SearchTuning` in `_tuning.py`, whose `False` turns that forbidding off; and `_search_supports`, which skips a child by the bound `b1` of [Section 3.4](#34-pruning) | | Overlaps with known words: loads, capacities, and the symbols that they forbid | `_get_overlap_cuts`, `_shift_cut_loads`, `SupportSearch.use_query_overlap_words`, and `stabilizer_overlap_cuts` of `SearchTuning` in `_tuning.py`, whose `False` turns the cuts off; `ConnectedClusterCosetSearch.use_query_overlap_words` and the constructor of `CosetLeaderSearch` for queries | -| Sums of pairs of checks and of known words | `get_light_pair_sums` in `_connected_cluster/sparse_checks.py`, the `_summed_pairs` of `SupportSearch` and its `find_vector_with_packed_syndrome`, which maps syndromes to them, its `_known_words`, the known words of `find_witness`, and `pair_sum_checks` of `SearchTuning` in `_tuning.py`, whose `False` turns them off | +| Sums of pairs of checks and of known words | `get_light_pair_sums` in `_connected_cluster/sparse_checks.py`; `SupportSearch`, whose docstring says how it adds the sums as checks, and as known words of `find_witness`, and its `find_vector_with_packed_syndrome`, which maps syndromes to the added checks; and `pair_sum_checks` of `SearchTuning` in `_tuning.py`, whose `False` turns them off | | When a search asks for symmetries | `automorphism_minimum_states` of `SearchTuning` in `_tuning.py` | | Weight divisor | `infer_weight_divisor` of `_information_sets/basis_families.py` |