Skip to content

Refactor TensorNetwork type; add NormNetwork struct. #119

Draft
jack-dunham wants to merge 93 commits into
mainfrom
jd/tensornetwork-refactor
Draft

Refactor TensorNetwork type; add NormNetwork struct. #119
jack-dunham wants to merge 93 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.
jack-dunham and others added 26 commits May 7, 2026 14:30
Co-authored-by: Matthew Fishman <mtfishman@users.noreply.github.com>
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.54450% with 83 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.32%. Comparing base (1b5ea47) to head (7c51b20).

Files with missing lines Patch % Lines
src/normnetwork.jl 0.00% 32 Missing ⚠️
src/abstracttensornetwork.jl 5.00% 19 Missing ⚠️
src/tensornetwork.jl 80.61% 19 Missing ⚠️
src/beliefpropagation/messagecache.jl 60.60% 13 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (1b5ea47) and HEAD (7c51b20). Click for more details.

HEAD has 7 uploads less than BASE
Flag BASE (1b5ea47) HEAD (7c51b20)
6 1
docs 3 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #119      +/-   ##
==========================================
- Coverage   73.30%   65.32%   -7.98%     
==========================================
  Files          21       19       -2     
  Lines         929      845      -84     
==========================================
- Hits          681      552     -129     
- Misses        248      293      +45     
Flag Coverage Δ
docs 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ITensorBot

ITensorBot commented Jun 8, 2026

Copy link
Copy Markdown
Member

Your PR no longer requires formatting changes. Thank you for your contribution!

@jack-dunham jack-dunham force-pushed the jd/tensornetwork-refactor branch from 1310cc2 to 7c51b20 Compare June 9, 2026 20:34
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