Skip to content

Commit

Permalink
build based on 920c134
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jan 11, 2024
1 parent 2433da9 commit 572df82
Show file tree
Hide file tree
Showing 23 changed files with 93 additions and 121 deletions.
2 changes: 1 addition & 1 deletion previews/PR208/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-01-10T15:16:15","documenter_version":"1.2.1"}}
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-01-11T21:03:23","documenter_version":"1.2.1"}}
38 changes: 12 additions & 26 deletions previews/PR208/assets/notebooks/03_LLD_CoRh2O4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,43 +81,28 @@
"cell_type": "code",
"source": [
"λ = 0.2 # Magnitude of damping (dimensionless)\n",
"kT = 16 * meV_per_K # 16K, a temperature slightly below ordering"
"kT = 16 * meV_per_K # 16K, a temperature slightly below ordering\n",
"langevin = Langevin(; λ, kT)"
],
"metadata": {},
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"Use `suggest_timestep` to obtain a reasonable integration timestep.\n",
"The spin configuration in `sys` should ideally be equilibrated for the target\n",
"temperature `kT`, but the current, energy-minimized configuration will also\n",
"work reasonably well. Usually `tol=1e-2` is good tolerance to numerical error."
"Use `suggest_timestep` to select an integration timestep for the given\n",
"error tolerance, e.g. `tol=1e-2`. The spin configuration in `sys` should\n",
"ideally be relaxed into thermal equilibrium, but the current, energy-minimized\n",
"configuration will also work reasonably well."
],
"metadata": {}
},
{
"outputs": [],
"cell_type": "code",
"source": [
"suggest_timestep(sys; tol=1e-2, λ, kT)"
],
"metadata": {},
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"We now have all data needed to construct a Langevin integrator."
],
"metadata": {}
},
{
"outputs": [],
"cell_type": "code",
"source": [
"Δt = 0.025\n",
"langevin = Langevin(Δt; λ, kT);"
"suggest_timestep(sys, langevin; tol=1e-2)\n",
"langevin.Δt = 0.025"
],
"metadata": {},
"execution_count": null
Expand Down Expand Up @@ -146,16 +131,17 @@
{
"cell_type": "markdown",
"source": [
"Calling `check_timestep` indicates that our choice of `Δt` was a\n",
"little smaller than necessary; increasing it will improve efficiency."
"Now that the spin configuration has relaxed, we can learn that `Δt` was a\n",
"little smaller than necessary; increasing it will make the remaining\n",
"simulations faster."
],
"metadata": {}
},
{
"outputs": [],
"cell_type": "code",
"source": [
"check_timestep(sys, langevin; tol=1e-2)\n",
"suggest_timestep(sys, langevin; tol=1e-2)\n",
"langevin.Δt = 0.042"
],
"metadata": {},
Expand Down
48 changes: 17 additions & 31 deletions previews/PR208/assets/notebooks/04_GSD_FeI2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
{
"cell_type": "markdown",
"source": [
"As previously observed, direct energy minimization is susceptible to trapping\n",
"in a local energy minimum."
"As previously observed\"), direct energy minimization is susceptible to trapping in a local\n",
"energy minimum."
],
"metadata": {}
},
Expand Down Expand Up @@ -138,53 +138,39 @@
"cell_type": "code",
"source": [
"λ = 0.2 # Dimensionless damping time-scale\n",
"kT = 0.2 # Temperature in meV"
"kT = 0.2 # Temperature in meV\n",
"langevin = Langevin(; λ, kT)"
],
"metadata": {},
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"Use `suggest_timestep` to obtain a reasonable integration timestep. It\n",
"is important that the system has already been initialized to a low-energy\n",
"configuration. Usually `tol=1e-2` is good tolerance to numerical error."
"Use `suggest_timestep` to select an integration timestep for the given\n",
"error tolerance, e.g. `tol=1e-2`. The spin configuration in `sys` should\n",
"ideally be relaxed into thermal equilibrium, but the current, energy-minimized\n",
"configuration will also work reasonably well."
],
"metadata": {}
},
{
"outputs": [],
"cell_type": "code",
"source": [
"suggest_timestep(sys; tol=1e-2, λ, kT)"
"suggest_timestep(sys, langevin; tol=1e-2)\n",
"langevin.Δt = 0.027"
],
"metadata": {},
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"This information is sufficient to define the Langevin integrator."
],
"metadata": {}
},
{
"outputs": [],
"cell_type": "code",
"source": [
"Δt = 0.027\n",
"langevin = Langevin(Δt; kT, λ);"
],
"metadata": {},
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"Langevin dynamics can be used to search for a magnetically ordered state. This\n",
"works well because the temperature `kT = 0.2` has been carefully selected. It\n",
"is below the ordering temperature, but large enough that the dynamical\n",
"trajectory can overcome local energy barriers and annihilate defects."
"Sample spin configurations using Langevin dynamics. We have carefully selected\n",
"a temperature of 0.2 eV that is below the ordering temperature, but large\n",
"enough to that the dynamics can overcome local energy barriers and annihilate\n",
"defects."
],
"metadata": {}
},
Expand All @@ -202,7 +188,7 @@
{
"cell_type": "markdown",
"source": [
"Calling `check_timestep` shows that thermalization has not\n",
"Calling `suggest_timestep` shows that thermalization has not\n",
"substantially altered the suggested `Δt`."
],
"metadata": {}
Expand All @@ -211,7 +197,7 @@
"outputs": [],
"cell_type": "code",
"source": [
"check_timestep(sys, langevin; tol=1e-2)"
"suggest_timestep(sys, langevin; tol=1e-2)"
],
"metadata": {},
"execution_count": null
Expand Down Expand Up @@ -297,7 +283,7 @@
"outputs": [],
"cell_type": "code",
"source": [
"check_timestep(sys_large, langevin; tol=1e-2)\n",
"suggest_timestep(sys_large, langevin; tol=1e-2)\n",
"langevin.Δt = 0.040"
],
"metadata": {},
Expand Down
9 changes: 4 additions & 5 deletions previews/PR208/assets/scripts/03_LLD_CoRh2O4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ sys = resize_supercell(sys, (10, 10, 10))

λ = 0.2 # Magnitude of damping (dimensionless)
kT = 16 * meV_per_K # 16K, a temperature slightly below ordering
langevin = Langevin(; λ, kT)

suggest_timestep(sys; tol=1e-2, λ, kT)

Δt = 0.025
langevin = Langevin(Δt; λ, kT);
suggest_timestep(sys, langevin; tol=1e-2)
langevin.Δt = 0.025

energies = [energy_per_site(sys)]
for _ in 1:1000
step!(sys, langevin)
push!(energies, energy_per_site(sys))
end

check_timestep(sys, langevin; tol=1e-2)
suggest_timestep(sys, langevin; tol=1e-2)
langevin.Δt = 0.042

plot(energies, color=:blue, figure=(size=(600,300),), axis=(xlabel="Timesteps", ylabel="Energy (meV)"))
Expand Down
11 changes: 5 additions & 6 deletions previews/PR208/assets/scripts/04_GSD_FeI2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,16 @@ plot_spins(sys; color=[s[3] for s in sys.dipoles])

λ = 0.2 # Dimensionless damping time-scale
kT = 0.2 # Temperature in meV
langevin = Langevin(; λ, kT)

suggest_timestep(sys; tol=1e-2, λ, kT)

Δt = 0.027
langevin = Langevin(Δt; kT, λ);
suggest_timestep(sys, langevin; tol=1e-2)
langevin.Δt = 0.027

for _ in 1:10_000
step!(sys, langevin)
end

check_timestep(sys, langevin; tol=1e-2)
suggest_timestep(sys, langevin; tol=1e-2)

plot_spins(sys; color=[s[3] for s in sys.dipoles])

Expand All @@ -64,7 +63,7 @@ for _ in 1:10_000
step!(sys_large, langevin)
end

check_timestep(sys_large, langevin; tol=1e-2)
suggest_timestep(sys_large, langevin; tol=1e-2)
langevin.Δt = 0.040

Δt = 2*langevin.Δt
Expand Down
2 changes: 1 addition & 1 deletion previews/PR208/examples/01_LSWT_SU3_FeI2.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@
fig = Figure()
ax = Axis(fig[1,1]; xlabel="Momentum (r.l.u.)", ylabel="Energy (meV)", xticks, xticklabelrotation=π/6)
heatmap!(ax, 1:size(is_averaged, 1), energies, is_averaged)
fig</code></pre><img src="01_LSWT_SU3_FeI2-5ad5f204.png" alt="Example block output"/><p>This result can be directly compared to experimental neutron scattering data from <a href="https://doi.org/10.1038/s41567-020-01110-1">Bai et al.</a></p><img src="https://raw.githubusercontent.com/SunnySuite/Sunny.jl/main/docs/src/assets/FeI2_intensity.jpg"><p>(The publication figure accidentally used a non-standard coordinate system to label the wave vectors.)</p><p>To get this agreement, the use of SU(3) coherent states is essential. In other words, we needed a theory of multi-flavored bosons. The lower band has large quadrupolar character, and arises from the strong easy-axis anisotropy of FeI₂. By setting <code>mode = :SUN</code>, the calculation captures this coupled dipole-quadrupole dynamics.</p><p>An interesting exercise is to repeat the same study, but using <code>mode = :dipole</code> instead of <code>:SUN</code>. That alternative choice would constrain the coherent state dynamics to the space of dipoles only.</p><p>The full dynamical spin structure factor (DSSF) can be retrieved as a <span>$3×3$</span> matrix with the <a href="../library.html#Sunny.dssf-Tuple{SpinWaveTheory, Any}"><code>dssf</code></a> function, for a given path of <span>$𝐪$</span>-vectors.</p><pre><code class="language-julia hljs">disp, is = dssf(swt, path);</code></pre><p>The first output <code>disp</code> is identical to that obtained from <code>dispersion</code>. The second output <code>is</code> contains a list of <span>$3×3$</span> matrix of intensities. For example, <code>is[q,n][2,3]</code> yields the <span>$(ŷ,ẑ)$</span> component of the structure factor intensity for <code>nth</code> mode at the <code>q</code>th wavevector in the <code>path</code>.</p><h2 id="What&#39;s-next?"><a class="docs-heading-anchor" href="#What&#39;s-next?">What&#39;s next?</a><a id="What&#39;s-next?-1"></a><a class="docs-heading-anchor-permalink" href="#What&#39;s-next?" title="Permalink"></a></h2><p>The multi-boson linear spin wave theory, applied above, can be understood as the quantization of a certain generalization of the Landau-Lifshitz spin dynamics. Rather than dipoles, this dynamics takes places on the space of <a href="https://arxiv.org/abs/2106.14125">SU(<em>N</em>) coherent states</a>.</p><p>The full SU(<em>N</em>) coherent state dynamics, with appropriate quantum correction factors, can be useful to model finite temperature scattering data. In particular, it captures certain anharmonic effects due to thermal fluctuations. See our <a href="04_GSD_FeI2.html#4.-Generalized-spin-dynamics-of-FeI-at-finite-*T*">generalized spin dynamics tutorial</a>.</p><p>The classical dynamics is also a good starting point to study non-equilibrium phenomena. Empirical noise and damping terms can be used to model <a href="https://arxiv.org/abs/2209.01265">coupling to a thermal bath</a>. This yields a Langevin dynamics of SU(<em>N</em>) coherent states. Our <a href="06_CP2_Skyrmions.html#6.-Dynamical-quench-into-CP-skyrmion-liquid">dynamical SU(<em>N</em>) quench</a> tutorial illustrates how a temperature quench can give rise to novel liquid phase of CP² skyrmions.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../index.html">« Overview</a><a class="docs-footer-nextpage" href="02_LSWT_CoRh2O4.html">2. Spin wave simulations of CoRh₂O₄ »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Wednesday 10 January 2024 15:16">Wednesday 10 January 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
fig</code></pre><img src="01_LSWT_SU3_FeI2-5ad5f204.png" alt="Example block output"/><p>This result can be directly compared to experimental neutron scattering data from <a href="https://doi.org/10.1038/s41567-020-01110-1">Bai et al.</a></p><img src="https://raw.githubusercontent.com/SunnySuite/Sunny.jl/main/docs/src/assets/FeI2_intensity.jpg"><p>(The publication figure accidentally used a non-standard coordinate system to label the wave vectors.)</p><p>To get this agreement, the use of SU(3) coherent states is essential. In other words, we needed a theory of multi-flavored bosons. The lower band has large quadrupolar character, and arises from the strong easy-axis anisotropy of FeI₂. By setting <code>mode = :SUN</code>, the calculation captures this coupled dipole-quadrupole dynamics.</p><p>An interesting exercise is to repeat the same study, but using <code>mode = :dipole</code> instead of <code>:SUN</code>. That alternative choice would constrain the coherent state dynamics to the space of dipoles only.</p><p>The full dynamical spin structure factor (DSSF) can be retrieved as a <span>$3×3$</span> matrix with the <a href="../library.html#Sunny.dssf-Tuple{SpinWaveTheory, Any}"><code>dssf</code></a> function, for a given path of <span>$𝐪$</span>-vectors.</p><pre><code class="language-julia hljs">disp, is = dssf(swt, path);</code></pre><p>The first output <code>disp</code> is identical to that obtained from <code>dispersion</code>. The second output <code>is</code> contains a list of <span>$3×3$</span> matrix of intensities. For example, <code>is[q,n][2,3]</code> yields the <span>$(ŷ,ẑ)$</span> component of the structure factor intensity for <code>nth</code> mode at the <code>q</code>th wavevector in the <code>path</code>.</p><h2 id="What&#39;s-next?"><a class="docs-heading-anchor" href="#What&#39;s-next?">What&#39;s next?</a><a id="What&#39;s-next?-1"></a><a class="docs-heading-anchor-permalink" href="#What&#39;s-next?" title="Permalink"></a></h2><p>The multi-boson linear spin wave theory, applied above, can be understood as the quantization of a certain generalization of the Landau-Lifshitz spin dynamics. Rather than dipoles, this dynamics takes places on the space of <a href="https://arxiv.org/abs/2106.14125">SU(<em>N</em>) coherent states</a>.</p><p>The full SU(<em>N</em>) coherent state dynamics, with appropriate quantum correction factors, can be useful to model finite temperature scattering data. In particular, it captures certain anharmonic effects due to thermal fluctuations. See our <a href="04_GSD_FeI2.html#4.-Generalized-spin-dynamics-of-FeI-at-finite-*T*">generalized spin dynamics tutorial</a>.</p><p>The classical dynamics is also a good starting point to study non-equilibrium phenomena. Empirical noise and damping terms can be used to model <a href="https://arxiv.org/abs/2209.01265">coupling to a thermal bath</a>. This yields a Langevin dynamics of SU(<em>N</em>) coherent states. Our <a href="06_CP2_Skyrmions.html#6.-Dynamical-quench-into-CP-skyrmion-liquid">dynamical SU(<em>N</em>) quench</a> tutorial illustrates how a temperature quench can give rise to novel liquid phase of CP² skyrmions.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../index.html">« Overview</a><a class="docs-footer-nextpage" href="02_LSWT_CoRh2O4.html">2. Spin wave simulations of CoRh₂O₄ »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Thursday 11 January 2024 21:03">Thursday 11 January 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion previews/PR208/examples/02_LSWT_CoRh2O4.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@
fig = Figure()
ax = Axis(fig[1,1]; xlabel=&quot;Q (Å⁻¹)&quot;, ylabel=&quot;ω (meV)&quot;)
heatmap!(ax, radii, energies, output, colormap=:gnuplot2)
fig</code></pre><img src="02_LSWT_CoRh2O4-19eaaa6f.png" alt="Example block output"/><p>This result can be compared to experimental neutron scattering data from Fig. 5 of <a href="https://doi.org/10.1103/PhysRevB.96.064413">Ge et al.</a></p><img width="95%" src="https://raw.githubusercontent.com/SunnySuite/Sunny.jl/main/docs/src/assets/CoRh2O4_intensity.jpg"></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="01_LSWT_SU3_FeI2.html">« 1. Multi-flavor spin wave simulations of FeI₂ (Showcase)</a><a class="docs-footer-nextpage" href="03_LLD_CoRh2O4.html">3. Landau-Lifshitz dynamics of CoRh₂O₄ at finite <em>T</em> »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Wednesday 10 January 2024 15:16">Wednesday 10 January 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
fig</code></pre><img src="02_LSWT_CoRh2O4-19eaaa6f.png" alt="Example block output"/><p>This result can be compared to experimental neutron scattering data from Fig. 5 of <a href="https://doi.org/10.1103/PhysRevB.96.064413">Ge et al.</a></p><img width="95%" src="https://raw.githubusercontent.com/SunnySuite/Sunny.jl/main/docs/src/assets/CoRh2O4_intensity.jpg"></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="01_LSWT_SU3_FeI2.html">« 1. Multi-flavor spin wave simulations of FeI₂ (Showcase)</a><a class="docs-footer-nextpage" href="03_LLD_CoRh2O4.html">3. Landau-Lifshitz dynamics of CoRh₂O₄ at finite <em>T</em> »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Thursday 11 January 2024 21:03">Thursday 11 January 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 572df82

Please sign in to comment.