Skip to content

Commit e3787ff

Browse files
committed
Fixes attempt II
1 parent f2f82bc commit e3787ff

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/transfermatrix/transfer.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,21 @@ end
6868
# the transfer operation of a density matrix with a utility leg in its codomain is ill defined - how should one braid the utility leg?
6969
# hence the checks - to make sure that this operation is uniquely defined
7070
function transfer_left(v::MPSTensor{S}, A::MPSTensor{S}, Ab::MPSTensor{S}) where {S}
71-
check_ambiguous_braiding(space(v, 2))
71+
check_unambiguous_braiding(space(v, 2))
7272
@plansor v[-1 -2; -3] := v[1 2; 4] * A[4 5; -3] * τ[2 3; 5 -2] * conj(Ab[1 3; -1])
7373
end
7474
function transfer_right(v::MPSTensor{S}, A::MPSTensor{S}, Ab::MPSTensor{S}) where {S}
75-
check_ambiguous_braiding(space(v, 2))
75+
check_unambiguous_braiding(space(v, 2))
7676
@plansor v[-1 -2; -3] := A[-1 2; 1] * τ[-2 4; 2 3] * conj(Ab[-3 4; 5]) * v[1 3; 5]
7777
end
7878

7979
# the transfer operation with a utility leg in both the domain and codomain is also ill defined - only due to the codomain utility space
8080
function transfer_left(v::MPOTensor{S}, A::MPSTensor{S}, Ab::MPSTensor{S}) where {S}
81-
check_ambiguous_braiding(space(v, 2))
81+
check_unambiguous_braiding(space(v, 2))
8282
@plansor t[-1 -2; -3 -4] := v[1 2; -3 4] * A[4 5; -4] * τ[2 3; 5 -2] * conj(Ab[1 3; -1])
8383
end
8484
function transfer_right(v::MPOTensor{S}, A::MPSTensor{S}, Ab::MPSTensor{S}) where {S}
85-
check_ambiguous_braiding(space(v, 2))
85+
check_unambiguous_braiding(space(v, 2))
8686
@plansor t[-1 -2; -3 -4] := A[-1 2; 1] * τ[-2 4; 2 3] * conj(Ab[-4 4; 5]) * v[1 3; -3 5]
8787
end
8888

src/utility/utility.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,21 @@ end
134134

135135
# TODO: remove once TensorKit supports this
136136
_twist(t::AbstractTensorMap, i::Int) = _twist(BraidingStyle(sectortype(t)), t, i)
137-
_twist(::SymmetricBraiding, t::AbstractTensorMap, i::Int) = t
137+
_twist(::Bosonic, t::AbstractTensorMap, i::Int) = t
138138
function _twist(::NoBraiding, t::AbstractTensorMap, i::Int)
139-
check_ambiguous_braiding(space(t, i))
139+
check_unambiguous_braiding(space(t, i))
140140
return t
141141
end
142142
_twist(::BraidingStyle, t::AbstractTensorMap, i::Int) = twist(t, i)
143143

144144
# Verify that the braiding is unambiguous: either through symmetric braiding or because the
145145
# sectors are all trivial
146-
function check_ambiguous_braiding(::Type{Bool}, V::VectorSpace)
146+
function check_unambiguous_braiding(::Type{Bool}, V::VectorSpace)
147147
I = sectortype(V)
148148
BraidingStyle(I) isa SymmetricBraiding && return true
149149
return all(isone, sectors(V))
150150
end
151-
function check_ambiguous_braiding(V::VectorSpace)
152-
return check_ambiguous_braiding(Bool, V) ||
151+
function check_unambiguous_braiding(V::VectorSpace)
152+
return check_unambiguous_braiding(Bool, V) ||
153153
throw(ArgumentError("cannot unambiguously braid $V"))
154154
end

0 commit comments

Comments
 (0)