Skip to content

Commit 31a6a91

Browse files
Fix CFT spectrum per sector calculation (#106)
* Fix CFT spectrum per sector calculation * Display scaling dimension in loop-TNR test * Relax rtol in Ising loop-TNR CFT test
1 parent 5bfa56c commit 31a6a91

2 files changed

Lines changed: 35 additions & 36 deletions

File tree

src/utility/cft.jl

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

test/schemes.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,18 @@ end
108108

109109
for shape in [[1, 4, 1], [sqrt(2), 2 * sqrt(2), 0]]
110110
cft = cft_data!(scheme, shape)
111-
@test real(cft[Z2Irrep(1)][1]) ising_cft_exact[1] rtol = 2.0e-4
112-
@test real(cft[Z2Irrep(0)][2]) ising_cft_exact[2] rtol = 1.0e-2
111+
d1, d2 = real(cft[Z2Irrep(1)][1]), real(cft[Z2Irrep(0)][2])
112+
@info "Obtained lowest scaling dimensions:\n$(d1), $(d2)."
113+
@test d1 ising_cft_exact[1] rtol = 5.0e-4
114+
@test d2 ising_cft_exact[2] rtol = 1.0e-2
113115
end
114116

115117
for shape in [[1, 8, 1], [4 / sqrt(10), 2 * sqrt(10), 2 / sqrt(10)]]
116118
cft = cft_data!(scheme, shape, truncdim(8), truncbelow(1.0e-10))
117-
@test real(cft[Z2Irrep(1)][1]) ising_cft_exact[1] rtol = 1.0e-2
118-
@test real(cft[Z2Irrep(0)][2]) ising_cft_exact[2] rtol = 1.0e-2
119+
d1, d2 = real(cft[Z2Irrep(1)][1]), real(cft[Z2Irrep(0)][2])
120+
@info "Obtained lowest scaling dimensions:\n$(d1), $(d2)."
121+
@test d1 ising_cft_exact[1] rtol = 1.0e-2
122+
@test d2 ising_cft_exact[2] rtol = 1.0e-2
119123
end
120124
end
121125

0 commit comments

Comments
 (0)