Skip to content

Commit 4c69e17

Browse files
authored
Improve BlockUnitRange indexing (#175)
1 parent ad602c6 commit 4c69e17

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BlockSparseArrays"
22
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.10.2"
4+
version = "0.10.3"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/BlockArraysExtensions/blockedunitrange.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,7 @@ function blockedunitrange_getindices(
156156
# mapping `indices` outputs a `BlockVector`
157157
# which is harder to reason about.
158158
blocks = map(index -> a[index], Vector(indices))
159-
# We pass `length.(blocks)` to `mortar` in order
160-
# to pass block labels to the axes of the output,
161-
# if they exist. This makes it so that
162-
# `only(axes(a[indices])) isa `GradedUnitRange`
163-
# if `a isa `GradedUnitRange`, for example.
164-
return mortar(blocks, length.(blocks))
159+
return mortar(blocks, (mortar_axis(map(axis, blocks)),))
165160
end
166161

167162
# TODO: Move this to a `BlockArraysExtensions` library.

0 commit comments

Comments
 (0)