Skip to content

Add case 4: vertex Bethe-Salpeter contraction - #10

Draft
SamuelBadr wants to merge 1 commit into
mainfrom
vertex-bse-contraction
Draft

SamuelBadr wants to merge 1 commit into
mainfrom
vertex-bse-contraction

Conversation

@SamuelBadr

@SamuelBadr SamuelBadr commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Adds a fourth maintained case, vertex_bse_contraction, as @shinaoka asked: a typical MPO-MPO contraction for two-particle vertices, the plain (unpatched) contraction.

The case

It contracts vertices of the single-impurity Anderson model as a Bethe-Salpeter equation does, Φ(ν, ν', ω) = Σ_ν₁ Γ(ν, ν₁, ω) χ0(ν₁, ω) F(ν₁, ν', ω): hadamard weights Γ by the bubble χ0 (diagonal in ω and ν₁), and partial_contract joins the result with F (contracting ν₁, diagonal in ω). Both steps are timed together, with two arms, zipup and fit (one sweep), truncating at τ/10 per bond. The error is the relative L2 error against the exact Φ at 4096 points; a run fails if it exceeds 10 τ.

The inputs are fixed data, so they are not generated: three ITensorMPS HDF5 files (τ = 1e-4, 1e-6, 1e-8; 60 MB together) are assets of the release vertex-bse-inputs-v1, which also describes their layout. The binary downloads a file once with curl into .cache/inputs/vertex_bse/ and reuses it afterwards; every run checks the file's structure and the result against the exact values. The default sweep is τ = 1e-4 and 1e-6; 1e-8 is opt-in.

AGENTS.md, the README, report.py (a Case 4 table and checks), run_all.sh and CI (a smoke run at τ = 1e-4) are updated accordingly. One new direct dependency, hdf5-metno (already in the graph through tensor4all-hdf5), to read the reference values. No result/ sweep is included.

Measured

One thread, AMD EPYC 9224 (a shared machine, so the times are indicative), tensor4all-rs a515738:

τ input χ (Γ / F) arm time relative L2 error best attainable peak memory of the process
1e-4 94 / 103 zipup 17 s 5.93e-5 5.89e-5 1.5 GB
1e-4 94 / 103 fit 33 s 5.92e-5 5.89e-5
1e-6 259 / 272 zipup 521 s 6.91e-7 6.74e-7 18 GB
1e-6 259 / 272 fit 821 s 6.82e-7 6.74e-7

"Best attainable" is the error of the exact contraction of the rounded inputs. τ = 1e-8 needs considerably more memory and was not run to completion. At this revision the fit starts from the zip-up result, so it costs at least as much as the zip-up.

Checked: cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test --release, the download and cache path (a miss, then a hit), and report.py on the committed linux-ryzen-ai-9-hx-470 sweep plus these records.

The MPS groups store llim = -1 (no orthogonality center) because of tensor4all/tensor4all-rs#1041: load_mps rejects ITensorMPS's llim = 0.

@SamuelBadr
SamuelBadr marked this pull request as draft October 29, 2026 09:03
Contracts two-particle vertices of the single-impurity Anderson model as a
Bethe-Salpeter equation does, Φ = Σ_ν₁ Γ χ0 F: hadamard weighting (diagonal in
ω and ν₁) and partial_contract join (contracting ν₁, diagonal in ω), timed
together, with zip-up and fit arms. The inputs are fixed files from the
vertex-bse-inputs-v1 release (τ = 1e-4, 1e-6, 1e-8), downloaded once into the
input cache; the error is measured against the exact result at 4096 points.
Default sweep τ = 1e-4 and 1e-6; CI smokes 1e-4.
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.

1 participant