diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6f82746d..26918807 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 diff --git a/src/utility/cft.jl b/src/utility/cft.jl index 2258e14e..258fd6e6 100644 --- a/src/utility/cft.jl +++ b/src/utility/cft.jl @@ -76,7 +76,7 @@ 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] @@ -84,8 +84,10 @@ function area_term(A, B; is_real = true) 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 @@ -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 diff --git a/test/schemes.jl b/test/schemes.jl index 4d86cf8f..7f5aa78c 100644 --- a/test/schemes.jl +++ b/test/schemes.jl @@ -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, @@ -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