Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
*.jl.*.cov
*.jl.cov
*.jl.mem
*.cov
*.mem
*.o
*.swp
.DS_Store
.benchmarkci
.tmp
.vscode/
Manifest.toml
LocalPreferences.toml
Manifest*.toml
benchmark/*.json
dev/
docs/LocalPreferences.toml
docs/Manifest.toml
docs/build/
docs/src/index.md
examples/LocalPreferences.toml
test/LocalPreferences.toml
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TensorAlgebra"
uuid = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a"
version = "0.4.6"
authors = ["ITensor developers <support@itensor.org> and contributors"]
version = "0.4.5"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand All @@ -24,7 +24,7 @@ ArrayLayouts = "1.10.4"
BlockArrays = "1.7.2"
EllipsisNotation = "1.8.0"
LinearAlgebra = "1.10"
MatrixAlgebraKit = "0.2, 0.3, 0.4, 0.5"
MatrixAlgebraKit = "0.2, 0.3, 0.4, 0.5, 0.6"
TensorOperations = "5"
TensorProducts = "0.1.5"
TupleTools = "1.6.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ TensorAlgebra = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a"
[compat]
Documenter = "1.8.1"
Literate = "2.20.1"
TensorAlgebra = "0.4.0"
TensorAlgebra = "0.4"
2 changes: 1 addition & 1 deletion examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
TensorAlgebra = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a"

[compat]
TensorAlgebra = "0.4.0"
TensorAlgebra = "0.4"
6 changes: 6 additions & 0 deletions src/blockedpermutation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ function blockedpermvcat(
permblocks::Union{Tuple{Vararg{Int}}, Ellipsis, Tuple{Ellipsis}}...;
length::Union{Val, Nothing} = nothing,
)
return _blockedpermvcat(length, permblocks...)
end
function _blockedpermvcat(
length::Union{Val, Nothing},
permblocks::Union{Tuple{Vararg{Int}}, Ellipsis, Tuple{Ellipsis}}...,
)
# Check there is only one `Ellipsis`.
@assert isone(count(x -> x isa Union{Ellipsis, Tuple{Ellipsis}}, permblocks))
specified_permblocks = filter(x -> !(x isa Union{Ellipsis, Tuple{Ellipsis}}), permblocks)
Expand Down
3 changes: 2 additions & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ TensorAlgebra = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a"
TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestExtras = "5ed8adda-3752-4e41-b88a-e8b09835ee3a"
TupleTools = "9d95972d-f1c8-5527-a6e0-b4b365fa01f6"

[compat]
Aqua = "0.8.9"
BlockArrays = "1.6.1"
EllipsisNotation = "1.8"
LinearAlgebra = "<0.0.1, 1"
MatrixAlgebraKit = "0.2, 0.3, 0.4, 0.5"
MatrixAlgebraKit = "0.2, 0.3, 0.4, 0.5, 0.6"
Random = "1.10"
SafeTestsets = "0.1"
StableRNGs = "1.0.2"
Expand Down
27 changes: 10 additions & 17 deletions test/test_blockedpermutation.jl
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
using Test: @test, @test_broken, @testset

using BlockArrays: blockfirsts, blocklasts, blocklength, blocklengths, blocks
using EllipsisNotation: var".."
using TensorAlgebra: BlockedPermutation, BlockedTrivialPermutation, BlockedTuple,
blockedperm, blockedperm_indexin, blockpermute, blockedtrivialperm, blockedpermvcat,
permmortar, trivialperm, tuplemortar
using Test: @test, @test_broken, @test_throws, @testset
using TestExtras: @constinferred

using TensorAlgebra:
BlockedPermutation,
BlockedTrivialPermutation,
BlockedTuple,
blockedperm,
blockedperm_indexin,
blockpermute,
blockedtrivialperm,
blockedpermvcat,
permmortar,
trivialperm,
tuplemortar

@testset "BlockedPermutation" begin
p = @constinferred permmortar(((3, 4, 5), (2, 1)))
@test Tuple(p) === (3, 4, 5, 2, 1)
Expand Down Expand Up @@ -111,7 +100,9 @@ using TensorAlgebra:
p = blockedpermvcat((4, 3), .., 1)
@test p == blockedpermvcat((4, 3), (2,), (1,))
# Specify length
p = @constinferred blockedpermvcat((4, 3), .., 1; length = Val(6))
# TODO: Type unstable in Julia 1.12, investigate.
# @constinferred blockedpermvcat((4, 3), .., 1; length = Val(6))
p = blockedpermvcat((4, 3), .., 1; length = Val(6))
@test p == blockedpermvcat((4, 3), (2,), (5,), (6,), (1,))

# No dimensions are unspecified.
Expand All @@ -131,7 +122,9 @@ using TensorAlgebra:

p = blockedpermvcat((4, 3), (..,), 1)
@test p == blockedpermvcat((4, 3), (2,), (1,))
p = @constinferred blockedpermvcat((4, 3), (..,), 1; length = Val(6))
# TODO: Type unstable in Julia 1.12, investigate.
# @constinferred blockedpermvcat((4, 3), (..,), 1; length = Val(6))
p = blockedpermvcat((4, 3), (..,), 1; length = Val(6))
@test p == blockedpermvcat((4, 3), (2, 5, 6), (1,))

p = blockedpermvcat((3, 2), (..,), 1)
Expand Down
Loading