Repository navigation
Add case 4: vertex Bethe-Salpeter contraction - #10
Draft
SamuelBadr wants to merge 1 commit into
Draft
SamuelBadr wants to merge 1 commit into
SamuelBadr wants to merge 1 commit into
Conversation
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.
SamuelBadr
force-pushed
the
vertex-bse-contraction
branch
from
October 29, 2026 09:14
b67e6ae to
ee9bcb6
Compare
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.
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(ν₁, ν', ω):
hadamardweights Γ by the bubble χ0 (diagonal in ω and ν₁), andpartial_contractjoins the result with F (contracting ν₁, diagonal in ω). Both steps are timed together, with two arms,zipupandfit(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 withcurlinto.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.shand CI (a smoke run at τ = 1e-4) are updated accordingly. One new direct dependency,hdf5-metno(already in the graph throughtensor4all-hdf5), to read the reference values. Noresult/sweep is included.Measured
One thread, AMD EPYC 9224 (a shared machine, so the times are indicative), tensor4all-rs
a515738:"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), andreport.pyon the committedlinux-ryzen-ai-9-hx-470sweep plus these records.The MPS groups store
llim = -1(no orthogonality center) because of tensor4all/tensor4all-rs#1041:load_mpsrejects ITensorMPS'sllim = 0.