Skip to content

Commit

Permalink
Add correlation_length to Heisenberg and TF Ising tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrehmer committed Jul 17, 2024
1 parent d9b0d75 commit 98fee07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/heisenberg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
8 changes: 8 additions & 0 deletions test/tf_ising.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit 98fee07

Please sign in to comment.