Skip to content

Take unmatricize domain axes un-dualized (matching similar_map)#199

Merged
mtfishman merged 2 commits into
mainfrom
mf/unmatricize-domain-convention
Jul 2, 2026
Merged

Take unmatricize domain axes un-dualized (matching similar_map)#199
mtfishman merged 2 commits into
mainfrom
mf/unmatricize-domain-convention

Conversation

@mtfishman

@mtfishman mtfishman commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

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. A bipartition_axes helper applies this at the generic call sites, keeping the domain conj in one place. This is a breaking change to the unmatricize axis convention: a caller reconstructing an array whose domain axis is dual(r) now passes r.

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

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.33%. Comparing base (9281f33) to head (6a93380).

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     
Flag Coverage Δ
docs 27.08% <37.50%> (+0.22%) ⬆️

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.

@mtfishman mtfishman force-pushed the mf/unmatricize-domain-convention branch from 5115606 to 0d8c8c6 Compare July 2, 2026 00:38
mtfishman added 2 commits July 1, 2026 20:58
`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.
@mtfishman mtfishman force-pushed the mf/unmatricize-domain-convention branch from 0d8c8c6 to 6a93380 Compare July 2, 2026 00:59
@mtfishman mtfishman marked this pull request as ready for review July 2, 2026 01:04
@mtfishman mtfishman enabled auto-merge (squash) July 2, 2026 01:04
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 mtfishman merged commit 4a91f95 into main Jul 2, 2026
29 of 31 checks passed
@mtfishman mtfishman deleted the mf/unmatricize-domain-convention branch July 2, 2026 01:25
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
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.

1 participant