From 98fee07c40a8f67744dd0aa6323edb4d62925c63 Mon Sep 17 00:00:00 2001 From: Paul Brehmer Date: Wed, 17 Jul 2024 15:05:23 +0200 Subject: [PATCH] Add correlation_length to Heisenberg and TF Ising tests --- test/heisenberg.jl | 4 ++++ test/tf_ising.jl | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/test/heisenberg.jl b/test/heisenberg.jl index 44a85b43..c95ab664 100644 --- a/test/heisenberg.jl +++ b/test/heisenberg.jl @@ -31,8 +31,10 @@ env_init = leading_boundary(CTMRGEnv(psi_init, ComplexSpace(χenv)), psi_init, c # find fixedpoint result = fixedpoint(psi_init, H, opt_alg, env_init) +λ_h, λ_v, = correlation_length(result.peps, result.env) @test result.E ≈ -0.6694421 atol = 1e-2 +@test all(@. λ_h > 0 && λ_v > 0) # same test but for 2x2 unit cell H_2x2 = square_lattice_heisenberg(; unitcell=(2, 2)) @@ -41,5 +43,7 @@ env_init_2x2 = leading_boundary( CTMRGEnv(psi_init_2x2, ComplexSpace(χenv)), psi_init_2x2, ctm_alg ) result_2x2 = fixedpoint(psi_init_2x2, H_2x2, opt_alg, env_init_2x2) +λ_h_2x2, λ_v_2x2, = correlation_length(result_2x2.peps, result_2x2.env) @test result_2x2.E ≈ 4 * result.E atol = 1e-2 +@test all(@. λ_h_2x2 > 0 && λ_v_2x2 > 0) diff --git a/test/tf_ising.jl b/test/tf_ising.jl index 3b3284c3..f8094391 100644 --- a/test/tf_ising.jl +++ b/test/tf_ising.jl @@ -41,6 +41,7 @@ env_init = leading_boundary(CTMRGEnv(psi_init, ComplexSpace(χenv)), psi_init, c # find fixedpoint result = fixedpoint(psi_init, H, opt_alg, env_init) +λ_h, λ_v, = correlation_length(result.peps, result.env) # compute magnetization σx = TensorMap(scalartype(psi_init)[0 1; 1 0], ℂ^2, ℂ^2) @@ -50,3 +51,10 @@ magn = expectation_value(result.peps, M, result.env) @test result.E ≈ e atol = 1e-2 @test imag(magn) ≈ 0 atol = 1e-6 @test abs(magn) ≈ mˣ atol = 5e-2 + +# find fixedpoint in polarized phase and compute correlations lengths +H_polar = square_lattice_tf_ising(; h=4.5) +result_polar = fixedpoint(psi_init, H_polar, opt_alg, env_init) +λ_h_polar, λ_v_polar, = correlation_length(result_polar.peps, result_polar.env) +@test λ_h_polar < λ_h +@test λ_v_polar < λ_v