Conversation
…ockArrays extension
Replaces TensorAlgebra's blocked-tuple type family with a single concrete `BiTuple`, and removes the BlockArrays extension.
Matricization, contraction, and factorizations only ever split a tensor's indices into two groups, a codomain and a domain, so the general N-block machinery (a family of `AbstractBlockTuple` / `BlockedTuple` / blocked-permutation types plus a BlockArrays-style `Block` / `mortar` / broadcast apparatus) was more than that use needs. It is all replaced by one two-field type:
```julia
struct BiTuple{N1, N2, T1 <: NTuple{N1, Any}, T2 <: NTuple{N2, Any}}
t1::T1
t2::T2
end
```
The builder names are unchanged (`tuplemortar`, `permmortar`, `blockedperm`, `blockedpermvcat`, `blockedperm_indexin`, `trivialbiperm`, `blockpermute`), backed by a small accessor surface (`blocks`, `firstblock`, `lastblock`, `blocklengths`). A biperm is a `BiTuple` of `Int`s whose permutation property the perm builders validate at construction, the way `permutedims(a, perm)` validates its `perm`, rather than encoding it in a dedicated type.
Removing the BlockArrays-style apparatus leaves `TensorAlgebraBlockArraysExt` with nothing to provide, so the extension and the `BlockArrays` weak-dependency are dropped. The `BlockReshapeFusion` matricization style it defined for block-structured arrays moves to GradedArrays, its only consumer.
This is a breaking release: the removed blocked-tuple and blocked-permutation types, the `Block*` family, the N-block and ellipsis `blockedpermvcat` forms, and the BlockArrays extension are all gone. Downstream packages that only build and destructure biperms keep working through the unchanged builder names.
This was referenced Jun 24, 2026
…ple_indexin Collapses the remaining blocked-tuple interface to direct BiTuple field access plus a small set of plain-tuple helpers. bipartition splits a tuple into its two groups (optionally permuting), biindexin locates two label groups in a collection, and tuple_indexin is the tuple-preserving indexin. Drops trivialbiperm, tupleoneto, blockedperm_indexin, and the BaseExtensions submodule, whose remaining contents were either dead code or folded into tuple_indexin.
…jects The subproject manifests still pinned 0.10, which fails resolution and CheckCompatBounds now that the package is 0.11.0.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #181 +/- ##
==========================================
- Coverage 81.56% 78.59% -2.97%
==========================================
Files 27 20 -7
Lines 987 654 -333
==========================================
- Hits 805 514 -291
+ Misses 182 140 -42
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:
|
The function returns the codomain/domain biperms for a contraction, so the name now matches what it produces, in line with the BiTuple vocabulary. Renames the file to match.
Renames the stale BlockPermutation comment, the biperm helper's blocklength1 argument, and the unmatricize biaxes parameter to the BiTuple group vocabulary.
biperm(t, t1, t2) locates two partitioning groups within t and returns their position tuples (p1, p2), replacing the internal biindexin. Unlike the general indexin it asserts that the groups partition t, checking the lengths add up, so the result is always a valid bipartitioned permutation. The old split-builder biperm(perm, ::Val) folds into the existing BiTuple constructor and bipartition, and biperms returns plain 2-tuples since its results were always split. biperm, bipartition, and BiTuple are now marked public.
BiTuple, biperm, and bipartition are now marked public, so they appear in names(TensorAlgebra) on Julia 1.11+.
mtfishman
added a commit
to ITensor/SparseArraysBase.jl
that referenced
this pull request
Jun 24, 2026
Adds the in-flight sources pin for TensorAlgebra 0.11 (ITensor/TensorAlgebra.jl#181) so CI can resolve the unregistered version, and bumps the test project TensorAlgebra compat to 0.11 to match the root.
No downstream package names BiTuple, and biperm and bipartition return plain tuples, so BiTuple drops out of the public declaration and stays an internal implementation detail. Adds a docstring for the public bipartition and tightens its index-group method to take a Tuple, matching the split-by-length method and every caller.
Every contract, factorization, matrix-function, and matricize/unmatricize method that took a bundled BiTuple did nothing but splat its two groups into the method that takes them as separate tuple arguments, so the BiTuple form was a redundant public entry point. Drop those overloads, leaving the labels and two-tuple forms, and rewrite the few internal factorization call sites that built a BiTuple just to feed unmatricize so they pass the two axis tuples directly. BiTuple stays as an internal bundle for the allocation and permutation helpers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mtfishman
added a commit
to ITensor/SparseArraysBase.jl
that referenced
this pull request
Jun 24, 2026
## Summary Requires TensorAlgebra 0.11, where the blocked-permutation types this extension imported but never used are removed (ITensor/TensorAlgebra.jl#181). `SparseArraysBaseTensorAlgebraExt` imported `BlockedTrivialPermutation` and `BlockedTuple` without using them, so they are dropped from the import. The extension uses only the core `ReshapeFusion` style and `matricize` / `unmatricize`, which TensorAlgebra 0.11 keeps unchanged.
mtfishman
added a commit
to ITensor/ITensorBase.jl
that referenced
this pull request
Jun 24, 2026
## Summary Moves ITensorBase onto TensorAlgebra 0.11 (ITensor/TensorAlgebra.jl#181) and requires distinct dimension names when constructing an ITensor. `matricize_nameddims` resolves its codomain and domain permutations through `TensorAlgebra.biperm`, the public group-locating helper from that release, in place of the removed blocked-permutation builders. The dead partial-fusion branch in `matricize_nameddims`, which only ever worked when every dimension was assigned to a group, is dropped. The ITensor inner constructor now collects the dimension names into a `Vector{DimName}` and requires them to be distinct, throwing otherwise. Duplicate dimension names leave contraction and matricization ambiguous, so rejecting them at construction surfaces the problem at the source rather than deep in a later operation. This behavior change is breaking, hence the minor bump to 0.8.0. --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
mtfishman
added a commit
to ITensor/GradedArrays.jl
that referenced
this pull request
Jun 24, 2026
…rAlgebra extension (#181) ## Summary Defines the `BlockReshapeFusion` matricization style directly in `src/fusion.jl` instead of borrowing it from TensorAlgebra's BlockArrays extension, which is removed in ITensor/TensorAlgebra.jl#181. `src/fusion.jl` now declares `struct BlockReshapeFusion <: FusionStyle`, where it previously aliased the type the extension exposed. GradedArrays already owned the graded `matricize` / `unmatricize` / `tensor_product_axis` methods on this style, so nothing else moves. One spot that previously destructured a biperm through the extension's `blocks` bridge now splits the axes with `bipartition`. --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
mtfishman
added a commit
to ITensor/ITensorNetworksNext.jl
that referenced
this pull request
Jun 24, 2026
## Summary Moves ITensorNetworksNext onto the TensorAlgebra 0.11 stack: bumps the TensorAlgebra compat bound to 0.11 (ITensor/TensorAlgebra.jl#181) and the ITensorBase compat bound to 0.8 (ITensor/ITensorBase.jl#184), the release that moves onto it. ITensorNetworksNext uses none of the removed blocked-tuple types and constructs no duplicate-named tensors, so no code changes are needed. This also supersedes #120, the CompatHelper bump for ITensorBase. --------- Co-authored-by: Claude Opus 4.8 <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
Replaces TensorAlgebra's blocked-tuple type family with a single concrete
BiTuple, and removes the BlockArrays extension.Matricization, contraction, and factorizations only ever split a tensor's indices into two groups, a codomain and a domain, so the general N-block machinery and its BlockArrays-style apparatus were more than that use needs. Internally the two groups are carried by a
BiTuple, a two-field tuple that still iterates and indexes as the flat tuple(t1..., t2...). The user-facing surface collapses to two plain-tuple helpers:bipartitionsplits a tuple into its two groups, andbipermlocates two partitioning groups within a collection. Both return the groups as an ordinary pair of tuples, so callers pass two tuples rather than a dedicated bundle type.With the BlockArrays-style apparatus gone, the
TensorAlgebraBlockArraysExtextension and theBlockArraysweak-dependency are dropped, and theBlockReshapeFusionmatricization style it defined moves to its only consumer, GradedArrays (ITensor/GradedArrays.jl#181).This is a breaking release.