From 8f562ba3dc3cb61fb5b83df8e00d6eeb82cf014a Mon Sep 17 00:00:00 2001 From: mtfishman Date: Thu, 4 Sep 2025 12:05:41 -0400 Subject: [PATCH] Improve blockrange indexing --- Project.toml | 2 +- src/BlockArraysExtensions/blockedunitrange.jl | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 648e128..de960f8 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BlockSparseArrays" uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4" authors = ["ITensor developers and contributors"] -version = "0.10.2" +version = "0.10.3" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" diff --git a/src/BlockArraysExtensions/blockedunitrange.jl b/src/BlockArraysExtensions/blockedunitrange.jl index b111c83..230591d 100644 --- a/src/BlockArraysExtensions/blockedunitrange.jl +++ b/src/BlockArraysExtensions/blockedunitrange.jl @@ -156,12 +156,7 @@ function blockedunitrange_getindices( # mapping `indices` outputs a `BlockVector` # which is harder to reason about. blocks = map(index -> a[index], Vector(indices)) - # We pass `length.(blocks)` to `mortar` in order - # to pass block labels to the axes of the output, - # if they exist. This makes it so that - # `only(axes(a[indices])) isa `GradedUnitRange` - # if `a isa `GradedUnitRange`, for example. - return mortar(blocks, length.(blocks)) + return mortar(blocks, (mortar_axis(map(axis, blocks)),)) end # TODO: Move this to a `BlockArraysExtensions` library.