Take unmatricize domain axes un-dualized (matching similar_map)#199
Merged
Conversation
mtfishman
added a commit
to ITensor/GradedArrays.jl
that referenced
this pull request
Jul 1, 2026
## Summary Adapts the `SectorFusion` `unmatricize` overloads to TensorAlgebra 0.16 (ITensor/TensorAlgebra.jl#199), which takes `unmatricize` domain axes codomain-facing (un-dualized). The terminal overloads re-dualize the domain axes with `conj` before reconstructing the graded array, and the round-trip tests pass their domain axes un-dualized to match. ## TODO - [ ] Remove the `[sources]` pins on `TensorAlgebra` and `SparseArraysBase` once both register
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #199 +/- ##
==========================================
+ Coverage 83.10% 83.33% +0.22%
==========================================
Files 22 22
Lines 669 672 +3
==========================================
+ Hits 556 560 +4
+ Misses 113 112 -1
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:
|
5115606 to
0d8c8c6
Compare
`unmatricize` now takes its domain axes codomain-facing (un-dualized), the same convention `similar_map` already uses, rather than in the stored dualized form. The two allocation entry points now agree, and a backend receives the actual domain spaces instead of the dualized index spaces. Each fusion style re-dualizes the domain axes with `conj` (a no-op on a dense axis) when it stores them, so dense arrays are unaffected and only graded backends observe the change. This is a breaking change to the `unmatricize` axis convention: a caller reconstructing an array whose domain axis is `dual(r)` now passes `r`.
## Summary Adds `bipartition_axes`, a `bipartition` that presents the domain group un-dualized, and routes the factorization, matrix-function, and `unmatricizeperm` callers through it. This keeps the domain `conj` in one place so the `unmatricize` axis convention is applied consistently, rather than repeating `conj.(axes_domain)` at each call site. The single-factor rank-axis reconstructions keep their local `conj`, since no bipartition is involved there.
0d8c8c6 to
6a93380
Compare
mtfishman
added a commit
to ITensor/SparseArraysBase.jl
that referenced
this pull request
Jul 2, 2026
## Summary Widens the TensorAlgebra compat to `0.15, 0.16`. TensorAlgebra 0.16 (ITensor/TensorAlgebra.jl#199) changes the `unmatricize` domain-axis convention to codomain-facing (un-dualized), but the sparse extension forwards `unmatricize` to `ReshapeFusion` over dense ranges where that change is a no-op, so both versions work with no code change.
mtfishman
added a commit
to ITensor/GradedArrays.jl
that referenced
this pull request
Jul 2, 2026
Adapts the `SectorFusion` `unmatricize` overloads to TensorAlgebra 0.16 (ITensor/TensorAlgebra.jl#199), which takes `unmatricize` domain axes codomain-facing (un-dualized). The terminal overloads re-dualize the domain axes with `conj` before reconstructing the graded array, and the round-trip tests pass their domain axes un-dualized to match. - [ ] Remove the `[sources]` pins on `TensorAlgebra` and `SparseArraysBase` once both register
mtfishman
added a commit
to ITensor/GradedArrays.jl
that referenced
this pull request
Jul 2, 2026
Adapts the `SectorFusion` `unmatricize` overloads to TensorAlgebra 0.16 (ITensor/TensorAlgebra.jl#199), which takes `unmatricize` domain axes codomain-facing (un-dualized). The terminal overloads re-dualize the domain axes with `conj` before reconstructing the graded array, and the round-trip tests pass their domain axes un-dualized to match. - [ ] Remove the `[sources]` pins on `TensorAlgebra` and `SparseArraysBase` once both register
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
unmatricizenow takes its domain axes codomain-facing (un-dualized), the same conventionsimilar_mapalready uses, rather than in the stored dualized form. The two allocation entry points now agree, and a backend receives the actual domain spaces instead of the dualized index spaces.Each fusion style re-dualizes the domain axes with
conj(a no-op on a dense axis) when it stores them, so dense arrays are unaffected and only graded backends observe the change. Abipartition_axeshelper applies this at the generic call sites, keeping the domainconjin one place. This is a breaking change to theunmatricizeaxis convention: a caller reconstructing an array whose domain axis isdual(r)now passesr.