Skip to content

Support TensorAlgebra 0.14 graded contraction and add!#198

Merged
mtfishman merged 3 commits into
mainfrom
mf/scalar-unmatricize-graded
Jul 1, 2026
Merged

Support TensorAlgebra 0.14 graded contraction and add!#198
mtfishman merged 3 commits into
mainfrom
mf/scalar-unmatricize-graded

Conversation

@mtfishman

@mtfishman mtfishman commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

Fixes graded contraction and add! under TensorAlgebra 0.14's StridedView-based permute path (ITensor/TensorAlgebra.jl#194). unmatricize(::SectorFusion, ::FusedGradedMatrix, …) now returns a graded rank-0 array for the scalar case, matching the graded result it returns at every other rank, so the permute-add back into the destination dispatches to the graded bipermutedimsopadd! overload rather than the generic strided one. It also defines StridedViews.StridedView(::AbelianSectorArray) as a view of its data block, so adding an AbelianSectorArray into a plain dense array works.

Fixes graded contraction and `add!` under TensorAlgebra 0.14's `StridedView`-based permute path (ITensor/TensorAlgebra.jl#194). `unmatricize(::SectorFusion, ::FusedGradedMatrix, …)` now returns a graded rank-0 array for the scalar case, matching the graded result it returns at every other rank, so the permute-add back into the destination dispatches to the graded `bipermutedimsopadd!` overload rather than the generic strided one. It also defines `StridedViews.StridedView(::AbelianSectorArray)` as a view of its data block, so adding an `AbelianSectorArray` into a plain dense array works.
The rank-0 `unmatricize` test still expected a plain `Array{Float64, 0}`. Assert an `AbelianGradedArray` instead, matching the graded rank-0 result that `unmatricize` now returns.
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.73%. Comparing base (da2b578) to head (4e4c1cb).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #198   +/-   ##
=======================================
  Coverage   81.72%   81.73%           
=======================================
  Files          23       23           
  Lines        1850     1851    +1     
=======================================
+ Hits         1512     1513    +1     
  Misses        338      338           
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.

TensorAlgebra 0.14 and SparseArraysBase 0.10.4 are registered, so the `[compat]` bounds resolve against the releases and the branch pins are no longer needed.
@mtfishman mtfishman changed the title [WIP] Support TensorAlgebra 0.14 graded contraction and add! Support TensorAlgebra 0.14 graded contraction and add! Jul 1, 2026
@mtfishman mtfishman marked this pull request as ready for review July 1, 2026 03:21
@mtfishman mtfishman enabled auto-merge (squash) July 1, 2026 03:21
@mtfishman mtfishman merged commit a15f9a8 into main Jul 1, 2026
25 of 28 checks passed
@mtfishman mtfishman deleted the mf/scalar-unmatricize-graded branch July 1, 2026 03:30
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