|
| 1 | +println("--------------------") |
| 2 | +println(" Testing all models ") |
| 3 | +println("--------------------") |
| 4 | + |
| 5 | +models_2D = [ |
| 6 | + classical_ising(), |
| 7 | + classical_ising_symmetric(), |
| 8 | + gross_neveu_start(0, 0, 0), |
| 9 | + # classical_clock(), # TODO: find out how to test this model |
| 10 | + classical_potts(3), |
| 11 | + classical_potts_symmetric(3), |
| 12 | + sixvertex(Float64, Trivial), |
| 13 | + sixvertex(Float64, U1Irrep), |
| 14 | + sixvertex(Float64, CU1Irrep), |
| 15 | +] |
| 16 | + |
| 17 | +temperatures = [ |
| 18 | + ising_βc, |
| 19 | + ising_βc, |
| 20 | + 1.0, |
| 21 | + potts_βc(3), |
| 22 | + potts_βc(3), |
| 23 | + 1.0, |
| 24 | + 1.0, |
| 25 | + 1.0, |
| 26 | +] |
| 27 | + |
| 28 | +answers = [ |
| 29 | + f_onsager, # Hack because classical_ising starts from larger lattice |
| 30 | + f_onsager, |
| 31 | + -1.4515448845652446, |
| 32 | + -4.119552029995684, # This is an approximation! |
| 33 | + -4.119552029995684, # This is an approximation! |
| 34 | + 3 / 2 * log(3 / 4), |
| 35 | + 3 / 2 * log(3 / 4), |
| 36 | + 3 / 2 * log(3 / 4), |
| 37 | +] |
| 38 | + |
| 39 | +unitcells = vcat([2.0], fill(1.0, length(models_2D) - 1)) |
| 40 | + |
| 41 | +@testset "2D Models" begin |
| 42 | + for (model, temp, answer, unitcell) in zip(models_2D, temperatures, answers, unitcells) |
| 43 | + scheme = TRG(model) |
| 44 | + data = run!(scheme, truncdim(16), maxiter(25)) |
| 45 | + @test free_energy(data, temp; unitcell = unitcell) ≈ answer rtol = 1.0e-3 |
| 46 | + end |
| 47 | +end |
0 commit comments