Skip to content

Commit

Permalink
build based on 946b2cd
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Oct 19, 2023
1 parent 8248077 commit 473fc9f
Show file tree
Hide file tree
Showing 31 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion previews/PR178/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-19T21:07:34","documenter_version":"1.1.1"}}
{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-19T21:44:06","documenter_version":"1.1.1"}}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed previews/PR178/examples/fei2_classical-6b435b86.png
Binary file not shown.
Binary file removed previews/PR178/examples/fei2_classical-8a214f0c.png
Binary file not shown.
Binary file removed previews/PR178/examples/fei2_classical-9fe52114.png
Binary file not shown.
Binary file removed previews/PR178/examples/fei2_classical-a20d933e.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed previews/PR178/examples/fei2_classical-ef051221.png
Binary file not shown.
Binary file removed previews/PR178/examples/fei2_classical-ffcf4af4.png
Binary file not shown.
14 changes: 7 additions & 7 deletions previews/PR178/examples/fei2_classical.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
langevin = Langevin(Δt; kT, λ);</code></pre><p>Langevin dynamics can be used to search for a magnetically ordered state. For this, the temperature <code>kT</code> must be below the ordering temperature, but large enough that the dynamical sampling procedure can overcome local energy barriers and eliminate defects.</p><pre><code class="language-julia hljs">randomize_spins!(sys)
for _ in 1:20_000
step!(sys, langevin)
end</code></pre><p>Although thermal fluctuations are present, the correct antiferromagnetic order (2 up, 2 down) is apparent.</p><pre><code class="language-julia hljs">plot_spins(sys; color=[s[3] for s in sys.dipoles])</code></pre><img src="fei2_classical-02ffd1ac.png" alt="Example block output"/><p>For other systems, it can be much harder to find the magnetic ordering in an unbiased way, and more complicated sampling procedures may be necessary.</p><h2 id="Calculating-Thermal-Averaged-Correlations-\\langle-S{\\alpha\\beta}(𝐪,ω)\\rangle"><a class="docs-heading-anchor" href="#Calculating-Thermal-Averaged-Correlations-\\langle-S{\\alpha\\beta}(𝐪,ω)\\rangle">Calculating Thermal-Averaged Correlations <span>$\langle S^{\alpha\beta}(𝐪,ω)\rangle$</span></a><a id="Calculating-Thermal-Averaged-Correlations-\\langle-S{\\alpha\\beta}(𝐪,ω)\\rangle-1"></a><a class="docs-heading-anchor-permalink" href="#Calculating-Thermal-Averaged-Correlations-\\langle-S{\\alpha\\beta}(𝐪,ω)\\rangle" title="Permalink"></a></h2><p>Our aim is to study the classical spin dynamics for states sampled in thermal equilibrium. To minimize finite size effects, and achieve sufficient momentum space resolution, we should significantly enlarge the system volume. The function <a href="../library.html#Sunny.resize_supercell-Union{Tuple{N}, Tuple{System{N}, Tuple{Int64, Int64, Int64}}} where N"><code>resize_supercell</code></a> takes new dimensions as multiples of the unit cell lattice vectors.</p><pre><code class="language-julia hljs">sys_large = resize_supercell(sys, (16,16,4)) # 16x16x4 copies of the original unit cell
plot_spins(sys_large; color=[s[3] for s in sys_large.dipoles])</code></pre><img src="fei2_classical-8a214f0c.png" alt="Example block output"/><p>Now we will re-thermalize the system to a configuration just above the ordering temperature. Sunny expects energies in meV by default, so we use <code>meV_per_K</code> to convert from kelvin.</p><pre><code class="language-julia hljs">kT = 3.5 * meV_per_K # 3.5K ≈ 0.30 meV
end</code></pre><p>Although thermal fluctuations are present, the correct antiferromagnetic order (2 up, 2 down) is apparent.</p><pre><code class="language-julia hljs">plot_spins(sys; color=[s[3] for s in sys.dipoles])</code></pre><img src="fei2_classical-d9d4a8b2.png" alt="Example block output"/><p>For other systems, it can be much harder to find the magnetic ordering in an unbiased way, and more complicated sampling procedures may be necessary.</p><h2 id="Calculating-Thermal-Averaged-Correlations-\\langle-S{\\alpha\\beta}(𝐪,ω)\\rangle"><a class="docs-heading-anchor" href="#Calculating-Thermal-Averaged-Correlations-\\langle-S{\\alpha\\beta}(𝐪,ω)\\rangle">Calculating Thermal-Averaged Correlations <span>$\langle S^{\alpha\beta}(𝐪,ω)\rangle$</span></a><a id="Calculating-Thermal-Averaged-Correlations-\\langle-S{\\alpha\\beta}(𝐪,ω)\\rangle-1"></a><a class="docs-heading-anchor-permalink" href="#Calculating-Thermal-Averaged-Correlations-\\langle-S{\\alpha\\beta}(𝐪,ω)\\rangle" title="Permalink"></a></h2><p>Our aim is to study the classical spin dynamics for states sampled in thermal equilibrium. To minimize finite size effects, and achieve sufficient momentum space resolution, we should significantly enlarge the system volume. The function <a href="../library.html#Sunny.resize_supercell-Union{Tuple{N}, Tuple{System{N}, Tuple{Int64, Int64, Int64}}} where N"><code>resize_supercell</code></a> takes new dimensions as multiples of the unit cell lattice vectors.</p><pre><code class="language-julia hljs">sys_large = resize_supercell(sys, (16,16,4)) # 16x16x4 copies of the original unit cell
plot_spins(sys_large; color=[s[3] for s in sys_large.dipoles])</code></pre><img src="fei2_classical-37669981.png" alt="Example block output"/><p>Now we will re-thermalize the system to a configuration just above the ordering temperature. Sunny expects energies in meV by default, so we use <code>meV_per_K</code> to convert from kelvin.</p><pre><code class="language-julia hljs">kT = 3.5 * meV_per_K # 3.5K ≈ 0.30 meV
langevin.kT = kT
for _ in 1:10_000
step!(sys_large, langevin)
Expand Down Expand Up @@ -51,7 +51,7 @@
fig = lines(ωs, is[1,:]; axis=(xlabel=&quot;meV&quot;, ylabel=&quot;Intensity&quot;), label=&quot;(0,0,0)&quot;)
lines!(ωs, is[2,:]; label=&quot;(π,π,π)&quot;)
axislegend()
fig</code></pre><img src="fei2_classical-6b435b86.png" alt="Example block output"/><p>The resolution in energy can be improved by increasing <code></code> (and decreasing <code>Δt</code>), and the general accuracy can be improved by collecting additional samples from the thermal equilibrium.</p><p>For real calculations, one often wants to apply further corrections and more accurate formulas. Here, we apply <a href="../library.html#Sunny.FormFactor-Tuple{String}"><code>FormFactor</code></a> corrections appropriate for <code>Fe2</code> magnetic ions, and a dipole polarization correction <code>:perp</code>.</p><pre><code class="language-julia hljs">formfactors = [FormFactor(&quot;Fe2&quot;; g_lande=3/2)]
fig</code></pre><img src="fei2_classical-5bbe0388.png" alt="Example block output"/><p>The resolution in energy can be improved by increasing <code></code> (and decreasing <code>Δt</code>), and the general accuracy can be improved by collecting additional samples from the thermal equilibrium.</p><p>For real calculations, one often wants to apply further corrections and more accurate formulas. Here, we apply <a href="../library.html#Sunny.FormFactor-Tuple{String}"><code>FormFactor</code></a> corrections appropriate for <code>Fe2</code> magnetic ions, and a dipole polarization correction <code>:perp</code>.</p><pre><code class="language-julia hljs">formfactors = [FormFactor(&quot;Fe2&quot;; g_lande=3/2)]
new_formula = intensity_formula(sc, :perp; kT, formfactors = formfactors)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"><span class="sgr4"><span class="sgr1">Classical Scattering Intensity Formula</span></span>
At discrete scattering modes S = S[ix_q,ix_ω], use:

Expand Down Expand Up @@ -95,7 +95,7 @@
colorrange=(0.0,0.05),
)

fig</code></pre><img src="fei2_classical-9fe52114.png" alt="Example block output"/><p>Note that we have clipped the colors in order to make the higher-energy excitations more visible.</p><h1 id="Unconventional-RLU-Systems-and-Constant-Energy-Cuts"><a class="docs-heading-anchor" href="#Unconventional-RLU-Systems-and-Constant-Energy-Cuts">Unconventional RLU Systems and Constant Energy Cuts</a><a id="Unconventional-RLU-Systems-and-Constant-Energy-Cuts-1"></a><a class="docs-heading-anchor-permalink" href="#Unconventional-RLU-Systems-and-Constant-Energy-Cuts" title="Permalink"></a></h1><p>Often it is useful to plot cuts across multiple wave vectors but at a single energy. We&#39;ll pick an energy,</p><pre><code class="language-julia hljs">ωidx = 60
fig</code></pre><img src="fei2_classical-aeef10b0.png" alt="Example block output"/><p>Note that we have clipped the colors in order to make the higher-energy excitations more visible.</p><h1 id="Unconventional-RLU-Systems-and-Constant-Energy-Cuts"><a class="docs-heading-anchor" href="#Unconventional-RLU-Systems-and-Constant-Energy-Cuts">Unconventional RLU Systems and Constant Energy Cuts</a><a id="Unconventional-RLU-Systems-and-Constant-Energy-Cuts-1"></a><a class="docs-heading-anchor-permalink" href="#Unconventional-RLU-Systems-and-Constant-Energy-Cuts" title="Permalink"></a></h1><p>Often it is useful to plot cuts across multiple wave vectors but at a single energy. We&#39;ll pick an energy,</p><pre><code class="language-julia hljs">ωidx = 60
target_ω = ωs[ωidx]</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">3.7312072301840273</code></pre><p>and take a constant-energy cut at that energy. The most straightforward way is to make a plot whose axes are aligned with the conventional reciprocal lattice of the crystal. This is accomplished using <a href="../library.html#Sunny.unit_resolution_binning_parameters-Tuple{Any, Any, Vararg{Any}}"><code>unit_resolution_binning_parameters</code></a>:</p><pre><code class="language-julia hljs">params = unit_resolution_binning_parameters(sc)
params.binstart[1:2] .= -1 # Expand plot range slightly

Expand Down Expand Up @@ -124,7 +124,7 @@
hm = heatmap!(ax,bcs[1],bcs[2],is[:,:,1,1] ./ counts[:,:,1,1])
add_lines!(ax,params)
Colorbar(fig[1,2], hm);
fig</code></pre><img src="fei2_classical-ef051221.png" alt="Example block output"/><p>In the above plot, the dashed-line (direct) lattice vectors are clearly orthogonal. However, we know that in real space, the lattice vectors <span>$a$</span> and <span>$b$</span> are <em>not</em> orthogonal, but rather point along the edges of a hexagon (see lower left corner):</p><br><img src="https://raw.githubusercontent.com/SunnySuite/Sunny.jl/main/docs/src/assets/FeI2_crystal.jpg" width="400"><br><p>Thus, plotting the direct lattice vectors as orthogonal (even in reciprocal space) is somewhat misleading. Worse yet, the <code>[H,0,0]</code> by <code>[0,K,0]</code> plot apparently loses the 6-fold symmetry of the crystal! Lastly, if one works out the components of the real-space metric with respect to the axes of the plot, one finds that there are non-zero off-diagonal entries,</p><pre><code class="language-julia hljs">latvecs = sys.crystal.latvecs
fig</code></pre><img src="fei2_classical-beba3fa5.png" alt="Example block output"/><p>In the above plot, the dashed-line (direct) lattice vectors are clearly orthogonal. However, we know that in real space, the lattice vectors <span>$a$</span> and <span>$b$</span> are <em>not</em> orthogonal, but rather point along the edges of a hexagon (see lower left corner):</p><br><img src="https://raw.githubusercontent.com/SunnySuite/Sunny.jl/main/docs/src/assets/FeI2_crystal.jpg" width="400"><br><p>Thus, plotting the direct lattice vectors as orthogonal (even in reciprocal space) is somewhat misleading. Worse yet, the <code>[H,0,0]</code> by <code>[0,K,0]</code> plot apparently loses the 6-fold symmetry of the crystal! Lastly, if one works out the components of the real-space metric with respect to the axes of the plot, one finds that there are non-zero off-diagonal entries,</p><pre><code class="language-julia hljs">latvecs = sys.crystal.latvecs
metric = latvecs&#39; * I(3) * latvecs</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">3×3 Matrix{Float64}:
16.4035 -8.20174 0.0
-8.20174 16.4035 0.0
Expand Down Expand Up @@ -161,7 +161,7 @@
is = intensities_interpolated(sc, qs, new_formula; interpolation=:linear)

add_lines!(ax_left,params)
fig</code></pre><img src="fei2_classical-ffcf4af4.png" alt="Example block output"/><p>Now, not only are the dashed-line lattice vectors no longer misleadingly orthogonal, but the six-fold symmetry has been restored as well! Further, the metric has been diagonalized:</p><pre><code class="language-julia hljs">metric = (latvecs * inv(A&#39;))&#39; * I(3) * (latvecs * inv(A&#39;))</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">3×3 Matrix{Float64}:
fig</code></pre><img src="fei2_classical-08cfb226.png" alt="Example block output"/><p>Now, not only are the dashed-line lattice vectors no longer misleadingly orthogonal, but the six-fold symmetry has been restored as well! Further, the metric has been diagonalized:</p><pre><code class="language-julia hljs">metric = (latvecs * inv(A&#39;))&#39; * I(3) * (latvecs * inv(A&#39;))</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">3×3 Matrix{Float64}:
16.4035 0.0 0.0
0.0 12.3026 0.0
0.0 0.0 45.5914</code></pre><p>Finally, we note that instantaneous structure factor data, <span>$𝒮(𝐪)$</span>, can be obtained from a dynamic structure factor with <a href="../library.html#Sunny.instant_intensities_interpolated-Tuple{SampledCorrelations, Any, Any}"><code>instant_intensities_interpolated</code></a>. Here we&#39;ll reuse the grid of wave vectors we generated above.</p><pre><code class="language-julia hljs">is_static = instant_intensities_interpolated(sc, qs, new_formula; interpolation = :linear)
Expand All @@ -175,4 +175,4 @@
)
)
Colorbar(hm.figure[1,2], hm.plot)
hm</code></pre><img src="fei2_classical-a20d933e.png" alt="Example block output"/></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="powder_averaging.html">« Powder Averaged CoRh₂O₄</a><a class="docs-footer-nextpage" href="ising2d.html">Classical Ising model »</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.1.1 on <span class="colophon-date" title="Thursday 19 October 2023 21:07">Thursday 19 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
hm</code></pre><img src="fei2_classical-d11744c7.png" alt="Example block output"/></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="powder_averaging.html">« Powder Averaged CoRh₂O₄</a><a class="docs-footer-nextpage" href="ising2d.html">Classical Ising model »</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.1.1 on <span class="colophon-date" title="Thursday 19 October 2023 21:44">Thursday 19 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 473fc9f

Please sign in to comment.