Repository navigation
Replace contract_network with prod_tensors and an explicit ContractionTree - #203
Merged
Merged
Conversation
Contraction orders become an explicit binary tree over the network's keys, contracted by `prod_tensors(tensors, tree)`, in place of the symbolic expressions built out of ITensorBase's lazy layer. Order finding moves here, its only consumer. A `NormNetwork` is contracted through `flatten_network`, which gives each layer its own vertex so the site index they share is visible to the optimizer. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #203 +/- ##
==========================================
+ Coverage 88.34% 88.65% +0.30%
==========================================
Files 16 17 +1
Lines 678 714 +36
==========================================
+ Hits 599 633 +34
- Misses 79 81 +2
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:
|
`prod_tensors` now takes either a `ContractionTree` or an algorithm that finds one, so `contract_network` and its `Exact` wrapper are no longer needed. A branch's children get their own `Branch` type, which keeps a leaf distinguishable from a branch even when a vertex label is itself a 2-tuple. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ContractionTreecontract_network with prod_tensors and an explicit ContractionTree
`ContractionTree` wrapped its two-arm union with `WrappedUnions` but only ever called `unwrap`, so a plain struct does the same job without the dependency. The greedy search now reads `inds`, the name this stack uses for a tensor's indices, rather than going through `axes`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mtfishman
added a commit
to ITensor/ITensorBase.jl
that referenced
this pull request
Oct 6, 2026
…name` (#270) ## Summary Removes `LazyNamedTensor`, `SymbolicNamedTensor` and the contraction-order finding built on them, along with five dependencies. Order finding moves up to ITensorNetworksNext (ITensor/ITensorNetworksNext.jl#203), its only consumer. Also renames `dim` to `findname`, since it returns a position rather than a size. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
ITensorBase 0.16.0 is registered, so the branch pin that let CI resolve the unreleased dependency is no longer needed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Matches the greedy search, which already reads `inds` rather than going through `axes`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
contract_network with prod_tensors and an explicit ContractionTreecontract_network with prod_tensors and an explicit ContractionTree
mtfishman
marked this pull request as ready for review
October 7, 2026 01:16
mtfishman
enabled auto-merge (squash)
October 7, 2026 01:16
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
Contraction orders become an explicit
ContractionTreeover the network's keys, andprod_tensorsis the single way to contract, taking either a tree or an algorithm that finds one. This removescontract_network. Order finding moves here from ITensorBase (ITensor/ITensorBase.jl#270), its only consumer, so the lazy layer there could be removed.