You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Drop BP default_message; explicit identity_messages discipline (#371)
## Summary
- Loopy BP on QN-graded networks was silently NaN-ing because the
single-leg `delta(i)` initial messages collapsed half the QN sectors to
empty blocks. Replaces the implicit `default_message` family with an
explicit two-leg `delta(b, k)` `identity_messages` that pairs bra and
ket link inds, keeping the QN sectors aligned through the contractions.
- `BeliefPropagationCache(ptn)` now starts with an empty messages dict.
Form-network `identity_messages(fn, ptn)` builds the bra/ket pairings
from cross-partition vertex pairs and works for both per-vertex and
coarser partitionings (e.g. column-grouped 2D grids).
- The only auto-init lives on `QuadraticFormNetwork` (structurally
ψ-vs-ψ, so identity messages are canonical):
`scalar`/`logscalar`/`normalize`/`rescale`/`expect` on a QFN-backed
network thread identity messages on a loopy quotient graph. Asymmetric
form networks (general `LFN`/`BFN` built from ϕ ≠ ψ) fall through to the
generic path, and the caller must supply messages — `identity_messages`
isn't well-defined when bra and ket link dims can differ.
- Adds a 4-cycle QN-conserving regression test routed through
`scalar(QuadraticFormNetwork(ψ); alg = "bp")` that pins the old NaN
failure mode.
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments