Skip to content

Commit

Permalink
build based on 4c3b25b
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Aug 30, 2024
1 parent 5c84f34 commit 916cf78
Show file tree
Hide file tree
Showing 133 changed files with 154 additions and 145 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-08-30T22:33:06","documenter_version":"1.6.0"}}
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-08-30T22:42:16","documenter_version":"1.6.0"}}
31 changes: 22 additions & 9 deletions dev/assets/notebooks/07_Dipole_Dipole.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"\n",
"This example shows how long-range dipole-dipole interactions can affect a spin\n",
"wave calculation. These interactions can be included two ways: Ewald summation\n",
"or real-space space with a distance cutoff. The study follows [Del Maestro and\n",
"or in real-space with a distance cutoff. The study follows [Del Maestro and\n",
"Gingras, J. Phys.: Cond. Matter, **16**, 3339\n",
"(2004)](https://arxiv.org/abs/cond-mat/0403494)."
],
Expand All @@ -25,7 +25,7 @@
{
"cell_type": "markdown",
"source": [
"Create a Pyrochlore crystal from spacegroup 227."
"Create a pyrochlore crystal from spacegroup 227."
],
"metadata": {}
},
Expand All @@ -37,9 +37,22 @@
"latvecs = lattice_vectors(10.19, 10.19, 10.19, 90, 90, 90)\n",
"positions = [[1/8, 1/8, 1/8]]\n",
"cryst = Crystal(latvecs, positions, 227, setting=\"1\")\n",
"view_crystal(cryst)\n",
"\n",
"\n",
"view_crystal(cryst)"
],
"metadata": {},
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"Create a system with antiferromagnetic nearest neighbor exchange."
],
"metadata": {}
},
{
"outputs": [],
"cell_type": "code",
"source": [
"sys = System(cryst, [1 => Moment(s=7/2, g=2)], :dipole)\n",
"J1 = 0.304 # (K)\n",
"set_exchange!(sys, J1, Bond(1, 2, [0,0,0]))"
Expand All @@ -50,9 +63,9 @@
{
"cell_type": "markdown",
"source": [
"Reshape to the primitive cell with four atoms. To facilitate indexing, the\n",
"function `position_to_site` accepts positions with respect to the\n",
"original (cubic) cell."
"Reshape to the primitive cell, which contains four atoms. To facilitate\n",
"indexing, the function `position_to_site` accepts positions with\n",
"respect to the original (cubic) cell."
],
"metadata": {}
},
Expand Down Expand Up @@ -112,7 +125,7 @@
"source": [
"Create a panel that qualitatively reproduces Fig. 2 of [Del Maestro and\n",
"Gingras](https://arxiv.org/abs/cond-mat/0403494). That previous work had two\n",
"errors: The energy scales are too small by a factor of 2 and, in addition,\n",
"errors: Its energy scale is too small by a factor of 2 and, in addition,\n",
"slight corrections are needed for the third dispersion band."
],
"metadata": {}
Expand Down
1 change: 0 additions & 1 deletion dev/assets/scripts/07_Dipole_Dipole.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ positions = [[1/8, 1/8, 1/8]]
cryst = Crystal(latvecs, positions, 227, setting="1")
view_crystal(cryst)


sys = System(cryst, [1 => Moment(s=7/2, g=2)], :dipole)
J1 = 0.304 # (K)
set_exchange!(sys, J1, Bond(1, 2, [0,0,0]))
Expand Down
Binary file added dev/examples/01_LSWT_CoRh2O4-0816aea3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/examples/01_LSWT_CoRh2O4-15511db4.png
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 dev/examples/01_LSWT_CoRh2O4-566ac3d0.png
Binary file not shown.
Binary file removed dev/examples/01_LSWT_CoRh2O4-ad2c6958.png
Binary file not shown.
Binary file removed dev/examples/01_LSWT_CoRh2O4-b5f8c613.png
Binary file not shown.
Binary file added dev/examples/01_LSWT_CoRh2O4-e3d1c783.png
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 dev/examples/01_LSWT_CoRh2O4-e404dda4.png
Binary file not shown.
Binary file added dev/examples/01_LSWT_CoRh2O4-f461e50e.png
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 dev/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-566ac3d0.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-0816aea3.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-ad2c6958.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-e3d1c783.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-b5f8c613.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-15511db4.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-e404dda4.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.6.0 on <span class="colophon-date" title="Friday 30 August 2024 22:33">Friday 30 August 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-f461e50e.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.6.0 on <span class="colophon-date" title="Friday 30 August 2024 22:42">Friday 30 August 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Binary file added dev/examples/02_LLD_CoRh2O4-0521df61.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/examples/02_LLD_CoRh2O4-0c3d6f41.png
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 dev/examples/02_LLD_CoRh2O4-23795eaa.png
Binary file not shown.
Binary file added dev/examples/02_LLD_CoRh2O4-2726dd00.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/examples/02_LLD_CoRh2O4-31d1159c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dev/examples/02_LLD_CoRh2O4-34d57e84.png
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 dev/examples/02_LLD_CoRh2O4-3f9a0c95.png
Binary file not shown.
Binary file removed dev/examples/02_LLD_CoRh2O4-6409c2c5.png
Binary file not shown.
Binary file removed dev/examples/02_LLD_CoRh2O4-90d18826.png
Binary file not shown.
Binary file added dev/examples/02_LLD_CoRh2O4-97a1a4d9.png
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 dev/examples/02_LLD_CoRh2O4-c82b7fa0.png
Binary file not shown.
Binary file removed dev/examples/02_LLD_CoRh2O4-caecd106.png
Binary file not shown.
Binary file removed dev/examples/02_LLD_CoRh2O4-d13c37fc.png
Binary file not shown.
Binary file added dev/examples/02_LLD_CoRh2O4-e6792613.png
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 916cf78

Please sign in to comment.