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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TensorAlgebra"
uuid = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a"
authors = ["ITensor developers <[email protected]> and contributors"]
version = "0.3.14"
version = "0.3.15"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
8 changes: 4 additions & 4 deletions src/contract/blockedperms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ function biperm(perm, ::Val{BlockLength1}) where {BlockLength1}
return blockedperm(Tuple(perm), (BlockLength1, length(perm) - BlockLength1))
end

length_codomain(t::AbstractBlockTuple{2}) = first(blocklengths(t))
# Assume all dimensions are in the domain by default
length_codomain(t) = 0
length_domain(t::AbstractBlockTuple{2}) = last(blocklengths(t))
# Assume all dimensions are in the codomain by default
length_domain(t) = 0

length_domain(t) = length(t) - length_codomain(t)
length_codomain(t) = length(t) - length_domain(t)

function blockedperms(
f::typeof(contract), alg::Algorithm, dimnames_dest, dimnames1, dimnames2
Expand Down
4 changes: 2 additions & 2 deletions test/test_basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
@testset "misc" begin
t = (1, 2, 3)
bt = tuplemortar(((1, 2), (3,)))
@test length_codomain(t) == 0
@test length_codomain(t) == 3
@test length_codomain(bt) == 2
@test length_domain(t) == 3
@test length_domain(t) == 0
@test length_domain(bt) == 1
end

Expand Down
Loading