Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
fail-fast: false
matrix:
version:
- '1'
- 'lts' # minimal supported version
- '1' # latest released Julia version
os:
- ubuntu-latest
- macOS-latest
Expand Down
15 changes: 10 additions & 5 deletions src/utility/cft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,18 @@ end
function area_term(A, B; is_real = true)
a_in = domain(A)[1]
b_in = domain(B)[1]
x0 = rand(a_in ⊗ b_in)
x0 = ones(a_in ⊗ b_in)

function f0(x)
@plansor fx[-1 -2] := A[c -1; 1 m] * x[1 2] * B[m -2; 2 c]
@plansor ffx[-1 -2] := B[c -1; 1 m] * fx[1 2] * A[m -2; 2 c]
return ffx
end

spec0, _, _ = eigsolve(f0, x0, 1, :LR; verbosity = 0)

spec0, _, info = eigsolve(f0, x0, 1, :LR; verbosity = 0)
if info.converged == 0
@warn "The area term eigensolver did not converge."
end
if is_real
return real(spec0[1])
else
Expand Down Expand Up @@ -176,15 +178,18 @@ function spec(TA::TensorMap, TB::TensorMap, shape::Array; Nh = 25)
spec_sector = Dict(
map(sectors(fuse(xspace))) do charge
V = (I == Trivial) ? 𝔽^1 : Vect[I](charge => 1)
x = rand(xspace ← V)
x = ones(xspace ← V)
if dim(x) == 0
return charge => [0.0]
else
spec, _, _ = eigsolve(
spec, _, info = eigsolve(
a -> f(TA, TB, a), x, Nh, :LM; krylovdim = 40, maxiter = 100,
tol = 1.0e-12,
verbosity = 0
)
if info.converged == 0
@warn "The spectrum eigensolver in sector $charge did not converge."
end
return charge => filter(x -> abs(real(x)) ≥ 1.0e-12, spec)
end
end
Expand Down
15 changes: 7 additions & 8 deletions test/schemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ end
@info "LoopTNR ising free energy"
scheme = LoopTNR(T)

entanglement_function(steps, data) = abs(data[end])
entanglement_criterion = maxiter(100) & convcrit(1.0e-15, entanglement_function)
loop_criterion = maxiter(5) & convcrit(1.0e-10, entanglement_function)
entanglement_criterion = maxiter(100)
loop_criterion = maxiter(5)

data = run!(
scheme, truncdim(8), truncbelow(1.0e-12), maxiter(25), entanglement_criterion,
Expand All @@ -104,22 +103,22 @@ end

@info "LoopTNR ising CFT data"
scheme = LoopTNR(T)
run!(scheme, truncdim(8), maxiter(10))
run!(scheme, truncdim(12), maxiter(10))

for shape in [[1, 4, 1], [sqrt(2), 2 * sqrt(2), 0]]
cft = cft_data!(scheme, shape)
d1, d2 = real(cft[Z2Irrep(1)][1]), real(cft[Z2Irrep(0)][2])
@info "Obtained lowest scaling dimensions:\n$(d1), $(d2)."
@test d1 ≈ ising_cft_exact[1] rtol = 5.0e-4
@test d2 ≈ ising_cft_exact[2] rtol = 1.0e-2
@test d2 ≈ ising_cft_exact[2] rtol = 5.0e-4
end

for shape in [[1, 8, 1], [4 / sqrt(10), 2 * sqrt(10), 2 / sqrt(10)]]
cft = cft_data!(scheme, shape, truncdim(8), truncbelow(1.0e-10))
cft = cft_data!(scheme, shape, truncdim(12), truncbelow(1.0e-10))
d1, d2 = real(cft[Z2Irrep(1)][1]), real(cft[Z2Irrep(0)][2])
@info "Obtained lowest scaling dimensions:\n$(d1), $(d2)."
@test d1 ≈ ising_cft_exact[1] rtol = 1.0e-2
@test d2 ≈ ising_cft_exact[2] rtol = 1.0e-2
@test d1 ≈ ising_cft_exact[1] rtol = 1.0e-3
@test d2 ≈ ising_cft_exact[2] rtol = 1.0e-3
end
end

Expand Down