@@ -162,45 +162,40 @@ function spec(TA::TensorMap, TB::TensorMap, shape::Array; Nh = 25)
162162 throw (ArgumentError (" Sectors with non-Bosonic charge $I has not been implemented" ))
163163 end
164164
165- spec_sector = Dict ()
166- conformal_data = Dict ()
167-
168- for charge in values (I)
169- if I == Trivial
170- V = 𝔽^ 1
171- else
172- V = Vect[I](charge => 1 )
173- end
165+ xspace, f = if shape ≈ [1 , 4 , 1 ]
166+ domain (TA)[1 ] ⊗ domain (TB)[1 ] ⊗ domain (TA)[1 ] ⊗ domain (TB)[1 ],
167+ MPO_action_1x4_twist
168+ elseif shape ≈ [1 , 8 , 1 ]
169+ domain (TA)[1 ] ⊗ domain (TB)[1 ] ⊗ domain (TA)[1 ] ⊗ domain (TB)[1 ],
170+ MPO_action_1x4
171+ elseif shape ≈ [sqrt (2 ), 2 * sqrt (2 ), 0 ] ||
172+ shape ≈ [4 / sqrt (10 ), 2 * sqrt (10 ), 2 / sqrt (10 )]
173+ domain (TB) ⊗ domain (TB), MPO_action_2gates
174+ end
174175
175- if shape ≈ [1 , 4 , 1 ]
176- x = rand (domain (TA)[1 ] ⊗ domain (TB)[1 ] ⊗ domain (TA)[1 ] ⊗ domain (TB)[1 ] ← V)
177- f = MPO_action_1x4_twist
178- elseif shape ≈ [1 , 8 , 1 ]
179- x = rand (domain (TA)[1 ] ⊗ domain (TB)[1 ] ⊗ domain (TA)[1 ] ⊗ domain (TB)[1 ] ← V)
180- f = MPO_action_1x4
181- elseif shape ≈ [sqrt (2 ), 2 * sqrt (2 ), 0 ] ||
182- shape ≈ [4 / sqrt (10 ), 2 * sqrt (10 ), 2 / sqrt (10 )]
183- x = rand (domain (TB) ⊗ domain (TB) ← V)
184- f = MPO_action_2gates
176+ spec_sector = Dict (
177+ map (sectors (fuse (xspace))) do charge
178+ V = (I == Trivial) ? 𝔽^ 1 : Vect[I](charge => 1 )
179+ x = rand (xspace ← V)
180+ if dim (x) == 0
181+ return charge => [0.0 ]
182+ else
183+ spec, _, _ = eigsolve (
184+ a -> f (TA, TB, a), x, Nh, :LM ; krylovdim = 40 , maxiter = 100 ,
185+ tol = 1.0e-12 ,
186+ verbosity = 0
187+ )
188+ return charge => filter (x -> abs (real (x)) ≥ 1.0e-12 , spec)
189+ end
185190 end
191+ )
186192
187- if dim (x) == 0
188- spec_sector[charge] = [0.0 ]
189- else
190- spec, _, _ = eigsolve (
191- a -> f (TA, TB, a), x, Nh, :LM ; krylovdim = 40 , maxiter = 100 ,
192- tol = 1.0e-12 ,
193- verbosity = 0
194- )
195-
196- spec_sector[charge] = filter (x -> abs (real (x)) ≥ 1.0e-12 , spec)
197- end
198- end
193+ conformal_data = Dict ()
199194
200195 norm_const_0 = spec_sector[one (I)][1 ]
201196 conformal_data[" c" ] = 6 / pi / (Reτ - area / 4 ) * log (norm_const_0)
202197
203- for charge in values (I )
198+ for charge in sectors ( fuse (xspace) )
204199 DeltaS = - 1 / (2 * pi * shape[1 ] / shape[2 ]) *
205200 log .(spec_sector[charge] / norm_const_0)
206201 if ! (relative_shift ≈ 0 )
0 commit comments