Skip to content

Commit 06aab1d

Browse files
committed
Merge branch 'main' into DualSector
2 parents 0bbcc8e + e1219b1 commit 06aab1d

File tree

11 files changed

+103
-34
lines changed

11 files changed

+103
-34
lines changed

.github/workflows/IntegrationTest.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "IntegrationTest"
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags: '*'
8+
paths:
9+
- 'Project.toml'
10+
pull_request:
11+
paths:
12+
- 'Project.toml'
13+
14+
jobs:
15+
integration-test:
16+
name: "IntegrationTest"
17+
strategy:
18+
matrix:
19+
repo:
20+
- 'ITensor/ITensorBase.jl'
21+
- 'ITensor/NamedDimsArrays.jl'
22+
- 'ITensor/QuantumOperatorDefinitions.jl'
23+
- 'ITensor/TensorAlgebra.jl'
24+
uses: "ITensor/ITensorActions/.github/workflows/IntegrationTest.yml@main"
25+
with:
26+
localregistry: "https://github.com/ITensor/ITensorRegistry.git"
27+
repo: "${{ matrix.repo }}"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Integration Test Request"
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
integrationrequest:
9+
if: |
10+
github.event.issue.pull_request &&
11+
contains(fromJSON('["OWNER", "COLLABORATOR", "MEMBER"]'), github.event.comment.author_association)
12+
uses: ITensor/ITensorActions/.github/workflows/IntegrationTestRequest.yml@main
13+
with:
14+
localregistry: https://github.com/ITensor/ITensorRegistry.git

.github/workflows/Register.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/Registrator.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Register Package
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
types:
6+
- closed
7+
paths:
8+
- 'Project.toml'
9+
branches:
10+
- 'master'
11+
- 'main'
12+
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
jobs:
18+
Register:
19+
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
20+
uses: "ITensor/ITensorActions/.github/workflows/Registrator.yml@main"
21+
with:
22+
localregistry: ITensor/ITensorRegistry
23+
secrets:
24+
REGISTRATOR_KEY: ${{ secrets.REGISTRATOR_KEY }}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 ITensor developers
3+
Copyright (c) 2025 ITensor developers
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

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.2.18"
4+
version = "0.2.20"
55

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

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ makedocs(;
2222
edit_link="main",
2323
assets=String[],
2424
),
25-
pages=["Home" => "index.md", "Library" => "library.md"],
25+
pages=["Home" => "index.md", "Reference" => "reference.md"],
2626
)
2727

2828
deploydocs(;

docs/src/library.md renamed to docs/src/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Library
1+
# Reference
22

33
```@autodocs
44
Modules = [BlockSparseArrays]

ext/BlockSparseArraysGradedUnitRangesExt/BlockSparseArraysGradedUnitRangesExt.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module BlockSparseArraysGradedUnitRangesExt
22

33
using BlockSparseArrays: AnyAbstractBlockSparseArray, BlockSparseArray, blocktype
44
using GradedUnitRanges: AbstractGradedUnitRange
5-
using TypeParameterAccessors: set_eltype, set_ndims, unwrap_array_type
5+
using TypeParameterAccessors: similartype, unwrap_array_type
66

77
# A block spare array similar to the input (dense) array.
88
# TODO: Make `BlockSparseArrays.blocksparse_similar` more general and use that,
@@ -15,9 +15,7 @@ function similar_blocksparse(
1515
# TODO: Probably need to unwrap the type of `a` in certain cases
1616
# to make a proper block type.
1717
return BlockSparseArray{
18-
elt,
19-
length(axes),
20-
set_eltype(set_ndims(unwrap_array_type(blocktype(a)), length(axes)), elt),
18+
elt,length(axes),similartype(unwrap_array_type(blocktype(a)), elt, axes)
2119
}(
2220
axes
2321
)

ext/BlockSparseArraysTensorAlgebraExt/BlockSparseArraysTensorAlgebraExt.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,15 @@ function TensorAlgebra.splitdims(
9494
groupreducewhile(tensor_product, split_axes, ndims(a); init=OneToOne()) do i, axis
9595
return length(axis) length(axes(a, i))
9696
end
97-
blockperms = invblockperm.(blocksortperm.(axes_prod))
97+
blockperms = blocksortperm.(axes_prod)
98+
sorted_axes = map((r, I) -> only(axes(r[I])), axes_prod, blockperms)
99+
98100
# TODO: This is doing extra copies of the blocks,
99101
# use `@view a[axes_prod...]` instead.
100102
# That will require implementing some reindexing logic
101103
# for this combination of slicing.
102-
a_unblocked = a[axes_prod...]
103-
a_blockpermed = a_unblocked[blockperms...]
104+
a_unblocked = a[sorted_axes...]
105+
a_blockpermed = a_unblocked[invblockperm.(blockperms)...]
104106
return splitdims(BlockReshapeFusion(), a_blockpermed, split_axes...)
105107
end
106108

0 commit comments

Comments
 (0)