Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarros committed Sep 18, 2024
1 parent 13c41c6 commit 32ab87a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions examples/09_Disordered_spectrum.jl → examples/09_Disorder_KPM.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# # 9. Disordered spectrum with KPM
# # 9. Disordered system with KPM
#
# This example uses the kernel polynomial method (KPM) to efficiently calculate
# the neutron scattering spectrum of a disordered triangular antiferromagnet.
# Our simple model is inspired by YbMgGaO4, as studied in [Paddison et al,
# Nature Phys., **13**, 117–122 (2017)](https://doi.org/10.1038/nphys3971) and
# [Zhu et al, Phys. Rev. Lett. **119**, 157201
# (2017)](https://doi.org/10.1103/PhysRevLett.119.157201). The presence of
# non-magnetic disorder of the the Mg/Ga occupancy can be modeled as a
# stochastic distribution of exchange constants and ``g``-factors. Including
# this randomness introduces broadening of the spin wave spectrum.
# The model is inspired by YbMgGaO4, as studied in [Paddison et al, Nature
# Phys., **13**, 117–122 (2017)](https://doi.org/10.1038/nphys3971) and [Zhu et
# al, Phys. Rev. Lett. **119**, 157201
# (2017)](https://doi.org/10.1103/PhysRevLett.119.157201). Disordered occupancy
# of non-magnetic Mg/Ga sites can be modeled as a stochastic distribution of
# exchange constants and ``g``-factors. Including this disorder introduces
# broadening of the spin wave spectrum.

using Sunny, GLMakie

Expand All @@ -30,7 +30,7 @@ plot_spins(sys; color=[s[3] for s in sys.dipoles], ndims=2)
qs = [[0, 0, 0], [1/3, 1/3, 0], [1/2, 0, 0], [0, 0, 0]]
labels = ["Γ", "K", "M", "Γ"]
path = q_space_path(cryst, qs, 150; labels)
kernel = lorentzian(fwhm=0.4);
kernel = gaussian(fwhm=0.4);

# Perform a traditional spin wave calculation. The spectrum shows sharp modes
# associated with coherent excitations about the K-point ordering wavevector,
Expand Down Expand Up @@ -73,7 +73,7 @@ plot_spins(sys_inhom; color=[s[3] for s in sys_inhom.dipoles], ndims=2)
# Observe that disorder in the nearest-neighbor exchange serves to broaden the
# discrete excitation bands into a continuum.

swt = SpinWaveTheoryKPM(sys_inhom; measure=ssf_perp(sys_inhom), tol=0.01)
swt = SpinWaveTheoryKPM(sys_inhom; measure=ssf_perp(sys_inhom), tol=0.0001)
res = intensities(swt, path; energies, kernel)
plot_intensities(res)

Expand Down
4 changes: 2 additions & 2 deletions src/KPM/SpinWaveTheoryKPM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ function intensities!(data, swt_kpm::SpinWaveTheoryKPM, qpts; energies, kernel::
# the polynomial resolution scale times a prefactor that grows like
# sqrt(accuracy) to reduce lingering ringing artifacts. See "AFM
# KPM" for a test case where the smoothing degrades accuracy, and
# "Disordered spectrum with KPM" for an illustration of how
# smoothing affects intensities near the Goldstone mode.
# "Disordered system with KPM" for an illustration of how smoothing
# affects intensities near the Goldstone mode.
σ = sqrt(accuracy_factor) */ M)
thermal_prefactor_zero(x) = (tanh(x / σ) + 1) / 2
f(x) = kernel(x, ω) * thermal_prefactor_zero(x)
Expand Down

0 comments on commit 32ab87a

Please sign in to comment.