Skip to content

Conversation

@kbarros
Copy link
Member

@kbarros kbarros commented Jul 14, 2025

We are iterating here to port the two-magnon scattering corrections.

User interface will improve with time. To test, use add Sunny#2magnon and then execute Hao's example below.

@Hao-Phys
Copy link
Collaborator

Hao-Phys commented Jul 15, 2025

The updated sample code:

using Sunny

a = 1
latvecs = lattice_vectors(a, a, 10a, 90, 90, 90)
cryst = Crystal(latvecs, [[0,0,0]])
latsize = (2, 2, 2)
s = 1/2
J = 1.0
H = 4 * J * s
sys = System(cryst, latsize, [1 => Moment(; s, g=-1)], :dipole; seed=0)
sys = reshape_supercell(sys, [1 -1 0; 1 1 0; 0 0 1])

set_exchange!(sys, J, Bond(1, 1, [1,0,0]))
set_field!(sys, [0.1, 0, H])
randomize_spins!(sys)
minimize_energy!(sys)
energy_per_site(sys)

swt = SpinWaveTheory(sys; measure=ssf_trace(sys), regularization=2e-8)

ωs = 0.0:0.1:5.0
q = 0.61
ret = Sunny.intensities_free_two_magnon(swt, [q, q, 0], ωs, 1e-2; atol=0.5)

using GLMakie
lines(ret)

The expected results
Screenshot 2025-07-15 at 3 58 05 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants