Skip to content

Commit

Permalink
Tweaks to spinw port md
Browse files Browse the repository at this point in the history
  • Loading branch information
ddahlbom committed Sep 19, 2023
1 parent 688bbd1 commit 5ba8ce5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
15 changes: 7 additions & 8 deletions examples/contributed_examples/08_Kagome_AFM.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# # Kagome Antiferromagnet
#
# - Sunny port of the SpinW tutorial authored by Bjorn Fak and Sandor Toth,
# https://spinw.org/tutorials/08tutorial.
# - Authors: Harry Lane
# - Goal: Calculate the linear spin wave theory spectrum for the ``\sqrt{3}
# \times \sqrt{3}`` order of a Kagome antiferromagnet.
# - Sunny port of the SpinW [tutorial](https://spinw.org/tutorials/08tutorial) authored by Bjorn Fak and Sandor Toth,
# - Author: Harry Lane
# - Goal: Calculate the linear spin wave theory spectrum for the ``\sqrt{3} \times \sqrt{3}``
# order of a Kagome antiferromagnet.

# Load Packages

Expand All @@ -19,7 +18,7 @@ latvecs = lattice_vectors(a, b, c, 90, 90, 120)
crystal = Crystal(latvecs, [[1/2,0,0]], 147; types=["Cr"])

# Build a [`System`](@ref) with antiferrogmanetic nearest neighbor exchange
# $J=1$.
# ``J=1``.

S = 1
sys = System(crystal, (3,3,1), [SpinInfo(1; S, g=2)], :dipole)
Expand All @@ -44,13 +43,13 @@ plot_spins(sys; ghost_radius=30, orthographic=true)

points_rlu = [[-1/2, 0, 0], [0, 0, 0], [1/2, 1/2, 0]]
density = 100
path, xticks = reciprocal_space_path(crystal, points_rlu, density)
path, xticks = reciprocal_space_path(crystal, points_rlu, density);

# Calculate discrete intensities

swt = SpinWaveTheory(sys)
formula = intensity_formula(swt, :perp; kernel=delta_function_kernel)
disp, intensity = intensities_bands(swt, path, formula)
disp, intensity = intensities_bands(swt, path, formula);

# Plot over a restricted color range from [0,1e-2]. Note that the intensities of
# the flat band at zero-energy are divergent.
Expand Down
19 changes: 8 additions & 11 deletions examples/contributed_examples/15_Ba3NbFe3Si2O14.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# # Ba<sub>3</sub>NbFe<sub>3</sub>Si<sub>2</sub>O<sub>14</sub>
# # BaNbFe₃Si₂O₁₄
#
# - Sunny port of the SpinW tutorial authored by Toth et al.,
# https://spinw.org/tutorials/15tutorial.
# - Authors: Harry Lane
# - Goal: Calculate the linear spin wave theory spectrum for
# Ba<sub>3</sub>NbFe<sub>3</sub>Si<sub>2</sub>O<sub>14</sub>.
# - Sunny port of the SpinW [tutorial](https://spinw.org/tutorials/15tutorial) authored by Toth et al.
# - Author: Harry Lane
# - Goal: Calculate the linear spin wave theory spectrum for Ba₃NbFe₃Si₂O₁₄

# Load Packages
# Load packages

using Sunny, GLMakie

# Build a [`Crystal`](@ref) for
# Ba<sub>3</sub>NbFe<sub>3</sub>Si<sub>2</sub>O<sub>14</sub> using the crystal
# Build a [`Crystal`](@ref) for Ba₃NbFe₃Si₂O₁₄ using the crystal
# structure from [Marty et al., Phys. Rev. Lett. **101**, 247201
# (2008)](http://dx.doi.org/10.1103/PhysRevLett.101.247201).

Expand All @@ -25,7 +22,7 @@ crystal = subcrystal(langasite, "Fe")
view_crystal(crystal, 7)

# Create a [`System`](@ref) with a lattice size of $(1,1,7)$. The magnetic
# structure of Ba<sub>3</sub>NbFe<sub>3</sub>Si<sub>2</sub>O<sub>14</sub> was
# structure of BaNbFe₃Si₂O₁₄ was
# determined to have the ordering wavevector $𝐐=(0,0,1/7)$ and hence the
# magnetic unit cell has 7 sites. By passing an explicit `seed`, the system's
# random number generator will give repeatable results.
Expand Down Expand Up @@ -93,7 +90,7 @@ swt = SpinWaveTheory(sys)
γ = 0.15 # width in meV
broadened_formula = intensity_formula(swt, :perp; kernel=lorentzian(γ))
energies = collect(0:0.01:6) # 0 < ω < 6 (meV).
is = intensities_broadened(swt, path, energies, broadened_formula)
is = intensities_broadened(swt, path, energies, broadened_formula);

# Plot

Expand Down

0 comments on commit 5ba8ce5

Please sign in to comment.