@@ -36,9 +36,14 @@ TensorKitSectors.BraidingStyle(::Type{A4Object}) = NoBraiding()
3636
3737function TensorKitSectors.:⊗ (a:: A4Object , b:: A4Object )
3838 @assert a. j == b. i
39- return Iterators. filter (c -> NSymbol (a, b, c) > 0 ,
40- map (label -> A4Object (a. i, b. j, label),
41- numlabels (A4Object, a. i, b. j)))
39+ Ncache = _get_Ncache (A4Object)[a. i, a. j, b. j]
40+ return A4Object[A4Object (a. i, b. j, c_l)
41+ for (a_l, b_l, c_l) in keys (Ncache)
42+ if (a_l == a. label && b_l == b. label)]
43+ end
44+
45+ function _numlabels (:: Type{A4Object} , i, j)
46+ return Ncache = _get_Ncache (A4Object)
4247end
4348
4449# Data from files
@@ -117,16 +122,14 @@ function extract_dual(::Type{A4Object})
117122 end
118123end
119124
120- function Base. one (a:: A4Object )
125+ function Base. one (a:: BimoduleSector )
121126 a. i == a. j || error (" don't know how to define one for modules" )
122- global Dualcache
123- return A4Object (i, i, get (Dualcache, T)[1 ])
127+ return A4Object (a. i, a. i, _get_dual_cache (typeof (a))[a. i][1 ])
124128end
125129
126- function Base. conj (a:: A4Object )
130+ function Base. conj (a:: BimoduleSector )
127131 a. i == a. j || error (" don't know how to define dual for modules" )
128- global Dualcache
129- return A4Object (i, i, get (Dualcache, T)[2 ][i])
132+ return A4Object (a. i, a. i, _get_dual_cache (typeof (a))[a. i][2 ][a. label])
130133end
131134
132135function extract_Fsymbol (:: Type{A4Object} )
@@ -142,12 +145,17 @@ function extract_Fsymbol(::Type{A4Object})
142145 a, b, c, d, e, f = parse .(Int, split (string (key)[2 : (end - 1 )], " , " ))
143146 a_ob, b_ob, c_ob, d_ob, e_ob, f_ob = A4Object .(((i, j, a), (j, k, b),
144147 (k, l, c), (i, l, d),
145- (i, j, e), (j, l, f)))
146- y[(a, b, c, d, e, f)] = reshape (v,
147- (Nsymbol (a_ob, b_ob, e_ob),
148- Nsymbol (e_ob, c_ob, d_ob),
149- Nsymbol (b_ob, c_ob, f_ob),
150- Nsymbol (a_ob, f_ob, d_ob)))
148+ (i, k, e), (j, l, f)))
149+ result = Array {ComplexF64,4} (undef,
150+ (Nsymbol (a_ob, b_ob, e_ob),
151+ Nsymbol (e_ob, c_ob, d_ob),
152+ Nsymbol (b_ob, c_ob, f_ob),
153+ Nsymbol (a_ob, f_ob, d_ob)))
154+ map! (result, reshape (v, size (result))) do cmplxdict
155+ return complex (cmplxdict[:re ], cmplxdict[:im ])
156+ end
157+
158+ y[(a, b, c, d, e, f)] = result
151159 end
152160 end
153161 end
0 commit comments