Skip to content

perf(lindblad): skip the second hop and corrector when hop 2 admits nothing - #230

Merged
david-pl merged 2 commits into
split/5-kossakowskifrom
perf/lindblad-skip-empty-hop2
Sep 28, 2026
Merged

david-pl merged 2 commits into
split/5-kossakowskifrom
perf/lindblad-skip-empty-hop2

Conversation

@AlexSchuckert

Copy link
Copy Markdown
Collaborator

Stacked on #222 (split/5-kossakowski).

Summary

With admit_basis set, once the basis has reached max_basis the first leakage admission fills the whole room admit − |basis|. The second leakage call then ran with room = 0 and admitted nothing in every capped step, while still evaluating all its candidates, and the corrector repeated the predictor exactly on the same basis and input.

pc_step and pc_step_orbit_rep now skip the second leakage pass when room = 0 and reuse the predicted state whenever the second hop admitted no string. Results are bit-identical; skipped phases report 0 in PcStepTimings. Default behaviour is otherwise unchanged: capped steps still carry no second-order admission, as before.

Single commit, crates/ppvm-lindblad/src/step.rs only.

Measurements

pc_step on the two-leg XY ladder with a local probe (not part of this PR): L = 41 rungs (N = 82), max_basis = 2^18, admit_basis = 3·2^18, dt = 0.1, 25 steps, 4 threads, drop_tol = 0. Apple M4 MacBook Air (fanless, so wall times are only comparable within a rep).

In the base, 21 of the 25 steps are capped and the second hop (leakage2 + expm2) accounts for 53% of the wall time (34.5 of 65.2 s).

wall (s), per rep
base (#222), mimalloc 53.7 / 53.5 / 62.5
this PR, mimalloc 26.6 / 28.7 / 33.3
base (#222), system malloc 65.6 / 79.1
this PR, system malloc 32.4 / 38.4
  • The run is 1.9–2.0× faster end-to-end; memory is unchanged (live-heap peak 441.7 MiB in both).
  • The final coefficients are bit-identical to the base in every run.

Tests: cargo test -p ppvm-lindblad passes (8/8) with this change stacked together with the blocked-CSC PR; not yet run on this branch alone (CI will).

🤖 Generated with Claude Code

…othing

With admit_basis set, once the basis has reached max_basis the first
leakage admission fills the whole room admit - |basis|, so the second
leakage call ran with room = 0 and admitted nothing in every capped step
while still evaluating all its candidates, and the corrector then repeated
the predictor exactly on the same basis and input.

pc_step and pc_step_orbit_rep now skip the second leakage pass when
room = 0 and reuse the predicted state whenever the second hop admitted no
string. Results are bit-identical; skipped phases report 0 in
PcStepTimings. Default behaviour is otherwise unchanged: capped steps
still carry no second-order admission, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-28 13:45 UTC

@david-pl
david-pl merged commit 2ab9b53 into split/5-kossakowski Sep 28, 2026
13 checks passed
@david-pl
david-pl deleted the perf/lindblad-skip-empty-hop2 branch September 28, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants