Skip to content

Refactor TensorNetwork type; add NormNetwork struct. #119

Merged
mtfishman merged 124 commits into
mainfrom
jd/tensornetwork-refactor
Jun 30, 2026
Merged

Refactor TensorNetwork type; add NormNetwork struct. #119
mtfishman merged 124 commits into
mainfrom
jd/tensornetwork-refactor

Conversation

@jack-dunham

Copy link
Copy Markdown
Contributor

This PR refactors the TensorNetwork data type to include a reverse index map, and to be stricter about it's construction and how it's tensors can be set.

This PR also adds NormNetwork type, as a wrapper around a TensorNetwork, to represent the norm of a tensor network.

JoeyT1994 and others added 30 commits January 6, 2026 09:55
Introduce `BeliefPropagationProblem` wrapper to hold the cache and the
error `diff` field.

Also simplifies some kwargs wrangling.
Also includes some fixes to the way `TensorNetwork` types are
constructed based on index structure.
…instead of trying to operate on existing graphs

The reason for this is:
- One only cares about the edges of the input graph
- A simple graph cannot be used as it "forgets" its edge names resulting
in recursion
- As shown with `TensorNetwork`, removing edges may not always be
defined.
This was caused by the change to the `cache` being backed by a directed
graph.
Comment thread src/normnetwork.jl Outdated
Comment thread src/normnetwork.jl Outdated
Comment thread src/normnetwork.jl Outdated
Comment thread src/beliefpropagation/normnetwork.jl Outdated
Comment thread src/normnetwork.jl Outdated
Comment thread test/test_normnetwork.jl Outdated
@jack-dunham jack-dunham force-pushed the jd/tensornetwork-refactor branch from 9c1a8ca to 301dcff Compare June 29, 2026 14:33
Comment thread src/beliefpropagation/normnetwork.jl Outdated
Comment thread test/test_basics.jl Outdated
@jack-dunham jack-dunham force-pushed the jd/tensornetwork-refactor branch from a556050 to 8b05059 Compare June 30, 2026 14:41
@mtfishman mtfishman enabled auto-merge (squash) June 30, 2026 17:38
@mtfishman mtfishman merged commit 0ab57c1 into main Jun 30, 2026
18 checks passed
@mtfishman mtfishman deleted the jd/tensornetwork-refactor branch June 30, 2026 17:42
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.

4 participants