Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarros committed Aug 23, 2024
1 parent 813c8fb commit bdce95f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples/02_LSWT_CoRh2O4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ swt = SpinWaveTheory(sys_prim; measure=ssf_perp(sys_prim))
# path that connects high-symmetry points in reciprocal space.

qs = [[0, 0, 0], [1/2, 0, 0], [1/2, 1/2, 0], [0, 0, 0]]
path = q_space_path(cryst, qs, 400)
path = q_space_path(cryst, qs, 500)

# Select [`lorentzian`](@ref) broadening with a full-width at half-maximum
# (FWHM) of 0.8 meV. Use [`ssf_perp`](@ref) to calculate unpolarized scattering
Expand Down
2 changes: 1 addition & 1 deletion examples/03_LLD_CoRh2O4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ qs = [[3/4, 3/4, 0],
[1/4, 1, 1/4],
[ 0, 1, 0],
[ 0, -4, 0]]
qpts = q_space_path(cryst, qs, 1000)
qpts = q_space_path(cryst, qs, 500)

# Calculate ``I(𝐪, ω)`` intensities along this path and plot.

Expand Down
2 changes: 1 addition & 1 deletion examples/07_Dipole_Dipole.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ plot_spins(sys_prim; ghost_radius=8, color=[:red, :blue, :yellow, :purple])

qs = [[0,0,0], [0,1,0], [1,1/2,0], [1/2,1/2,1/2], [3/4,3/4,0], [0,0,0]]
labels = ["Γ", "X", "W", "L", "K", "Γ"]
path = q_space_path(cryst, qs, 400; labels)
path = q_space_path(cryst, qs, 500; labels)

measure = ssf_trace(sys_prim)
swt = SpinWaveTheory(sys_prim; measure)
Expand Down
3 changes: 1 addition & 2 deletions examples/08_Momentum_Conventions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ for _ in 1:nsamples
end
add_sample!(sc, sys)
end
path = q_space_path(cryst, [[0,0,-1/2], [0,0,+1/2]], 300)
path = q_space_path(cryst, [[0,0,-1/2], [0,0,+1/2]], 400)
res1 = intensities(sc, path; energies=:available, kT)

# Calculate the same quantity with linear spin wave theory at ``T = 0``. Because
Expand All @@ -76,7 +76,6 @@ res1 = intensities(sc, path; energies=:available, kT)
sys_small = resize_supercell(sys, (1,1,1))
minimize_energy!(sys_small)
swt = SpinWaveTheory(sys_small; measure=ssf_trace(sys_small))
path = q_space_path(cryst, [[0,0,-1/2], [0,0,+1/2]], 400)
res2 = intensities_bands(swt, path)

# This model system has a single magnon band with dispersion ``ϵ(𝐪) = 1 - D/B
Expand Down
19 changes: 10 additions & 9 deletions examples/spinw_tutorials/SW13_LiNiPO4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,19 @@ res = intensities_bands(swt, path)
fig = Figure(size=(768, 300))
plot_intensities!(fig[1, 1], res; units);

# Plotting intensity curves for individual bands needs code customized to the
# situation. Here we filter out zero intensity "ghost" modes by sorting the data
# along dimension 1 (band energy) according to the condition "is intensity
# nonzero". Call the [Makie `lines!`
# There are two physical bands with nonvanishing intensity. To extract these
# intensity curves, we must filter out the additional bands with zero intensity.
# One way is to sort the data along dimension 1 (the band index) with the
# comparison operator "is intensity less than ``10^{-12}``". Doing so moves the
# physical bands to the end of the array axis. Call the [Makie `lines!`
# function](https://docs.makie.org/stable/reference/plots/lines) to make a
# custom plot.

data_sorted = sort(res.data; dims=1, by=x->abs(x)>1e-12)
data_sorted = sort(res.data; dims=1, by= >(1e-12))
ax = Axis(fig[1, 2], xlabel="Momentum (r.l.u.)", ylabel="Intensity",
xticks=res.qpts.xticks, xticklabelrotation=π/6)
lines!(ax, data_sorted[4, :]; label="Band 2")
lines!(ax, data_sorted[3, :]; label="Band 1")
lines!(ax, data_sorted[end, :]; label="Lower band")
lines!(ax, data_sorted[end-1, :]; label="Upper band")
axislegend(ax)
fig

Expand All @@ -87,7 +88,7 @@ plot_intensities!(fig[1, 1], res; units)
data_sorted = sort(res.data; dims=1, by=x->abs(x)>1e-12)
ax = Axis(fig[1, 2], xlabel="Momentum (r.l.u.)", ylabel="Intensity",
xticks=res.qpts.xticks, xticklabelrotation=π/6)
lines!(ax, data_sorted[4, :]; label="Band 2")
lines!(ax, data_sorted[3, :]; label="Band 1")
lines!(ax, data_sorted[end, :]; label="Lower band")
lines!(ax, data_sorted[end-1, :]; label="Upper band")
axislegend(ax)
fig
4 changes: 2 additions & 2 deletions examples/spinw_tutorials/SW18_Distorted_kagome.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ energy_per_site(sys2) # < -0.7834 meV
# Define a path in q-space

qs = [[0,0,0], [1,0,0]]
path = q_space_path(cryst, qs, 512)
path = q_space_path(cryst, qs, 400)

# Calculate intensities for the incommensurate spiral phase using
# [`SpiralSpinWaveTheory`](@ref). It is necessary to provide the original `sys`,
Expand All @@ -93,7 +93,7 @@ plot_intensities(res; units)
radii = range(0, 2, 100) # (1/Å)
energies = range(0, 6, 200)
kernel = gaussian(fwhm=0.05)
res = powder_average(cryst, radii, 200) do qs
res = powder_average(cryst, radii, 400) do qs
intensities(swt, qs; energies, kernel)
end
plot_intensities(res; units)
2 changes: 1 addition & 1 deletion examples/spinw_tutorials/SW19_Different_Ions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ plot_spins(sys)

swt = SpinWaveTheory(sys; measure=ssf_perp(sys))
qs = [[0,0,0], [1,0,0]]
path = q_space_path(cryst, qs, 512)
path = q_space_path(cryst, qs, 400)

# Plot three types of pair correlation intensities

Expand Down

0 comments on commit bdce95f

Please sign in to comment.