[WIP] Add fermionic support to belief-propagation simple update#155
Draft
mtfishman wants to merge 6 commits into
Draft
[WIP] Add fermionic support to belief-propagation simple update#155mtfishman wants to merge 6 commits into
mtfishman wants to merge 6 commits into
Conversation
Keep belief-propagation messages as operators and normalize them by their trace rather than an entrywise sum, which stays sign correct on fermionic bonds where the entrywise sum can flip the odd-parity block. Gauge the simple-update tensors with the balanced square root and inverse square root of the Hermitian-projected bond messages. Depends on the operator-form Hermitian factorizations added in the ITensorBase mf/operator-sqrth branch.
The BP simple-update gauge absorbs an operator-valued square root of each incoming message into the state tensor. Contracting it with `*` returns an operator, so the updated state is written back as an operator and rejected by the state network. Take the underlying tensor of each gauge (`ITB.state`) before contracting, so the gauged state stays a plain tensor while the index arrows still carry the fermion sign. Requires the operator `dimnametype` fix from ITensor/ITensorBase.jl#225. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Store both directed messages of a bond uniformly as the bond (ket output) and an auxiliary leg (bra input), with conj(S)/S into the two endpoints, and build the initial identity messages on the source-side ket axis so their ket leg is dual to the destination bond. The gauge projects the message Hermitian and takes the balanced square-root / inverse-square-root in whichever bipartition is positive semidefinite, which recovers the odd-parity fermion sign in both directions. Migrate the message-update path to the ITensorBase 0.13 outputnames/inputnames API and bump to 0.9.10.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #155 +/- ##
==========================================
- Coverage 84.89% 0.00% -84.90%
==========================================
Files 15 13 -2
Lines 662 640 -22
==========================================
- Hits 562 0 -562
- Misses 100 640 +540
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Replace the try/catch PSD-bipartition selection in `message_gauge` with a plain transposed gauge. The two directed bond messages are now built from the PSD singular-value message `conj(S)`. The reverse direction is its arrow flip via `dualize`, which toggles `isdual` and keeps the odd-parity block, rather than `conj`, which negates the odd block and breaks PSD. Free-fermion validation is exact to machine precision on trees with no fallback. `dualize` is a temporary element-wise hack that pulls in a temporary `GradedArrays` dependency. Both stand in for a proper backend-agnostic duality-flip primitive. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The reverse directed message is S with its bond orientation reversed, which is the ribbon twist of S (-1 on the odd-parity sector). Both directed messages are then positive semidefinite in the transposed gauge, so the gauge needs no fallback. This replaces the element-wise dualize helper with a name-keyed twist and twist!. Also simplify the belief-propagation message unwrap to state.(messages), relying on state being idempotent.
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.
Summary
Adds fermionic support to the belief-propagation simple-update apply-gate (
apply_operators). On a fermionic bond the odd-parity sector carries a sign that a plain square-root gauge gets wrong, so the gate produced unphysical results or hit a negative eigenvalue insqrth.Both directed messages of a bond are now stored uniformly, with the bond as the operator output (ket) and an auxiliary leg as the input (bra),
conj(S)into one endpoint andSinto the other. The initial identity messages are built on the source-side ket axis so their ket leg is dual to the destination bond and the gauge contracts back into the state. The gauge projects each message Hermitian and takes the balanced square-root / inverse-square-root in whichever bipartition is positive semidefinite, which recovers the odd-parity sign in both directions. Messages stay operator-valued through the update.The bosonic path is unchanged. Free-fermion imaginary-time evolution on chains matches the exact single-particle reference to machine precision on trees.
TODO
FermionParity) apply-gate test coverage