Skip to content

Handle disconnected TreeTN fit contractions#511

Merged
shinaoka merged 2 commits into
mainfrom
codex/disconnected-treetn-fit-contractions
May 20, 2026
Merged

Handle disconnected TreeTN fit contractions#511
shinaoka merged 2 commits into
mainfrom
codex/disconnected-treetn-fit-contractions

Conversation

@shinaoka
Copy link
Copy Markdown
Member

Summary

  • Insert dimension-1 dummy contraction links for nodewise outer-product spectators in partial_contract so compatible TreeTN topologies can contract without falling back to dense materialization.
  • Make TreeTN fit environment contractions component-aware, contracting disconnected local tensor components separately and combining them by outer product.
  • Add regression coverage for partial contraction spectator nodes and fit contractions whose local site space contracts away.

Rationale

The QuanticsNEGF port exposed TreeTN topologies where local node tensors can share topology but have no contractable index at a matching node. Julia-style tensor operations treat this as a valid outer-product spectator case; the previous TreeTN path could fail with disconnected contraction errors.

Validation

Run with RAYON_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 VECLIB_MAXIMUM_THREADS=1:

  • cargo test -p tensor4all-treetn --release -- --nocapture
  • cargo clippy -p tensor4all-treetn --all-targets --release -- -D warnings
  • Downstream quanticsnegf-rs-2: cargo clippy --workspace --all-targets --release -- -D warnings
  • Downstream quanticsnegf-rs-2: cargo test --release -- --nocapture

@shinaoka shinaoka merged commit e32af35 into main May 20, 2026
6 checks passed
@shinaoka shinaoka deleted the codex/disconnected-treetn-fit-contractions branch May 20, 2026 22:30
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