Skip to content

Commit d509e10

Browse files
authored
[Fix] Transformers for non-abelian non-selfadjoint sectors (#256)
* Correctly handle dual of sectors * Fix debug message for transformers of length 1 * Add non-abelian non-selfadjoint test * Bump v0.14.8
1 parent 0d5bb31 commit d509e10

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TensorKit"
22
uuid = "07d1fe3e-3e46-537d-9eac-e9e13d0d4cec"
33
authors = ["Jutho Haegeman"]
4-
version = "0.14.7"
4+
version = "0.14.8"
55

66
[deps]
77
LRUCache = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637"

src/tensors/treetransformers.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ function GenericTreeTransformer(transform, p, Vdst, Vsrc)
6565
I = sectortype(Vsrc)
6666

6767
uncoupleds_src = map(structure_src.fusiontreelist) do (f₁, f₂)
68-
return TupleTools.vcat(f₁.uncoupled, f₂.uncoupled)
68+
return TupleTools.vcat(f₁.uncoupled, dual.(f₂.uncoupled))
6969
end
7070
uncoupleds_src_unique = unique(uncoupleds_src)
7171

7272
uncoupleds_dst = map(structure_dst.fusiontreelist) do (f₁, f₂)
73-
return TupleTools.vcat(f₁.uncoupled, f₂.uncoupled)
73+
return TupleTools.vcat(f₁.uncoupled, dual.(f₂.uncoupled))
7474
end
7575

7676
T = sectorscalartype(I)
@@ -116,7 +116,7 @@ function GenericTreeTransformer(transform, p, Vdst, Vsrc)
116116

117117
@debug("TreeTransformer for $Vsrc to $Vdst via $p",
118118
nblocks = length(data),
119-
sz_median = size(data[end ÷ 2][1], 1),
119+
sz_median = size(data[cld(end, 2)][1], 1),
120120
sz_max = size(data[1][1], 1),
121121
Δt)
122122

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ VfSU₂ = (ℂ[FermionSpin](0 => 3, 1 // 2 => 1),
100100
ℂ[FermionSpin](1 // 2 => 1, 1 => 1)',
101101
ℂ[FermionSpin](0 => 2, 1 // 2 => 2),
102102
ℂ[FermionSpin](0 => 1, 1 // 2 => 1, 3 // 2 => 1)')
103+
VSU₂U₁ = (Vect[SU2Irrep U1Irrep]((0, 0) => 1, (1 // 2, -1) => 1),
104+
Vect[SU2Irrep U1Irrep]((0, 0) => 2, (0, 2) => 1, (1, 0) => 1, (1, -2) => 1,
105+
(1 // 2, -1) => 1),
106+
Vect[SU2Irrep U1Irrep]((1 // 2, 1) => 1, (1, -2) => 1)',
107+
Vect[SU2Irrep U1Irrep]((0, 0) => 2, (0, 2) => 1, (1 // 2, 1) => 1),
108+
Vect[SU2Irrep U1Irrep]((0, 0) => 1, (1 // 2, 1) => 1)')
103109
# VSU₃ = (ℂ[SU3Irrep]((0, 0, 0) => 3, (1, 0, 0) => 1),
104110
# ℂ[SU3Irrep]((0, 0, 0) => 3, (2, 0, 0) => 1)',
105111
# ℂ[SU3Irrep]((1, 1, 0) => 1, (2, 1, 0) => 1),

test/tensors.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
for V in (Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂)#, VSU₃)
1+
for V in (Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂, VSU₂U₁)#, VSU₃)
22
V1, V2, V3, V4, V5 = V
33
@assert V3 * V4 * V2 V1' * V5' # necessary for leftorth tests
44
@assert V3 * V4 V1' * V2' * V5' # necessary for rightorth tests
@@ -10,15 +10,15 @@ spacelist = try
1010
if Sys.iswindows()
1111
(Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂)
1212
elseif Sys.isapple()
13-
(Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VfU₁, VfSU₂)#, VSU₃)
13+
(Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VfU₁, VfSU₂, VSU₂U₁)#, VSU₃)
1414
else
15-
(Vtr, Vℤ₂, Vfℤ₂, VU₁, VCU₁, VSU₂, VfSU₂)#, VSU₃)
15+
(Vtr, Vℤ₂, Vfℤ₂, VU₁, VCU₁, VSU₂, VfSU₂, VSU₂U₁)#, VSU₃)
1616
end
1717
else
18-
(Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂)#, VSU₃)
18+
(Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂, VSU₂U₁)#, VSU₃)
1919
end
2020
catch
21-
(Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂)#, VSU₃)
21+
(Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂, VSU₂U₁)#, VSU₃)
2222
end
2323

2424
for V in spacelist

0 commit comments

Comments
 (0)