|
1 | | -@testitem "diamond_lattice" begin |
2 | | - # test against JuliaSCGA (S. Gao) |
3 | | - res_jscga = [0.7046602277469309, 0.8230846832863896, 0.23309034250417973, 0.40975668535137943, 0.8474163786642979, |
4 | | - 0.8230846832694241, 0.723491683211756, 0.5939752161027589, 0.6506966347286152, 0.8012263819500781] |
| 1 | +@testitem "Square lattice" begin |
| 2 | + latvecs = lattice_vectors(1, 1, 10, 90, 90, 90) |
| 3 | + cryst = Crystal(latvecs, [[0, 0, 0]]) |
| 4 | + s = 1 |
| 5 | + sys = System(cryst, [1 => Moment(; s, g=1)], :dipole; seed=0) |
| 6 | + set_exchange!(sys, -1, Bond(1, 1, [1, 0, 0])) |
| 7 | + set_exchange!(sys, 0.5, Bond(1, 1, [1, 1, 0])) |
| 8 | + set_exchange!(sys, 0.25, Bond(1, 1, [2, 0, 0])) |
| 9 | + measure = ssf_perp(sys) |
| 10 | + kT = 27.5*meV_per_K |
| 11 | + scga = SCGA(sys; measure, kT, dq=1/8) |
| 12 | + path = q_space_path(cryst, [[-1, -1, 0], [-0.04, -1, 0]], 9) |
| 13 | + res = Sunny.intensities_static(scga, path) |
| 14 | + ref_jscga = [0.3578208506624103, 0.3850668587212228, 0.4211633125595451, 0.3930558742921638, 0.3586715762816389, |
| 15 | + 0.3775147329089877, 0.4188431376589759, 0.4009835864744404, 0.36119385315852837] |
| 16 | + ref_jscga *= s^2 * Sunny.natoms(cryst) |
| 17 | + @test isapprox(vec(res.data)/2, ref_jscga; rtol=1e-5) |
| 18 | +end |
| 19 | + |
| 20 | +@testitem "Diamond lattice" begin |
5 | 21 | a = 8.5031 # (Å) |
6 | 22 | latvecs = lattice_vectors(a, a, a, 90, 90, 90) |
7 | 23 | cryst = Crystal(latvecs, [[0, 0, 0]], 227; choice="1") |
|
13 | 29 | measure = ssf_perp(sys) |
14 | 30 | kT = 15*meV_per_K |
15 | 31 | scga = SCGA(sys; measure, kT, dq=1/8) |
16 | | - γ = s^2 * Sunny.natoms(cryst) |
17 | 32 | grid = q_space_grid(cryst, [1, 0, 0], range(0, 3.6, 5), [0, 1, 0], range(0, 0.9, 2)) |
18 | 33 | res = intensities_static(scga, grid) |
19 | | - @test isapprox(vec(res.data)/γ, res_jscga; rtol=1e-8) |
20 | | -end |
21 | | - |
22 | | -@testitem "square_lattice" begin |
23 | | - # test against JuliaSCGA (S. Gao) |
24 | | - res_jscga = [0.3578208506624103, 0.3850668587212228, 0.4211633125595451, 0.3930558742921638, 0.3586715762816389, |
25 | | - 0.3775147329089877, 0.4188431376589759, 0.4009835864744404, 0.36119385315852837] |
26 | | - a = 1 # (Å) |
27 | | - latvecs = lattice_vectors(a, a, 10a, 90, 90, 90) |
28 | | - cryst = Crystal(latvecs, [[0, 0, 0]]) |
29 | | - sys = System(cryst, [1 => Moment(; s=1, g=1)], :dipole; seed=0) |
30 | | - set_exchange!(sys, -1, Bond(1, 1, [1, 0, 0])) |
31 | | - set_exchange!(sys, 0.5, Bond(1, 1, [1, 1, 0])) |
32 | | - set_exchange!(sys, 0.25, Bond(1, 1, [2, 0, 0])) |
33 | | - measure = ssf_perp(sys) |
34 | | - kT = 27.5*meV_per_K |
35 | | - scga = SCGA(sys; measure, kT, dq=1/8) |
36 | | - path = q_space_path(cryst, [[-1, -1, 0], [-0.04, -1, 0]], 9) |
37 | | - res = Sunny.intensities_static(scga, path) |
38 | | - @test isapprox(vec(res.data)/2, res_jscga; rtol=1e-5) |
| 34 | + ref_jscga = [0.7046602277469309, 0.8230846832863896, 0.23309034250417973, 0.40975668535137943, 0.8474163786642979, |
| 35 | + 0.8230846832694241, 0.723491683211756, 0.5939752161027589, 0.6506966347286152, 0.8012263819500781] |
| 36 | + ref_jscga *= s^2 * Sunny.natoms(cryst) |
| 37 | + @test isapprox(vec(res.data), ref_jscga; rtol=1e-8) |
39 | 38 | end |
40 | 39 |
|
41 | 40 | @testitem "MgCr2O4" begin |
42 | 41 | using LinearAlgebra |
43 | | - # Reproduce calculation in Conlon and Chalker, PRL 102, 237206 (2009) |
| 42 | + # Reproduce calculation in Bai et al., Phys. Rev. Lett. 122, 097201 (2019). |
| 43 | + # See also Conlon and Chalker, Phys. Rev. B 81, 224413 (2010). |
44 | 44 | latvecs = lattice_vectors(8.3342, 8.3342, 8.3342, 90, 90, 90) |
45 | 45 | positions = [[1/2, 1/2, 1/2]] |
46 | 46 | cryst = Crystal(latvecs, positions, 227) |
|
59 | 59 | scga = SCGA(sys; measure, kT, dq=1/4) |
60 | 60 | grid = q_space_grid(cryst, [1, 0, 0], range(-1.5, 1.5, 4), [0, 1, 0], range(-1.5, 1.5, 4)) |
61 | 61 | res = Sunny.intensities_static(scga, grid) |
62 | | - res_cc = [2.4168819 1.237733 1.237733 2.4168819; |
63 | | - 1.237733 0.16242284 0.16242284 1.237733; |
64 | | - 1.237733 0.16242284 0.16242284 1.237733; |
65 | | - 2.4168819 1.237733 1.237733 2.4168819] |
66 | | - γ = s*(s+1) / det(primitive_cell(cryst)) # Adapt to normalization convention of C+C |
67 | | - @test isapprox(vec(res.data), γ*vec(res_cc); rtol=1e-3) |
| 62 | + ref = [2.4168819 1.237733 1.237733 2.4168819; |
| 63 | + 1.237733 0.16242284 0.16242284 1.237733; |
| 64 | + 1.237733 0.16242284 0.16242284 1.237733; |
| 65 | + 2.4168819 1.237733 1.237733 2.4168819] |
| 66 | + ref *= s*(s+1) / det(primitive_cell(cryst)) # Differing normalization convention |
| 67 | + @test isapprox(vec(res.data), vec(ref); rtol=1e-3) |
68 | 68 | end |
69 | 69 |
|
70 | 70 | @testitem "Arbitrary Anisotropy" begin |
71 | | - # test against JuliaSCGA (S. Gao) |
72 | | - res_jscga = [0.700944539713289, 0.6175127864675868, 0.5205893697530085, 0.48172879530096047, |
73 | | - 0.5219040226511135, 0.6218544838522482, 0.7110417061581527, 0.738269833048121] |
74 | 71 | latvecs = lattice_vectors(1, 1, 10, 90, 90, 90) |
75 | 72 | cryst = Crystal(latvecs, [[0, 0 ,0]], 1) |
76 | 73 | sys = System(cryst, [1 => Moment(; s=1, g=1)], :dipole; seed=0) |
|
91 | 88 | scga = SCGA(sys; measure, kT, dq=1/8) |
92 | 89 | path = q_space_path(cryst, [[0.125, 0.625, 0], [1, 0.625, 0]], 8) |
93 | 90 | res = Sunny.intensities_static(scga, path) |
94 | | - @test isapprox(vec(res.data), res_jscga; rtol=1e-6) |
| 91 | + ref_jscga = [0.700944539713289, 0.6175127864675868, 0.5205893697530085, 0.48172879530096047, |
| 92 | + 0.5219040226511135, 0.6218544838522482, 0.7110417061581527, 0.738269833048121] |
| 93 | + @test isapprox(vec(res.data), ref_jscga; rtol=1e-6) |
95 | 94 | end |
96 | 95 |
|
97 | 96 | @testitem "Ferrimagnetic chain sum rule" begin |
|
0 commit comments