Skip to content

Commit

Permalink
build based on ca8cc6f
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Sep 17, 2024
1 parent dbc9c6b commit 864b6f9
Show file tree
Hide file tree
Showing 148 changed files with 143 additions and 143 deletions.
2 changes: 1 addition & 1 deletion previews/PR318/.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-16T22:03:34","documenter_version":"1.7.0"}}
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-17T19:28:53","documenter_version":"1.7.0"}}
8 changes: 4 additions & 4 deletions previews/PR318/assets/notebooks/09_Disordered_spectrum.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"qs = [[0, 0, 0], [1/3, 1/3, 0], [1/2, 0, 0], [0, 0, 0]]\n",
"labels = [\"Γ\", \"K\", \"M\", \"Γ\"]\n",
"path = q_space_path(cryst, qs, 150; labels)\n",
"kernel = gaussian(fwhm=0.4);"
"kernel = lorentzian(fwhm=0.4);"
],
"metadata": {},
"execution_count": null
Expand Down Expand Up @@ -144,8 +144,8 @@
"`SpinWaveTheory`. Using KPM, the cost of an `intensities`\n",
"calculation becomes linear in system size and scales inversely with the width\n",
"of the line broadening `kernel`. Error is controllable through the\n",
"dimensionless `tol` parameter. Reasonable choices are 0.1 (faster) or 0.01\n",
"(more accurate).\n",
"dimensionless `tol` parameter. A relatively small value is needed to resolve\n",
"the large intensities near the Goldstone mode.\n",
"\n",
"Observe that disorder in the nearest-neighbor exchange serves to broaden the\n",
"discrete excitation bands into a continuum."
Expand All @@ -156,7 +156,7 @@
"outputs": [],
"cell_type": "code",
"source": [
"swt = SpinWaveTheoryKPM(sys_inhom; measure=ssf_perp(sys_inhom), tol=0.1)\n",
"swt = SpinWaveTheoryKPM(sys_inhom; measure=ssf_perp(sys_inhom), tol=0.01)\n",
"res = intensities(swt, path; energies, kernel)\n",
"plot_intensities(res)"
],
Expand Down
4 changes: 2 additions & 2 deletions previews/PR318/assets/scripts/09_Disordered_spectrum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plot_spins(sys; color=[s[3] for s in sys.dipoles], ndims=2)
qs = [[0, 0, 0], [1/3, 1/3, 0], [1/2, 0, 0], [0, 0, 0]]
labels = ["Γ", "K", "M", "Γ"]
path = q_space_path(cryst, qs, 150; labels)
kernel = gaussian(fwhm=0.4);
kernel = lorentzian(fwhm=0.4);

energies = range(0.0, 3.0, 150)
swt = SpinWaveTheory(sys; measure=ssf_perp(sys))
Expand All @@ -29,7 +29,7 @@ end
minimize_energy!(sys_inhom, maxiters=5_000)
plot_spins(sys_inhom; color=[s[3] for s in sys_inhom.dipoles], ndims=2)

swt = SpinWaveTheoryKPM(sys_inhom; measure=ssf_perp(sys_inhom), tol=0.1)
swt = SpinWaveTheoryKPM(sys_inhom; measure=ssf_perp(sys_inhom), tol=0.01)
res = intensities(swt, path; energies, kernel)
plot_intensities(res)

Expand Down
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/PR318/examples/01_LSWT_CoRh2O4-1e2faf62.png
Binary file not shown.
Binary file not shown.
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/PR318/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-f235b95e.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-1e2faf62.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-1a6e5f2b.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-56bbb654.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-645cc5de.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-535f55cb.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-089d0cb9.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-5bee45a0.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 16 September 2024 22:03">Monday 16 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-f3481569.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="Tuesday 17 September 2024 19:28">Tuesday 17 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/PR318/examples/02_LLD_CoRh2O4-036315a1.png
Binary file not shown.
Binary file removed previews/PR318/examples/02_LLD_CoRh2O4-13f13a1e.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.
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/PR318/examples/02_LLD_CoRh2O4-9a112573.png
Binary file not shown.
Binary file removed previews/PR318/examples/02_LLD_CoRh2O4-ab0c437b.png
Binary file not shown.
Binary file removed previews/PR318/examples/02_LLD_CoRh2O4-c23f6837.png
Binary file not shown.
Binary file removed previews/PR318/examples/02_LLD_CoRh2O4-dc7d2541.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 864b6f9

Please sign in to comment.