22# special (2,2) tensor that implements a standard braiding operation
33#= ===================================================================#
44"""
5- struct BraidingTensor{T,S<: IndexSpace,A<: DenseVector{T}} <: AbstractTensorMap{T, S, 2, 2}
5+ struct BraidingTensor{T, S <: IndexSpace, A <: DenseVector{T}} <: AbstractTensorMap{T, S, 2, 2}
66 BraidingTensor(V1::S, V2::S, adjoint::Bool=false) where {S<:IndexSpace}
77 BraidingTensor{T, S, A}(V1::S, V2::S, adjoint::Bool=false) where {T, S, A}
88
@@ -14,7 +14,7 @@ It holds that `domain(BraidingTensor(V1, V2)) == V1 ⊗ V2` and
1414controls the array type of the braiding tensor used when indexing
1515and multiplying with other tensors.
1616"""
17- struct BraidingTensor{T, S, A} <: AbstractTensorMap{T, S, 2, 2}
17+ struct BraidingTensor{T, S, A <: DenseVector{T} } <: AbstractTensorMap{T, S, 2, 2}
1818 V1:: S
1919 V2:: S
2020 adjoint:: Bool
133133 data_parent = storagetype (b)(undef, prod (d))
134134 data = sreshape (StridedView (data_parent), d)
135135 r = _braiding_factor (f₁, f₂, b. adjoint)
136- val = isnothing (r) ? zero (eltype (b)) : r
137- fill_braidingsubblock! (data, val)
136+ isnothing (r) ? zerovector! (data) : fill_braidingsubblock! (data, r)
138137 return data
139138end
140139
@@ -171,8 +170,7 @@ function fill_braidingblock!(data, b::BraidingTensor, s::Sector)
171170 subblock = StridedView (data, sz, str, off - base_offset)
172171 # without the zero-value, the non-trivial block is not set
173172 # correctly in the GPU case
174- val = isnothing (r) ? zero (eltype (data)) : r
175- fill_braidingsubblock! (subblock, val)
173+ isnothing (r) ? zerovector! (subblock) : fill_braidingsubblock! (subblock, r)
176174 end
177175 return data
178176end
0 commit comments