Skip to content

Commit

Permalink
build based on a003305
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Sep 30, 2024
1 parent 7f2e846 commit 35821ca
Show file tree
Hide file tree
Showing 143 changed files with 136 additions and 136 deletions.
2 changes: 1 addition & 1 deletion previews/PR322/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-30T22:01:05","documenter_version":"1.7.0"}}
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-30T22:42:01","documenter_version":"1.7.0"}}
6 changes: 3 additions & 3 deletions previews/PR322/assets/notebooks/02_LLD_CoRh2O4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@
{
"cell_type": "markdown",
"source": [
"Plot energy versus time using the [Makie `lines`\n",
"function](https://docs.makie.org/stable/reference/plots/lines). The plateau\n",
"suggests that the system has reached thermal equilibrium."
"Plot energy versus time using the Makie\n",
"[`lines`](https://docs.makie.org/stable/reference/plots/lines) function. The\n",
"plateau suggests that the system has reached thermal equilibrium."
],
"metadata": {}
},
Expand Down
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.
Binary file removed previews/PR322/examples/01_LSWT_CoRh2O4-77ef9f2c.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.
Binary file not shown.
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.
8 changes: 4 additions & 4 deletions previews/PR322/examples/01_LSWT_CoRh2O4.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
set_exchange!(sys, J, Bond(1, 3, [0, 0, 0]))
view_crystal(sys)</code></pre><img src="01_LSWT_CoRh2O4-9fc04702.png" alt="Example block output"/><h3 id="Optimizing-spins"><a class="docs-heading-anchor" href="#Optimizing-spins">Optimizing spins</a><a id="Optimizing-spins-1"></a><a class="docs-heading-anchor-permalink" href="#Optimizing-spins" title="Permalink"></a></h3><p>To search for the ground state, call <a href="../library.html#Sunny.randomize_spins!-Union{Tuple{System{N}}, Tuple{N}} where N"><code>randomize_spins!</code></a> and <a href="../library.html#Sunny.minimize_energy!-Union{Tuple{System{N}}, Tuple{N}} where N"><code>minimize_energy!</code></a> in sequence. For this problem, optimization converges rapidly to the expected Néel order. See this with <a href="../library.html#Sunny.plot_spins"><code>plot_spins</code></a>, where spins are colored according to their global <span>$z$</span>-component.</p><pre><code class="language-julia hljs">randomize_spins!(sys)
minimize_energy!(sys)
plot_spins(sys; color=[S[3] for S in sys.dipoles])</code></pre><img src="01_LSWT_CoRh2O4-77ef9f2c.png" alt="Example block output"/><p>The diamond lattice is bipartite, allowing each spin to perfectly anti-align with its 4 nearest-neighbors. Each of these 4 bonds contribute <span>$-J s^2$</span> to the total energy. Two sites participate in each bond, so the energy per site is <span>$-2 J s^2$</span>. Check this by calling <a href="../library.html#Sunny.energy_per_site-Union{Tuple{System{N}}, Tuple{N}} where N"><code>energy_per_site</code></a>.</p><pre><code class="language-julia hljs">@assert energy_per_site(sys) ≈ -2J*(3/2)^2</code></pre><h3 id="Reshaping-the-magnetic-cell"><a class="docs-heading-anchor" href="#Reshaping-the-magnetic-cell">Reshaping the magnetic cell</a><a id="Reshaping-the-magnetic-cell-1"></a><a class="docs-heading-anchor-permalink" href="#Reshaping-the-magnetic-cell" title="Permalink"></a></h3><p>The most compact magnetic cell for this Néel order is a primitive unit cell. Reduce the magnetic cell size using <a href="../library.html#Sunny.reshape_supercell-Tuple{System, Any}"><code>reshape_supercell</code></a>, where columns of the <code>shape</code> matrix are primitive lattice vectors as multiples of the conventional cubic lattice vectors <span>$(𝐚_1, 𝐚_2, 𝐚_3)$</span>. One could alternatively use <code>shape = cryst.latvecs \ cryst.prim_latvecs</code>. Verify that the energy per site is unchanged after the reshaping the supercell.</p><pre><code class="language-julia hljs">shape = [0 1 1;
plot_spins(sys; color=[S[3] for S in sys.dipoles])</code></pre><img src="01_LSWT_CoRh2O4-81bd067c.png" alt="Example block output"/><p>The diamond lattice is bipartite, allowing each spin to perfectly anti-align with its 4 nearest-neighbors. Each of these 4 bonds contribute <span>$-J s^2$</span> to the total energy. Two sites participate in each bond, so the energy per site is <span>$-2 J s^2$</span>. Check this by calling <a href="../library.html#Sunny.energy_per_site-Union{Tuple{System{N}}, Tuple{N}} where N"><code>energy_per_site</code></a>.</p><pre><code class="language-julia hljs">@assert energy_per_site(sys) ≈ -2J*(3/2)^2</code></pre><h3 id="Reshaping-the-magnetic-cell"><a class="docs-heading-anchor" href="#Reshaping-the-magnetic-cell">Reshaping the magnetic cell</a><a id="Reshaping-the-magnetic-cell-1"></a><a class="docs-heading-anchor-permalink" href="#Reshaping-the-magnetic-cell" title="Permalink"></a></h3><p>The most compact magnetic cell for this Néel order is a primitive unit cell. Reduce the magnetic cell size using <a href="../library.html#Sunny.reshape_supercell-Tuple{System, Any}"><code>reshape_supercell</code></a>, where columns of the <code>shape</code> matrix are primitive lattice vectors as multiples of the conventional cubic lattice vectors <span>$(𝐚_1, 𝐚_2, 𝐚_3)$</span>. One could alternatively use <code>shape = cryst.latvecs \ cryst.prim_latvecs</code>. Verify that the energy per site is unchanged after the reshaping the supercell.</p><pre><code class="language-julia hljs">shape = [0 1 1;
1 0 1;
1 1 0] / 2
sys_prim = reshape_supercell(sys, shape)
@assert energy_per_site(sys_prim) ≈ -2J*(3/2)^2</code></pre><p>Plotting <code>sys_prim</code> shows the two spins within the primitive cell, as well as the larger conventional cubic cell for context.</p><pre><code class="language-julia hljs">plot_spins(sys_prim; color=[S[3] for S in sys_prim.dipoles])</code></pre><img src="01_LSWT_CoRh2O4-85ba4168.png" alt="Example block output"/><h3 id="Spin-wave-theory"><a class="docs-heading-anchor" href="#Spin-wave-theory">Spin wave theory</a><a id="Spin-wave-theory-1"></a><a class="docs-heading-anchor-permalink" href="#Spin-wave-theory" title="Permalink"></a></h3><p>With this primitive cell, we will perform a <a href="../library.html#Sunny.SpinWaveTheory"><code>SpinWaveTheory</code></a> calculation of the structure factor <span>$\mathcal{S}(𝐪,ω)$</span>. The measurement <a href="../library.html#Sunny.ssf_perp-Tuple{System}"><code>ssf_perp</code></a> indicates projection of the spin structure factor <span>$\mathcal{S}(𝐪,ω)$</span> perpendicular to the direction of momentum transfer, as appropriate for unpolarized neutron scattering. The isotropic <a href="../library.html#Sunny.FormFactor-Tuple{String}"><code>FormFactor</code></a> for Co²⁺ dampens intensities at large <span>$𝐪$</span>.</p><pre><code class="language-julia hljs">formfactors = [1 =&gt; FormFactor(&quot;Co2&quot;)]
@assert energy_per_site(sys_prim) ≈ -2J*(3/2)^2</code></pre><p>Plotting <code>sys_prim</code> shows the two spins within the primitive cell, as well as the larger conventional cubic cell for context.</p><pre><code class="language-julia hljs">plot_spins(sys_prim; color=[S[3] for S in sys_prim.dipoles])</code></pre><img src="01_LSWT_CoRh2O4-d695f915.png" alt="Example block output"/><h3 id="Spin-wave-theory"><a class="docs-heading-anchor" href="#Spin-wave-theory">Spin wave theory</a><a id="Spin-wave-theory-1"></a><a class="docs-heading-anchor-permalink" href="#Spin-wave-theory" title="Permalink"></a></h3><p>With this primitive cell, we will perform a <a href="../library.html#Sunny.SpinWaveTheory"><code>SpinWaveTheory</code></a> calculation of the structure factor <span>$\mathcal{S}(𝐪,ω)$</span>. The measurement <a href="../library.html#Sunny.ssf_perp-Tuple{System}"><code>ssf_perp</code></a> indicates projection of the spin structure factor <span>$\mathcal{S}(𝐪,ω)$</span> perpendicular to the direction of momentum transfer, as appropriate for unpolarized neutron scattering. The isotropic <a href="../library.html#Sunny.FormFactor-Tuple{String}"><code>FormFactor</code></a> for Co²⁺ dampens intensities at large <span>$𝐪$</span>.</p><pre><code class="language-julia hljs">formfactors = [1 =&gt; FormFactor(&quot;Co2&quot;)]
measure = ssf_perp(sys_prim; formfactors)
swt = SpinWaveTheory(sys_prim; measure)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"><span class="sgr4"><span class="sgr1">SpinWaveTheory [Dipole mode]</span></span>
2 atoms
Expand All @@ -37,8 +37,8 @@
[0, 0, 0] → [1/2, 0, 0] → [1/2, 1/2, 0] → [0, 0, 0]
</code></pre><p>Calculate single-crystal scattering <a href="../library.html#Sunny.intensities-Tuple{Sunny.AbstractSpinWaveTheory, Any}"><code>intensities</code></a> along this path, for energies between 0 and 6 meV. Use <a href="../library.html#Sunny.plot_intensities"><code>plot_intensities</code></a> to visualize the result.</p><pre><code class="language-julia hljs">energies = range(0, 6, 300)
res = intensities(swt, path; energies, kernel)
plot_intensities(res; units, title=&quot;CoRh₂O₄ LSWT&quot;)</code></pre><img src="01_LSWT_CoRh2O4-04108b65.png" alt="Example block output"/><p>Sometimes experimental data is only available as a powder average, i.e., as an average over all possible crystal orientations. Use <a href="../library.html#Sunny.powder_average-Tuple{Any, Any, Any, Int64}"><code>powder_average</code></a> to simulate these intensities. Each <span>$𝐪$</span>-magnitude defines a spherical shell in reciprocal space. Consider 200 radii from 0 to 3 inverse angstroms, and collect <code>2000</code> random samples per spherical shell. As configured, this calculation completes in about two seconds. Had we used the conventional cubic cell, the calculation would be an order of magnitude slower.</p><pre><code class="language-julia hljs">radii = range(0, 3, 200) # (1/Å)
plot_intensities(res; units, title=&quot;CoRh₂O₄ LSWT&quot;)</code></pre><img src="01_LSWT_CoRh2O4-b5fd808f.png" alt="Example block output"/><p>Sometimes experimental data is only available as a powder average, i.e., as an average over all possible crystal orientations. Use <a href="../library.html#Sunny.powder_average-Tuple{Any, Any, Any, Int64}"><code>powder_average</code></a> to simulate these intensities. Each <span>$𝐪$</span>-magnitude defines a spherical shell in reciprocal space. Consider 200 radii from 0 to 3 inverse angstroms, and collect <code>2000</code> random samples per spherical shell. As configured, this calculation completes in about two seconds. Had we used the conventional cubic cell, the calculation would be an order of magnitude slower.</p><pre><code class="language-julia hljs">radii = range(0, 3, 200) # (1/Å)
res = powder_average(cryst, radii, 2000) do qs
intensities(swt, qs; energies, kernel)
end
plot_intensities(res; units, saturation=1.0, title=&quot;CoRh₂O₄ Powder Average&quot;)</code></pre><img src="01_LSWT_CoRh2O4-b1fa1bed.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"><h3 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></h3><ul><li>For more spin wave calculations of this type, browse the <a href="spinw/SW01_FM_Heseinberg_chain.html#SW01-FM-Heisenberg-chain">SpinW tutorials ported to Sunny</a>.</li><li>Spin wave theory neglects thermal fluctuations of the magnetic order. The <a href="02_LLD_CoRh2O4.html#2.-Landau-Lifshitz-dynamics-of-CoRhO-at-finite-*T*">next CoRh₂O₄ tutorial</a> demonstrates how to sample spins in thermal equilibrium, and measure dynamical correlations from the classical spin dynamics.</li><li>Sunny also offers features that go beyond the dipole approximation of a quantum spin via the theory of SU(<em>N</em>) coherent states. This can be especially useful for systems with strong single-ion anisotropy, as demonstrated in the <a href="03_LSWT_SU3_FeI2.html#3.-Multi-flavor-spin-wave-simulations-of-FeI">FeI₂ tutorial</a>.</li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../index.html">« Overview</a><a class="docs-footer-nextpage" href="02_LLD_CoRh2O4.html">2. 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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 30 September 2024 22:01">Monday 30 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
plot_intensities(res; units, saturation=1.0, title=&quot;CoRh₂O₄ Powder Average&quot;)</code></pre><img src="01_LSWT_CoRh2O4-4e28b8b9.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"><h3 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></h3><ul><li>For more spin wave calculations of this type, browse the <a href="spinw/SW01_FM_Heseinberg_chain.html#SW01-FM-Heisenberg-chain">SpinW tutorials ported to Sunny</a>.</li><li>Spin wave theory neglects thermal fluctuations of the magnetic order. The <a href="02_LLD_CoRh2O4.html#2.-Landau-Lifshitz-dynamics-of-CoRhO-at-finite-*T*">next CoRh₂O₄ tutorial</a> demonstrates how to sample spins in thermal equilibrium, and measure dynamical correlations from the classical spin dynamics.</li><li>Sunny also offers features that go beyond the dipole approximation of a quantum spin via the theory of SU(<em>N</em>) coherent states. This can be especially useful for systems with strong single-ion anisotropy, as demonstrated in the <a href="03_LSWT_SU3_FeI2.html#3.-Multi-flavor-spin-wave-simulations-of-FeI">FeI₂ tutorial</a>.</li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../index.html">« Overview</a><a class="docs-footer-nextpage" href="02_LLD_CoRh2O4.html">2. 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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Monday 30 September 2024 22:42">Monday 30 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Binary file removed previews/PR322/examples/02_LLD_CoRh2O4-07973796.png
Binary file not shown.
Binary file removed previews/PR322/examples/02_LLD_CoRh2O4-09d26611.png
Binary file not shown.
Binary file removed previews/PR322/examples/02_LLD_CoRh2O4-139c15e7.png
Binary file not shown.
Binary file removed previews/PR322/examples/02_LLD_CoRh2O4-152ad861.png
Binary file not shown.
Binary file removed previews/PR322/examples/02_LLD_CoRh2O4-223827ba.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.
Binary file removed previews/PR322/examples/02_LLD_CoRh2O4-3fbb1ee9.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.
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/PR322/examples/02_LLD_CoRh2O4-c88af4ec.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

0 comments on commit 35821ca

Please sign in to comment.