Remove the MatricizeStyle trait - #238
Merged
Merged
Conversation
Every matricize style was a function of the array type, so the hooks dispatch on the array, `unmatricize` on the matrix, and `MatricizeContract` becomes a plain algorithm token. The fermionic twist of the right contraction factor moves to a `matricize_inputs` hook that sees both operands. Only a `DenseArray` declares the reshape a view. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #238 +/- ##
==========================================
+ Coverage 82.00% 83.29% +1.29%
==========================================
Files 29 29
Lines 1006 946 -60
==========================================
- Hits 825 788 -37
+ Misses 181 158 -23
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:
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The kernel's non-view destination path is `a1_mat * a2_mat` followed by one accumulating scatter, so `α` and `β` are folded into the permuted pass and the destination is never gathered. `unmatricize!` is its `(1, 0)` case. Also states the `DenseArray` view rule as a contract in the comment. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
An array family whose contraction needs more than the matricize fold now owns its own `ContractAlgorithm` and `contractpermopadd!` method instead of hooking into the dense kernel, so the hook has no caller. Input validation moves from the algorithm-less entry into each algorithm's kernel, which is a public rung callable directly. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
mtfishman
marked this pull request as ready for review
September 28, 2026 20:30
mtfishman
enabled auto-merge (squash)
September 28, 2026 20:30
mtfishman
added a commit
to ITensor/GradedArrays.jl
that referenced
this pull request
Sep 28, 2026
## Summary Follows TensorAlgebra 0.22 (ITensor/TensorAlgebra.jl#238), which removes `MatricizeStyle`: the matricize hooks dispatch on the array type, and graded contraction becomes its own algorithm, `GradedContract`, carrying the fermionic twist. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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
Removes
MatricizeStyle: every style was a function of the array type, so the matricize hooks dispatch on the array, and a family needing more than the fold owns its ownContractAlgorithm. Kernels validate their own inputs. Lands together with ITensor/GradedArrays.jl#284.