Skip to content

feat: ✨ oversample SRC sketches before exact SVD truncation - #63

Merged
Panadestein merged 8 commits into
mainfrom
copilot/oversampled-sketch-svd-truncation
Oct 15, 2026
Merged

Panadestein merged 8 commits into
mainfrom
copilot/oversampled-sketch-svd-truncation

Conversation

Copilot AI commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Sketching at exactly chi_out makes randomized range-finding error dominate SRC accuracy. This change oversamples first, then truncates to the requested bond dimension.

  • Sketch sizing: Add oversample to apply, compress, and src. Default to max(ceil(1.5 * chi_out), chi_out + 10); explicit factors use ceil(oversample * chi_out).
  • Exact truncation: Add a backend-aware left-to-right SVD pass. Apply cutoff to Schmidt values in this pass and return left-canonical output. Store retained columns compactly.
  • Compatibility: oversample=1.0 preserves the original sweep, cutoff semantics, and right-canonical output. The two-site exact fallback remains unchanged.
  • Documentation: Describe the default, canonical forms, cutoff semantics, and larger-sketch cost.
# Sketch with 128 columns, then truncate to bond dimension 64.
out = apply(mpo, mps, chi_out=64, oversample=2.0)

Copilot AI and others added 2 commits October 14, 2026 11:25
Assisted-by: GitHub Copilot:unknown

Co-authored-by: robertodr <3708689+robertodr@users.noreply.github.com>
Assisted-by: GitHub Copilot:unknown

Co-authored-by: robertodr <3708689+robertodr@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix oversampled sketch followed by exact SVD truncation feat: ✨ oversample SRC sketches before exact SVD truncation Oct 14, 2026
Copilot AI requested a review from robertodr October 14, 2026 11:33
@robertodr
robertodr requested a review from Panadestein October 14, 2026 12:34
@Panadestein
Panadestein marked this pull request as ready for review October 15, 2026 08:23
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

    5 files  ±  0      5 suites  ±0   4m 17s ⏱️ +40s
  374 tests +108    367 ✅ +108   7 💤 ±0  0 ❌ ±0 
1 790 runs  +522  1 775 ✅ +522  15 💤 ±0  0 ❌ ±0 

Results for commit 8c0663e. ± Comparison against base commit a996df3.

This pull request removes 11 and adds 119 tests. Note that renamed tests count towards both.
tests.test_stack ‑ test_apply_matches_src[A B-0.0]
tests.test_stack ‑ test_apply_matches_src[A B-0.5]
tests.test_stack ‑ test_apply_matches_src[A psi-0.0]
tests.test_stack ‑ test_apply_matches_src[A psi-0.5]
tests.test_stack ‑ test_compress_matches_src[A-0.0]
tests.test_stack ‑ test_compress_matches_src[A-0.5]
tests.test_stack ‑ test_compress_matches_src[psi-0.0]
tests.test_stack ‑ test_compress_matches_src[psi-0.5]
tests.test_stack ‑ test_src_two_site_stack_falls_back[A B C]
tests.test_stack ‑ test_src_two_site_stack_falls_back[A B psi]
…
tests.test_gpu_backend ‑ test_oversampled_truncation_matches_cpu[mpo-1.0]
tests.test_gpu_backend ‑ test_oversampled_truncation_matches_cpu[mpo-2.0]
tests.test_gpu_backend ‑ test_oversampled_truncation_matches_cpu[mpo-None]
tests.test_gpu_backend ‑ test_oversampled_truncation_matches_cpu[mps-1.0]
tests.test_gpu_backend ‑ test_oversampled_truncation_matches_cpu[mps-2.0]
tests.test_gpu_backend ‑ test_oversampled_truncation_matches_cpu[mps-None]
tests.test_stack ‑ test_apply_matches_src[A B-0.0-1.0]
tests.test_stack ‑ test_apply_matches_src[A B-0.0-1.5]
tests.test_stack ‑ test_apply_matches_src[A B-0.0-None]
tests.test_stack ‑ test_apply_matches_src[A B-0.5-1.0]
…

♻️ This comment has been updated with latest results.

Assisted-by: GitHub Copilot:claude-sonnet-5.5
Assisted-by: GitHub Copilot:claude-opus-5.5
@Panadestein
Panadestein merged commit bd78e23 into main Oct 15, 2026
15 checks passed
@Panadestein
Panadestein deleted the copilot/oversampled-sketch-svd-truncation branch October 15, 2026 12:50
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.

Oversampled sketch followed by an exact SVD truncation

3 participants