From dd25382660c46da47c35ea59cbeb005802b462aa Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Mon, 9 Dec 2024 15:44:17 +0000 Subject: [PATCH] build based on 5e80721 --- previews/PR342/.documenter-siteinfo.json | 2 +- .../assets/notebooks/01_LSWT_CoRh2O4.ipynb | 2 +- .../assets/notebooks/02_LLD_CoRh2O4.ipynb | 2 +- .../assets/notebooks/03_LSWT_SU3_FeI2.ipynb | 2 +- .../PR342/assets/notebooks/04_GSD_FeI2.ipynb | 2 +- .../PR342/assets/notebooks/05_MC_Ising.ipynb | 2 +- .../assets/notebooks/06_CP2_Skyrmions.ipynb | 2 +- .../assets/notebooks/07_Dipole_Dipole.ipynb | 2 +- .../notebooks/08_Momentum_Conventions.ipynb | 2 +- .../assets/notebooks/09_Disorder_KPM.ipynb | 2 +- .../notebooks/SW01_FM_Heseinberg_chain.ipynb | 2 +- .../notebooks/SW02_AFM_Heisenberg_chain.ipynb | 2 +- .../notebooks/SW03_Frustrated_chain.ipynb | 2 +- .../notebooks/SW04_Frustrated_square.ipynb | 2 +- .../notebooks/SW05_Simple_kagome_FM.ipynb | 2 +- .../notebooks/SW06_Complex_kagome_FM.ipynb | 2 +- .../assets/notebooks/SW07_k0_kagome_AFM.ipynb | 2 +- .../notebooks/SW08_sqrt3_kagome_AFM.ipynb | 2 +- .../notebooks/SW09_k0_kagome_AFM_DM.ipynb | 2 +- .../assets/notebooks/SW10_Energy_cut.ipynb | 2 +- .../PR342/assets/notebooks/SW11_La2CuO4.ipynb | 2 +- .../SW12_Triangular_easy_plane.ipynb | 2 +- .../PR342/assets/notebooks/SW13_LiNiPO4.ipynb | 2 +- .../PR342/assets/notebooks/SW14_YVO3.ipynb | 2 +- .../notebooks/SW15_Ba3NbFe3Si2O14.ipynb | 2 +- .../notebooks/SW18_Distorted_kagome.ipynb | 2 +- .../notebooks/SW19_Different_Ions.ipynb | 2 +- .../PR342/assets/scripts/01_LSWT_CoRh2O4.jl | 2 +- .../PR342/assets/scripts/02_LLD_CoRh2O4.jl | 2 +- .../PR342/assets/scripts/03_LSWT_SU3_FeI2.jl | 2 +- previews/PR342/assets/scripts/04_GSD_FeI2.jl | 2 +- previews/PR342/assets/scripts/05_MC_Ising.jl | 2 +- .../PR342/assets/scripts/06_CP2_Skyrmions.jl | 2 +- .../PR342/assets/scripts/07_Dipole_Dipole.jl | 2 +- .../assets/scripts/08_Momentum_Conventions.jl | 2 +- .../PR342/assets/scripts/09_Disorder_KPM.jl | 2 +- .../scripts/SW01_FM_Heseinberg_chain.jl | 2 +- .../scripts/SW02_AFM_Heisenberg_chain.jl | 2 +- .../assets/scripts/SW03_Frustrated_chain.jl | 2 +- .../assets/scripts/SW04_Frustrated_square.jl | 2 +- .../assets/scripts/SW05_Simple_kagome_FM.jl | 2 +- .../assets/scripts/SW06_Complex_kagome_FM.jl | 2 +- .../assets/scripts/SW07_k0_kagome_AFM.jl | 2 +- .../assets/scripts/SW08_sqrt3_kagome_AFM.jl | 2 +- .../assets/scripts/SW09_k0_kagome_AFM_DM.jl | 2 +- .../PR342/assets/scripts/SW10_Energy_cut.jl | 2 +- previews/PR342/assets/scripts/SW11_La2CuO4.jl | 2 +- .../scripts/SW12_Triangular_easy_plane.jl | 2 +- previews/PR342/assets/scripts/SW13_LiNiPO4.jl | 2 +- previews/PR342/assets/scripts/SW14_YVO3.jl | 2 +- .../assets/scripts/SW15_Ba3NbFe3Si2O14.jl | 2 +- .../assets/scripts/SW18_Distorted_kagome.jl | 2 +- .../assets/scripts/SW19_Different_Ions.jl | 2 +- previews/PR342/examples/01_LSWT_CoRh2O4.html | 2 +- previews/PR342/examples/02_LLD_CoRh2O4.html | 2 +- previews/PR342/examples/03_LSWT_SU3_FeI2.html | 2 +- previews/PR342/examples/04_GSD_FeI2.html | 2 +- previews/PR342/examples/05_MC_Ising.html | 2 +- previews/PR342/examples/06_CP2_Skyrmions.html | 2 +- previews/PR342/examples/07_Dipole_Dipole.html | 2 +- .../examples/08_Momentum_Conventions.html | 2 +- previews/PR342/examples/09_Disorder_KPM.html | 2 +- .../contributed/MgCr2O4-tutorial.html | 2 +- .../examples/contributed/kappa_tutorial.html | 2 +- .../spinw/SW01_FM_Heseinberg_chain.html | 2 +- .../spinw/SW02_AFM_Heisenberg_chain.html | 2 +- .../examples/spinw/SW03_Frustrated_chain.html | 2 +- .../spinw/SW04_Frustrated_square.html | 2 +- .../examples/spinw/SW05_Simple_kagome_FM.html | 2 +- .../spinw/SW06_Complex_kagome_FM.html | 2 +- .../examples/spinw/SW07_k0_kagome_AFM.html | 2 +- .../examples/spinw/SW08_sqrt3_kagome_AFM.html | 2 +- .../examples/spinw/SW09_k0_kagome_AFM_DM.html | 2 +- .../PR342/examples/spinw/SW10_Energy_cut.html | 2 +- .../PR342/examples/spinw/SW11_La2CuO4.html | 2 +- .../spinw/SW12_Triangular_easy_plane.html | 2 +- .../PR342/examples/spinw/SW13_LiNiPO4.html | 2 +- previews/PR342/examples/spinw/SW14_YVO3.html | 2 +- .../examples/spinw/SW15_Ba3NbFe3Si2O14.html | 2 +- .../examples/spinw/SW18_Distorted_kagome.html | 2 +- .../examples/spinw/SW19_Different_Ions.html | 2 +- previews/PR342/index.html | 2 +- previews/PR342/library.html | 72 +++++++++--------- previews/PR342/objects.inv | Bin 4664 -> 4664 bytes previews/PR342/parallelism.html | 2 +- previews/PR342/renormalization.html | 2 +- previews/PR342/structure-factor.html | 2 +- previews/PR342/versions.html | 2 +- previews/PR342/why.html | 2 +- previews/PR342/writevtk.html | 2 +- 90 files changed, 124 insertions(+), 124 deletions(-) diff --git a/previews/PR342/.documenter-siteinfo.json b/previews/PR342/.documenter-siteinfo.json index 74ae97811..b5cc9d632 100644 --- a/previews/PR342/.documenter-siteinfo.json +++ b/previews/PR342/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.7","generation_timestamp":"2024-12-09T00:53:48","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.7","generation_timestamp":"2024-12-09T15:44:10","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/previews/PR342/assets/notebooks/01_LSWT_CoRh2O4.ipynb b/previews/PR342/assets/notebooks/01_LSWT_CoRh2O4.ipynb index b1c4b5e77..e9740ea97 100644 --- a/previews/PR342/assets/notebooks/01_LSWT_CoRh2O4.ipynb +++ b/previews/PR342/assets/notebooks/01_LSWT_CoRh2O4.ipynb @@ -33,7 +33,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/02_LLD_CoRh2O4.ipynb b/previews/PR342/assets/notebooks/02_LLD_CoRh2O4.ipynb index 18449f9db..941209e3b 100644 --- a/previews/PR342/assets/notebooks/02_LLD_CoRh2O4.ipynb +++ b/previews/PR342/assets/notebooks/02_LLD_CoRh2O4.ipynb @@ -29,7 +29,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"\n", + "@assert pkgversion(Sunny) >= v\"0.7.5\"\n", "\n", "units = Units(:meV, :angstrom)\n", "a = 8.5031 # (Å)\n", diff --git a/previews/PR342/assets/notebooks/03_LSWT_SU3_FeI2.ipynb b/previews/PR342/assets/notebooks/03_LSWT_SU3_FeI2.ipynb index 5271cca6e..e214c413f 100644 --- a/previews/PR342/assets/notebooks/03_LSWT_SU3_FeI2.ipynb +++ b/previews/PR342/assets/notebooks/03_LSWT_SU3_FeI2.ipynb @@ -45,7 +45,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/04_GSD_FeI2.ipynb b/previews/PR342/assets/notebooks/04_GSD_FeI2.ipynb index 6839e37c7..063a2c3dc 100644 --- a/previews/PR342/assets/notebooks/04_GSD_FeI2.ipynb +++ b/previews/PR342/assets/notebooks/04_GSD_FeI2.ipynb @@ -37,7 +37,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"\n", + "@assert pkgversion(Sunny) >= v\"0.7.5\"\n", "\n", "units = Units(:meV, :angstrom)\n", "a = b = 4.05012\n", diff --git a/previews/PR342/assets/notebooks/05_MC_Ising.ipynb b/previews/PR342/assets/notebooks/05_MC_Ising.ipynb index 0792142f3..cf0f08749 100644 --- a/previews/PR342/assets/notebooks/05_MC_Ising.ipynb +++ b/previews/PR342/assets/notebooks/05_MC_Ising.ipynb @@ -14,7 +14,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/06_CP2_Skyrmions.ipynb b/previews/PR342/assets/notebooks/06_CP2_Skyrmions.ipynb index 11859b2ca..d6f949d26 100644 --- a/previews/PR342/assets/notebooks/06_CP2_Skyrmions.ipynb +++ b/previews/PR342/assets/notebooks/06_CP2_Skyrmions.ipynb @@ -26,7 +26,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/07_Dipole_Dipole.ipynb b/previews/PR342/assets/notebooks/07_Dipole_Dipole.ipynb index 6fe25304a..4217a1cf3 100644 --- a/previews/PR342/assets/notebooks/07_Dipole_Dipole.ipynb +++ b/previews/PR342/assets/notebooks/07_Dipole_Dipole.ipynb @@ -20,7 +20,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/08_Momentum_Conventions.ipynb b/previews/PR342/assets/notebooks/08_Momentum_Conventions.ipynb index f55a00025..2cff7e40c 100644 --- a/previews/PR342/assets/notebooks/08_Momentum_Conventions.ipynb +++ b/previews/PR342/assets/notebooks/08_Momentum_Conventions.ipynb @@ -23,7 +23,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/09_Disorder_KPM.ipynb b/previews/PR342/assets/notebooks/09_Disorder_KPM.ipynb index f8f1b7f9a..219ff7b6b 100644 --- a/previews/PR342/assets/notebooks/09_Disorder_KPM.ipynb +++ b/previews/PR342/assets/notebooks/09_Disorder_KPM.ipynb @@ -22,7 +22,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW01_FM_Heseinberg_chain.ipynb b/previews/PR342/assets/notebooks/SW01_FM_Heseinberg_chain.ipynb index d7e133430..9948dcff2 100644 --- a/previews/PR342/assets/notebooks/SW01_FM_Heseinberg_chain.ipynb +++ b/previews/PR342/assets/notebooks/SW01_FM_Heseinberg_chain.ipynb @@ -24,7 +24,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW02_AFM_Heisenberg_chain.ipynb b/previews/PR342/assets/notebooks/SW02_AFM_Heisenberg_chain.ipynb index 8a634bd03..3b3b1347d 100644 --- a/previews/PR342/assets/notebooks/SW02_AFM_Heisenberg_chain.ipynb +++ b/previews/PR342/assets/notebooks/SW02_AFM_Heisenberg_chain.ipynb @@ -24,7 +24,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW03_Frustrated_chain.ipynb b/previews/PR342/assets/notebooks/SW03_Frustrated_chain.ipynb index bbd869de6..a8347f07e 100644 --- a/previews/PR342/assets/notebooks/SW03_Frustrated_chain.ipynb +++ b/previews/PR342/assets/notebooks/SW03_Frustrated_chain.ipynb @@ -24,7 +24,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW04_Frustrated_square.ipynb b/previews/PR342/assets/notebooks/SW04_Frustrated_square.ipynb index 06d168cc1..68bc63ca7 100644 --- a/previews/PR342/assets/notebooks/SW04_Frustrated_square.ipynb +++ b/previews/PR342/assets/notebooks/SW04_Frustrated_square.ipynb @@ -24,7 +24,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW05_Simple_kagome_FM.ipynb b/previews/PR342/assets/notebooks/SW05_Simple_kagome_FM.ipynb index 10c9917d8..d403d1854 100644 --- a/previews/PR342/assets/notebooks/SW05_Simple_kagome_FM.ipynb +++ b/previews/PR342/assets/notebooks/SW05_Simple_kagome_FM.ipynb @@ -24,7 +24,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW06_Complex_kagome_FM.ipynb b/previews/PR342/assets/notebooks/SW06_Complex_kagome_FM.ipynb index 96e727c7f..2a7e27995 100644 --- a/previews/PR342/assets/notebooks/SW06_Complex_kagome_FM.ipynb +++ b/previews/PR342/assets/notebooks/SW06_Complex_kagome_FM.ipynb @@ -24,7 +24,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW07_k0_kagome_AFM.ipynb b/previews/PR342/assets/notebooks/SW07_k0_kagome_AFM.ipynb index 5aa31d749..37ed4f281 100644 --- a/previews/PR342/assets/notebooks/SW07_k0_kagome_AFM.ipynb +++ b/previews/PR342/assets/notebooks/SW07_k0_kagome_AFM.ipynb @@ -25,7 +25,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW08_sqrt3_kagome_AFM.ipynb b/previews/PR342/assets/notebooks/SW08_sqrt3_kagome_AFM.ipynb index 0e9b4c88b..aeee5533d 100644 --- a/previews/PR342/assets/notebooks/SW08_sqrt3_kagome_AFM.ipynb +++ b/previews/PR342/assets/notebooks/SW08_sqrt3_kagome_AFM.ipynb @@ -24,7 +24,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW09_k0_kagome_AFM_DM.ipynb b/previews/PR342/assets/notebooks/SW09_k0_kagome_AFM_DM.ipynb index c551c80bd..d089c1ed5 100644 --- a/previews/PR342/assets/notebooks/SW09_k0_kagome_AFM_DM.ipynb +++ b/previews/PR342/assets/notebooks/SW09_k0_kagome_AFM_DM.ipynb @@ -25,7 +25,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie, LinearAlgebra\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW10_Energy_cut.ipynb b/previews/PR342/assets/notebooks/SW10_Energy_cut.ipynb index c036f0f0a..57d540002 100644 --- a/previews/PR342/assets/notebooks/SW10_Energy_cut.ipynb +++ b/previews/PR342/assets/notebooks/SW10_Energy_cut.ipynb @@ -24,7 +24,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW11_La2CuO4.ipynb b/previews/PR342/assets/notebooks/SW11_La2CuO4.ipynb index 8d18c519e..dab169c90 100644 --- a/previews/PR342/assets/notebooks/SW11_La2CuO4.ipynb +++ b/previews/PR342/assets/notebooks/SW11_La2CuO4.ipynb @@ -23,7 +23,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW12_Triangular_easy_plane.ipynb b/previews/PR342/assets/notebooks/SW12_Triangular_easy_plane.ipynb index c7e600912..38d5008de 100644 --- a/previews/PR342/assets/notebooks/SW12_Triangular_easy_plane.ipynb +++ b/previews/PR342/assets/notebooks/SW12_Triangular_easy_plane.ipynb @@ -24,7 +24,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW13_LiNiPO4.ipynb b/previews/PR342/assets/notebooks/SW13_LiNiPO4.ipynb index af39fe049..cc9e8cd98 100644 --- a/previews/PR342/assets/notebooks/SW13_LiNiPO4.ipynb +++ b/previews/PR342/assets/notebooks/SW13_LiNiPO4.ipynb @@ -23,7 +23,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW14_YVO3.ipynb b/previews/PR342/assets/notebooks/SW14_YVO3.ipynb index 5238e8caf..002443248 100644 --- a/previews/PR342/assets/notebooks/SW14_YVO3.ipynb +++ b/previews/PR342/assets/notebooks/SW14_YVO3.ipynb @@ -23,7 +23,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW15_Ba3NbFe3Si2O14.ipynb b/previews/PR342/assets/notebooks/SW15_Ba3NbFe3Si2O14.ipynb index 2f9444737..0dc0b95ed 100644 --- a/previews/PR342/assets/notebooks/SW15_Ba3NbFe3Si2O14.ipynb +++ b/previews/PR342/assets/notebooks/SW15_Ba3NbFe3Si2O14.ipynb @@ -26,7 +26,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW18_Distorted_kagome.ipynb b/previews/PR342/assets/notebooks/SW18_Distorted_kagome.ipynb index b91f47e9d..fe887e78a 100644 --- a/previews/PR342/assets/notebooks/SW18_Distorted_kagome.ipynb +++ b/previews/PR342/assets/notebooks/SW18_Distorted_kagome.ipynb @@ -22,7 +22,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/notebooks/SW19_Different_Ions.ipynb b/previews/PR342/assets/notebooks/SW19_Different_Ions.ipynb index 57d7eab4a..3c9d7996b 100644 --- a/previews/PR342/assets/notebooks/SW19_Different_Ions.ipynb +++ b/previews/PR342/assets/notebooks/SW19_Different_Ions.ipynb @@ -17,7 +17,7 @@ "cell_type": "code", "source": [ "using Sunny, GLMakie\n", - "@assert pkgversion(Sunny) >= v\"0.7.4\"" + "@assert pkgversion(Sunny) >= v\"0.7.5\"" ], "metadata": {}, "execution_count": null diff --git a/previews/PR342/assets/scripts/01_LSWT_CoRh2O4.jl b/previews/PR342/assets/scripts/01_LSWT_CoRh2O4.jl index b7e4a0ce6..29c9afa20 100644 --- a/previews/PR342/assets/scripts/01_LSWT_CoRh2O4.jl +++ b/previews/PR342/assets/scripts/01_LSWT_CoRh2O4.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom); diff --git a/previews/PR342/assets/scripts/02_LLD_CoRh2O4.jl b/previews/PR342/assets/scripts/02_LLD_CoRh2O4.jl index 7724ee329..658a65432 100644 --- a/previews/PR342/assets/scripts/02_LLD_CoRh2O4.jl +++ b/previews/PR342/assets/scripts/02_LLD_CoRh2O4.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) a = 8.5031 # (Å) diff --git a/previews/PR342/assets/scripts/03_LSWT_SU3_FeI2.jl b/previews/PR342/assets/scripts/03_LSWT_SU3_FeI2.jl index 6cae6524c..46ddb1c69 100644 --- a/previews/PR342/assets/scripts/03_LSWT_SU3_FeI2.jl +++ b/previews/PR342/assets/scripts/03_LSWT_SU3_FeI2.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) a = b = 4.05012 # Lattice constants for triangular lattice (Å) diff --git a/previews/PR342/assets/scripts/04_GSD_FeI2.jl b/previews/PR342/assets/scripts/04_GSD_FeI2.jl index 3d1bb6d9c..262423244 100644 --- a/previews/PR342/assets/scripts/04_GSD_FeI2.jl +++ b/previews/PR342/assets/scripts/04_GSD_FeI2.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) a = b = 4.05012 diff --git a/previews/PR342/assets/scripts/05_MC_Ising.jl b/previews/PR342/assets/scripts/05_MC_Ising.jl index 215efbd10..edd0737c9 100644 --- a/previews/PR342/assets/scripts/05_MC_Ising.jl +++ b/previews/PR342/assets/scripts/05_MC_Ising.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" latvecs = lattice_vectors(1, 1, 10, 90, 90, 90) crystal = Crystal(latvecs, [[0, 0, 0]]) diff --git a/previews/PR342/assets/scripts/06_CP2_Skyrmions.jl b/previews/PR342/assets/scripts/06_CP2_Skyrmions.jl index 539cf9cb4..6fa28921c 100644 --- a/previews/PR342/assets/scripts/06_CP2_Skyrmions.jl +++ b/previews/PR342/assets/scripts/06_CP2_Skyrmions.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" lat_vecs = lattice_vectors(1, 1, 10, 90, 90, 120) positions = [[0, 0, 0]] diff --git a/previews/PR342/assets/scripts/07_Dipole_Dipole.jl b/previews/PR342/assets/scripts/07_Dipole_Dipole.jl index 745b9292c..0953c3315 100644 --- a/previews/PR342/assets/scripts/07_Dipole_Dipole.jl +++ b/previews/PR342/assets/scripts/07_Dipole_Dipole.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:K, :angstrom) latvecs = lattice_vectors(10.19, 10.19, 10.19, 90, 90, 90) diff --git a/previews/PR342/assets/scripts/08_Momentum_Conventions.jl b/previews/PR342/assets/scripts/08_Momentum_Conventions.jl index 261544dd2..20fcfa875 100644 --- a/previews/PR342/assets/scripts/08_Momentum_Conventions.jl +++ b/previews/PR342/assets/scripts/08_Momentum_Conventions.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" latvecs = lattice_vectors(2, 2, 1, 90, 90, 90) cryst = Crystal(latvecs, [[0,0,0]], "P1") diff --git a/previews/PR342/assets/scripts/09_Disorder_KPM.jl b/previews/PR342/assets/scripts/09_Disorder_KPM.jl index dde40c2d2..e88f40714 100644 --- a/previews/PR342/assets/scripts/09_Disorder_KPM.jl +++ b/previews/PR342/assets/scripts/09_Disorder_KPM.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" latvecs = lattice_vectors(1, 1, 10, 90, 90, 120) cryst = Crystal(latvecs, [[0, 0, 0]]) diff --git a/previews/PR342/assets/scripts/SW01_FM_Heseinberg_chain.jl b/previews/PR342/assets/scripts/SW01_FM_Heseinberg_chain.jl index 26cf8154b..5235f32dd 100644 --- a/previews/PR342/assets/scripts/SW01_FM_Heseinberg_chain.jl +++ b/previews/PR342/assets/scripts/SW01_FM_Heseinberg_chain.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) a = 3.0 diff --git a/previews/PR342/assets/scripts/SW02_AFM_Heisenberg_chain.jl b/previews/PR342/assets/scripts/SW02_AFM_Heisenberg_chain.jl index 02576e0b4..32ea47933 100644 --- a/previews/PR342/assets/scripts/SW02_AFM_Heisenberg_chain.jl +++ b/previews/PR342/assets/scripts/SW02_AFM_Heisenberg_chain.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) latvecs = lattice_vectors(3, 8, 8, 90, 90, 90) diff --git a/previews/PR342/assets/scripts/SW03_Frustrated_chain.jl b/previews/PR342/assets/scripts/SW03_Frustrated_chain.jl index 2f0b53624..c36a4848c 100644 --- a/previews/PR342/assets/scripts/SW03_Frustrated_chain.jl +++ b/previews/PR342/assets/scripts/SW03_Frustrated_chain.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) latvecs = lattice_vectors(3, 8, 8, 90, 90, 90) diff --git a/previews/PR342/assets/scripts/SW04_Frustrated_square.jl b/previews/PR342/assets/scripts/SW04_Frustrated_square.jl index ffdc723fb..dcd5436f3 100644 --- a/previews/PR342/assets/scripts/SW04_Frustrated_square.jl +++ b/previews/PR342/assets/scripts/SW04_Frustrated_square.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) latvecs = lattice_vectors(3.0, 3.0, 6.0, 90, 90, 90) diff --git a/previews/PR342/assets/scripts/SW05_Simple_kagome_FM.jl b/previews/PR342/assets/scripts/SW05_Simple_kagome_FM.jl index 5f94f1cf3..7d617b609 100644 --- a/previews/PR342/assets/scripts/SW05_Simple_kagome_FM.jl +++ b/previews/PR342/assets/scripts/SW05_Simple_kagome_FM.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) latvecs = lattice_vectors(6, 6, 5, 90, 90, 120) diff --git a/previews/PR342/assets/scripts/SW06_Complex_kagome_FM.jl b/previews/PR342/assets/scripts/SW06_Complex_kagome_FM.jl index f47f68bce..4b9b93812 100644 --- a/previews/PR342/assets/scripts/SW06_Complex_kagome_FM.jl +++ b/previews/PR342/assets/scripts/SW06_Complex_kagome_FM.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) latvecs = lattice_vectors(6, 6, 8, 90, 90, 120) diff --git a/previews/PR342/assets/scripts/SW07_k0_kagome_AFM.jl b/previews/PR342/assets/scripts/SW07_k0_kagome_AFM.jl index f9b08766e..d717520f2 100644 --- a/previews/PR342/assets/scripts/SW07_k0_kagome_AFM.jl +++ b/previews/PR342/assets/scripts/SW07_k0_kagome_AFM.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) latvecs = lattice_vectors(6, 6, 8, 90, 90, 120) diff --git a/previews/PR342/assets/scripts/SW08_sqrt3_kagome_AFM.jl b/previews/PR342/assets/scripts/SW08_sqrt3_kagome_AFM.jl index bf11c39d4..c4ec31268 100644 --- a/previews/PR342/assets/scripts/SW08_sqrt3_kagome_AFM.jl +++ b/previews/PR342/assets/scripts/SW08_sqrt3_kagome_AFM.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) latvecs = lattice_vectors(6, 6, 40, 90, 90, 120) diff --git a/previews/PR342/assets/scripts/SW09_k0_kagome_AFM_DM.jl b/previews/PR342/assets/scripts/SW09_k0_kagome_AFM_DM.jl index 8a8d8cfe7..cdd7c5827 100644 --- a/previews/PR342/assets/scripts/SW09_k0_kagome_AFM_DM.jl +++ b/previews/PR342/assets/scripts/SW09_k0_kagome_AFM_DM.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie, LinearAlgebra -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) latvecs = lattice_vectors(6, 6, 8, 90, 90, 120) diff --git a/previews/PR342/assets/scripts/SW10_Energy_cut.jl b/previews/PR342/assets/scripts/SW10_Energy_cut.jl index a13aa1e25..e9a5505bd 100644 --- a/previews/PR342/assets/scripts/SW10_Energy_cut.jl +++ b/previews/PR342/assets/scripts/SW10_Energy_cut.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) latvecs = lattice_vectors(1.0, 1.0, 3.0, 90, 90, 90) diff --git a/previews/PR342/assets/scripts/SW11_La2CuO4.jl b/previews/PR342/assets/scripts/SW11_La2CuO4.jl index 09e657367..452d9a46c 100644 --- a/previews/PR342/assets/scripts/SW11_La2CuO4.jl +++ b/previews/PR342/assets/scripts/SW11_La2CuO4.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) latvecs = lattice_vectors(1, 1, 10, 90, 90, 90) diff --git a/previews/PR342/assets/scripts/SW12_Triangular_easy_plane.jl b/previews/PR342/assets/scripts/SW12_Triangular_easy_plane.jl index 62fff31a9..26443120d 100644 --- a/previews/PR342/assets/scripts/SW12_Triangular_easy_plane.jl +++ b/previews/PR342/assets/scripts/SW12_Triangular_easy_plane.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" latvecs = lattice_vectors(3, 3, 4, 90, 90, 120) cryst = Crystal(latvecs, [[0, 0, 0]]) diff --git a/previews/PR342/assets/scripts/SW13_LiNiPO4.jl b/previews/PR342/assets/scripts/SW13_LiNiPO4.jl index 33e86a715..0cd2c22eb 100644 --- a/previews/PR342/assets/scripts/SW13_LiNiPO4.jl +++ b/previews/PR342/assets/scripts/SW13_LiNiPO4.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) a = 10.02 diff --git a/previews/PR342/assets/scripts/SW14_YVO3.jl b/previews/PR342/assets/scripts/SW14_YVO3.jl index 98fe51882..826087118 100644 --- a/previews/PR342/assets/scripts/SW14_YVO3.jl +++ b/previews/PR342/assets/scripts/SW14_YVO3.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) a = 5.2821 / sqrt(2) diff --git a/previews/PR342/assets/scripts/SW15_Ba3NbFe3Si2O14.jl b/previews/PR342/assets/scripts/SW15_Ba3NbFe3Si2O14.jl index b3cb60ed5..dd23a5c7d 100644 --- a/previews/PR342/assets/scripts/SW15_Ba3NbFe3Si2O14.jl +++ b/previews/PR342/assets/scripts/SW15_Ba3NbFe3Si2O14.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) a = b = 8.539 # (Å) diff --git a/previews/PR342/assets/scripts/SW18_Distorted_kagome.jl b/previews/PR342/assets/scripts/SW18_Distorted_kagome.jl index 82aef1590..11a47cadf 100644 --- a/previews/PR342/assets/scripts/SW18_Distorted_kagome.jl +++ b/previews/PR342/assets/scripts/SW18_Distorted_kagome.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) latvecs = lattice_vectors(10.2, 5.94, 7.81, 90, 117.7, 90) diff --git a/previews/PR342/assets/scripts/SW19_Different_Ions.jl b/previews/PR342/assets/scripts/SW19_Different_Ions.jl index e790bf49f..aceb08e01 100644 --- a/previews/PR342/assets/scripts/SW19_Different_Ions.jl +++ b/previews/PR342/assets/scripts/SW19_Different_Ions.jl @@ -1,5 +1,5 @@ using Sunny, GLMakie -@assert pkgversion(Sunny) >= v"0.7.4" +@assert pkgversion(Sunny) >= v"0.7.5" units = Units(:meV, :angstrom) a = 3.0 diff --git a/previews/PR342/examples/01_LSWT_CoRh2O4.html b/previews/PR342/examples/01_LSWT_CoRh2O4.html index 8e76d4c40..105e6e9f8 100644 --- a/previews/PR342/examples/01_LSWT_CoRh2O4.html +++ b/previews/PR342/examples/01_LSWT_CoRh2O4.html @@ -41,4 +41,4 @@ res = powder_average(cryst, radii, 2000) do qs intensities(swt, qs; energies, kernel) end -plot_intensities(res; units, saturation=1.0, title="CoRh₂O₄ Powder Average")Example block output

This result can be compared to experimental neutron scattering data from Fig. 5 of Ge et al.

What's next?

+plot_intensities(res; units, saturation=1.0, title="CoRh₂O₄ Powder Average")Example block output

This result can be compared to experimental neutron scattering data from Fig. 5 of Ge et al.

What's next?

diff --git a/previews/PR342/examples/02_LLD_CoRh2O4.html b/previews/PR342/examples/02_LLD_CoRh2O4.html index 5eb539190..9a15aa10b 100644 --- a/previews/PR342/examples/02_LLD_CoRh2O4.html +++ b/previews/PR342/examples/02_LLD_CoRh2O4.html @@ -54,4 +54,4 @@ res = powder_average(cryst, radii, 350) do qs intensities(sc, qs; energies, langevin.kT) end -plot_intensities(res; units, title="Powder Average at 16 K")Example block output +plot_intensities(res; units, title="Powder Average at 16 K")Example block output diff --git a/previews/PR342/examples/03_LSWT_SU3_FeI2.html b/previews/PR342/examples/03_LSWT_SU3_FeI2.html index 2592f0b97..e6c8aaecc 100644 --- a/previews/PR342/examples/03_LSWT_SU3_FeI2.html +++ b/previews/PR342/examples/03_LSWT_SU3_FeI2.html @@ -127,4 +127,4 @@ res = domain_average(cryst, path; rotations, weights) do path_rotated intensities(swt, path_rotated; energies, kernel) end -plot_intensities(res; units, colormap=:viridis, title="Domain Averaged Intensities")Example block output

This result can be directly compared to experimental neutron scattering data from Bai et al.

(The publication figure used a non-standard coordinate system to label the wave vectors.)

To get this agreement, the theory of SU(3) coherent states is essential. The lower band has large quadrupolar character, and arises from the strong easy-axis anisotropy of FeI₂.

An interesting exercise is to repeat the same study, but using :dipole mode instead of :SUN. That alternative choice would constrain the coherent state dynamics to the space of dipoles only, and the flat band of single-ion bound states would be missing.

+plot_intensities(res; units, colormap=:viridis, title="Domain Averaged Intensities")Example block output

This result can be directly compared to experimental neutron scattering data from Bai et al.

(The publication figure used a non-standard coordinate system to label the wave vectors.)

To get this agreement, the theory of SU(3) coherent states is essential. The lower band has large quadrupolar character, and arises from the strong easy-axis anisotropy of FeI₂.

An interesting exercise is to repeat the same study, but using :dipole mode instead of :SUN. That alternative choice would constrain the coherent state dynamics to the space of dipoles only, and the flat band of single-ion bound states would be missing.

diff --git a/previews/PR342/examples/04_GSD_FeI2.html b/previews/PR342/examples/04_GSD_FeI2.html index 1eb915bb5..6368cfb1e 100644 --- a/previews/PR342/examples/04_GSD_FeI2.html +++ b/previews/PR342/examples/04_GSD_FeI2.html @@ -86,4 +86,4 @@ res = intensities(sc, qpath; energies, langevin.kT) plot_intensities(res; colorrange=(0.0, 1.0), title="Intensities at T = 2.3 K")Example block output

One can also view the intensity along a q_space_grid for a fixed energy value. Alternatively, use intensities_static to integrate over all available energies.

grid = q_space_grid(cryst, [1, 0, 0], range(-1.5, 1.5, 300), [0, 1, 0], (-1.5, 1.5); orthogonalize=true)
 res = intensities(sc, grid; energies=[3.5], langevin.kT)
-plot_intensities(res; title="Intensity slice at ω = 3.5 meV")
Example block output +plot_intensities(res; title="Intensity slice at ω = 3.5 meV")Example block output diff --git a/previews/PR342/examples/05_MC_Ising.html b/previews/PR342/examples/05_MC_Ising.html index d53e30051..6063a9c43 100644 --- a/previews/PR342/examples/05_MC_Ising.html +++ b/previews/PR342/examples/05_MC_Ising.html @@ -13,4 +13,4 @@ sampler = LocalSampler(kT=Tc, propose=propose_flip) for i in 1:nsweeps step!(sys, sampler) -end

Plot the Ising spins by extracting the $z$-component of the dipoles

heatmap(reshape([S[3] for S in sys.dipoles], (L, L)))
Example block output +end

Plot the Ising spins by extracting the $z$-component of the dipoles

heatmap(reshape([S[3] for S in sys.dipoles], (L, L)))
Example block output diff --git a/previews/PR342/examples/06_CP2_Skyrmions.html b/previews/PR342/examples/06_CP2_Skyrmions.html index fd70a68b8..8026c1b16 100644 --- a/previews/PR342/examples/06_CP2_Skyrmions.html +++ b/previews/PR342/examples/06_CP2_Skyrmions.html @@ -53,4 +53,4 @@ plot_triangular_plaquettes(sun_berry_curvature, frames; size=(600, 200), offset_spacing=10, texts=["\tt = "*string(τ) for τ in τs], text_offset=(0, 6) -)Example block output

The times are given in $\hbar/|J_1|$. The white background corresponds to a quantum paramagnetic state, where the local spin exhibits a strong quadrupole moment and little or no dipole moment. At late times, there are well-formed skyrmions of positive (red) and negative (blue) charge, and various metastable spin configurations. A full-sized version of this figure is available in Dahlbom et al..

+)Example block output

The times are given in $\hbar/|J_1|$. The white background corresponds to a quantum paramagnetic state, where the local spin exhibits a strong quadrupole moment and little or no dipole moment. At late times, there are well-formed skyrmions of positive (red) and negative (blue) charge, and various metastable spin configurations. A full-sized version of this figure is available in Dahlbom et al..

diff --git a/previews/PR342/examples/07_Dipole_Dipole.html b/previews/PR342/examples/07_Dipole_Dipole.html index 298e8c7ef..47bd3740a 100644 --- a/previews/PR342/examples/07_Dipole_Dipole.html +++ b/previews/PR342/examples/07_Dipole_Dipole.html @@ -29,4 +29,4 @@ for c in eachrow(res3.disp) lines!(ax, eachindex(c), c; linestyle=:dash, color=:black) end -figExample block output +figExample block output diff --git a/previews/PR342/examples/08_Momentum_Conventions.html b/previews/PR342/examples/08_Momentum_Conventions.html index 0f5f900d2..c3adc128d 100644 --- a/previews/PR342/examples/08_Momentum_Conventions.html +++ b/previews/PR342/examples/08_Momentum_Conventions.html @@ -35,4 +35,4 @@ res2 = intensities_bands(swt, path)
Sunny.BandIntensities{Float64, Sunny.QPath, 2} (1×400 elements)

This model system has a single magnon band with dispersion $ϵ(𝐪) = 1 - D/B \sin(2πq₃)$ and uniform intensity. Both calculation methods reproduce this analytical solution. Observe that $𝐪$ and $-𝐪$ are inequivalent. The structure factor calculated from classical dynamics additionally shows an elastic peak at $𝐪 = [0,0,0]$, reflecting the ferromagnetic ground state.

fig = Figure(size=(768, 300))
 plot_intensities!(fig[1, 1], res1; title="Classical dynamics")
 plot_intensities!(fig[1, 2], res2; title="Spin wave theory")
-fig
Example block output +figExample block output diff --git a/previews/PR342/examples/09_Disorder_KPM.html b/previews/PR342/examples/09_Disorder_KPM.html index 637678b03..3f598ff4f 100644 --- a/previews/PR342/examples/09_Disorder_KPM.html +++ b/previews/PR342/examples/09_Disorder_KPM.html @@ -44,4 +44,4 @@ minimize_energy!(sys) swt = SpinWaveTheory(sys; measure=ssf_perp(sys)) res = intensities(swt, path; energies, kernel) -plot_intensities(res)Example block output +plot_intensities(res)Example block output diff --git a/previews/PR342/examples/contributed/MgCr2O4-tutorial.html b/previews/PR342/examples/contributed/MgCr2O4-tutorial.html index c9a0db320..5768efe26 100644 --- a/previews/PR342/examples/contributed/MgCr2O4-tutorial.html +++ b/previews/PR342/examples/contributed/MgCr2O4-tutorial.html @@ -360,4 +360,4 @@ Sq_mgcro = intensities_static(sc_mgcro, qpts_mgcro; kT);

We can plot the results below. It is useful to compare these to the plot above generated with an SampledCorrelationsStatic.

fig = Figure(; size=(1200,500))
 ax = plot_intensities!(fig[1,1], Sq_pyro; title="Pyrochlore")
 ax = plot_intensities!(fig[1,2], Sq_mgcro; title="MgCr₂O₄")
-fig

+fig

diff --git a/previews/PR342/examples/contributed/kappa_tutorial.html b/previews/PR342/examples/contributed/kappa_tutorial.html index 7f37f80cc..979601b63 100644 --- a/previews/PR342/examples/contributed/kappa_tutorial.html +++ b/previews/PR342/examples/contributed/kappa_tutorial.html @@ -98,4 +98,4 @@ # Turn off κ renormalization before generating a new equilibrium sample. set_spin_rescaling!(sys, 1.0) -end

Finally, we evaluate the sum.

total_spectral_weight(sc; kT) / prod(sys.dims)
5.142433967821603

The result is something slightly greater than 5, substantially closer to the expected quantum sum rule. We can now adjust $\kappa$ and iterate until we reach a value sufficiently close to 16/3. In general, this should be done while collecting substantially more statistics.

Note that $\kappa (T)$ needs to be determined empirically for each model. A detailed example, demonstrating the calculations used in [3], is available here.

References

[1] - H. Zhang, C. D. Batista, "Classical spin dynamics based on SU(N) coherent states," PRB (2021)

[2] - T. Huberman, D. A. Tennant, R. A. Cowley, R. Coldea and C. D. Frost, "A study of the quantum classical crossover in the spin dynamics of the 2D S = 5/2 antiferromagnet Rb2MnF4: neutron scattering, computer simulations and analytic theories" (2008)

[3] - D. Dahlbom, D. Brooks, M. S. Wilson, S. Chi, A. I. Kolesnikov, M. B. Stone, H. Cao, Y.-W. Li, K. Barros, M. Mourigal, C. D. Batista, X. Bai, "Quantum to classical crossover in generalized spin systems," arXiv:2310.19905 (2023)

+end

Finally, we evaluate the sum.

total_spectral_weight(sc; kT) / prod(sys.dims)
5.142433967821603

The result is something slightly greater than 5, substantially closer to the expected quantum sum rule. We can now adjust $\kappa$ and iterate until we reach a value sufficiently close to 16/3. In general, this should be done while collecting substantially more statistics.

Note that $\kappa (T)$ needs to be determined empirically for each model. A detailed example, demonstrating the calculations used in [3], is available here.

References

[1] - H. Zhang, C. D. Batista, "Classical spin dynamics based on SU(N) coherent states," PRB (2021)

[2] - T. Huberman, D. A. Tennant, R. A. Cowley, R. Coldea and C. D. Frost, "A study of the quantum classical crossover in the spin dynamics of the 2D S = 5/2 antiferromagnet Rb2MnF4: neutron scattering, computer simulations and analytic theories" (2008)

[3] - D. Dahlbom, D. Brooks, M. S. Wilson, S. Chi, A. I. Kolesnikov, M. B. Stone, H. Cao, Y.-W. Li, K. Barros, M. Mourigal, C. D. Batista, X. Bai, "Quantum to classical crossover in generalized spin systems," arXiv:2310.19905 (2023)

diff --git a/previews/PR342/examples/spinw/SW01_FM_Heseinberg_chain.html b/previews/PR342/examples/spinw/SW01_FM_Heseinberg_chain.html index d3a455e6f..3a2d6e496 100644 --- a/previews/PR342/examples/spinw/SW01_FM_Heseinberg_chain.html +++ b/previews/PR342/examples/spinw/SW01_FM_Heseinberg_chain.html @@ -58,4 +58,4 @@ res = powder_average(cryst, radii, 1000) do qs intensities(swt, qs; energies, kernel) end -plot_intensities(res; units)Example block output +plot_intensities(res; units)Example block output diff --git a/previews/PR342/examples/spinw/SW02_AFM_Heisenberg_chain.html b/previews/PR342/examples/spinw/SW02_AFM_Heisenberg_chain.html index cbb1ea9a2..290d1aa79 100644 --- a/previews/PR342/examples/spinw/SW02_AFM_Heisenberg_chain.html +++ b/previews/PR342/examples/spinw/SW02_AFM_Heisenberg_chain.html @@ -15,4 +15,4 @@ res = intensities_bands(swt, path) plot_intensities(res; units)Example block output

This system includes two bands that are fully degenerate in their dispersion.

isapprox(res.disp[1, :], res.disp[2, :])
true

Plot the intensities summed over the two degenerate bands using the Makie lines function.

xs = [q[1] for q in path.qs]
 ys = log10.(res.data[1, :] + res.data[2, :])
-lines(xs, ys; axis=(; xlabel="[H, 0, 0]", ylabel="Log intensity (dimensionless)"))
Example block output +lines(xs, ys; axis=(; xlabel="[H, 0, 0]", ylabel="Log intensity (dimensionless)"))Example block output diff --git a/previews/PR342/examples/spinw/SW03_Frustrated_chain.html b/previews/PR342/examples/spinw/SW03_Frustrated_chain.html index f0f396066..ecff1a61a 100644 --- a/previews/PR342/examples/spinw/SW03_Frustrated_chain.html +++ b/previews/PR342/examples/spinw/SW03_Frustrated_chain.html @@ -17,4 +17,4 @@ qs = [[0,0,0], [1,0,0]] path = q_space_path(cryst, qs, 401) res = intensities_bands(swt, path) -plot_intensities(res; units)Example block output +plot_intensities(res; units)Example block output diff --git a/previews/PR342/examples/spinw/SW04_Frustrated_square.html b/previews/PR342/examples/spinw/SW04_Frustrated_square.html index 25f422693..6b90b5c17 100644 --- a/previews/PR342/examples/spinw/SW04_Frustrated_square.html +++ b/previews/PR342/examples/spinw/SW04_Frustrated_square.html @@ -13,4 +13,4 @@ qs = [[0, 0, 0], [1/2, 0, 0], [1/2, 1/2, 0], [0, 0, 0]] path = q_space_path(cryst, qs, 400) res = intensities_bands(swt, path) -plot_intensities(res; units)Example block output +plot_intensities(res; units)Example block output diff --git a/previews/PR342/examples/spinw/SW05_Simple_kagome_FM.html b/previews/PR342/examples/spinw/SW05_Simple_kagome_FM.html index f073aa374..438c489d7 100644 --- a/previews/PR342/examples/spinw/SW05_Simple_kagome_FM.html +++ b/previews/PR342/examples/spinw/SW05_Simple_kagome_FM.html @@ -41,4 +41,4 @@ fig = Figure(size=(768, 800)) plot_intensities!(fig[1, 1], res1; units, colorrange=(0,10), title="FWHM 0.02 meV") plot_intensities!(fig[2, 1], res2; units, colorrange=(0,10), title="FWHM 0.25 meV") -figExample block output +figExample block output diff --git a/previews/PR342/examples/spinw/SW06_Complex_kagome_FM.html b/previews/PR342/examples/spinw/SW06_Complex_kagome_FM.html index 87de40361..fbb164fc1 100644 --- a/previews/PR342/examples/spinw/SW06_Complex_kagome_FM.html +++ b/previews/PR342/examples/spinw/SW06_Complex_kagome_FM.html @@ -22,4 +22,4 @@ res = powder_average(cryst, radii, 1000) do qs intensities(swt, qs; energies, kernel) end -plot_intensities(res; units, colorrange=(0,10))Example block output +plot_intensities(res; units, colorrange=(0,10))Example block output diff --git a/previews/PR342/examples/spinw/SW07_k0_kagome_AFM.html b/previews/PR342/examples/spinw/SW07_k0_kagome_AFM.html index 2db0a716f..ce01d7a31 100644 --- a/previews/PR342/examples/spinw/SW07_k0_kagome_AFM.html +++ b/previews/PR342/examples/spinw/SW07_k0_kagome_AFM.html @@ -19,4 +19,4 @@ res = powder_average(cryst, radii, 1000) do qs intensities(swt, qs; energies, kernel) end -plot_intensities(res; units)Example block output +plot_intensities(res; units)Example block output diff --git a/previews/PR342/examples/spinw/SW08_sqrt3_kagome_AFM.html b/previews/PR342/examples/spinw/SW08_sqrt3_kagome_AFM.html index 0196bf48a..06fa1c1e7 100644 --- a/previews/PR342/examples/spinw/SW08_sqrt3_kagome_AFM.html +++ b/previews/PR342/examples/spinw/SW08_sqrt3_kagome_AFM.html @@ -27,4 +27,4 @@ res = powder_average(cryst, radii, 200) do qs intensities(swt, qs; energies, kernel) end -plot_intensities(res; units, colorrange=(0,20))Example block output +plot_intensities(res; units, colorrange=(0,20))Example block output diff --git a/previews/PR342/examples/spinw/SW09_k0_kagome_AFM_DM.html b/previews/PR342/examples/spinw/SW09_k0_kagome_AFM_DM.html index 77e9070cc..f05d08b7e 100644 --- a/previews/PR342/examples/spinw/SW09_k0_kagome_AFM_DM.html +++ b/previews/PR342/examples/spinw/SW09_k0_kagome_AFM_DM.html @@ -19,4 +19,4 @@ res = powder_average(cryst, radii, 1000) do qs intensities(swt, qs; energies, kernel) end -plot_intensities(res; units, colorrange=(0,20))Example block output +plot_intensities(res; units, colorrange=(0,20))Example block output diff --git a/previews/PR342/examples/spinw/SW10_Energy_cut.html b/previews/PR342/examples/spinw/SW10_Energy_cut.html index 4bf04b66f..5a77d36e8 100644 --- a/previews/PR342/examples/spinw/SW10_Energy_cut.html +++ b/previews/PR342/examples/spinw/SW10_Energy_cut.html @@ -14,4 +14,4 @@ plot_spins(sys; ndims=2)Example block output

Define a 2D slice through $𝐪$-space with q_space_grid.

grid = q_space_grid(cryst, [1, 0, 0], range(0, 2, 201), [0, 1, 0], range(0, 2, 201))
Sunny.QGrid{2} (201×201 samples)

Calculate and plot a constant energy cut at the precise value of 3.75 meV. Apply a line broadening with a full-width half-max of 0.2 meV to approximately capture intensities between 3.5 and 4.0 meV.

swt = SpinWaveTheory(sys; measure=ssf_trace(sys))
 res = intensities(swt, grid; energies=[3.75], kernel=gaussian(fwhm=0.2))
 plot_intensities(res; units)
Example block output

Integrate intensities between 3.5 and 4 meV using intensities_static with the bounds option.

res = intensities_static(swt, grid; bounds=(3.5, 4.01))
-plot_intensities(res; units)
Example block output +plot_intensities(res; units)Example block output diff --git a/previews/PR342/examples/spinw/SW11_La2CuO4.html b/previews/PR342/examples/spinw/SW11_La2CuO4.html index 0f114b98e..c546f9783 100644 --- a/previews/PR342/examples/spinw/SW11_La2CuO4.html +++ b/previews/PR342/examples/spinw/SW11_La2CuO4.html @@ -21,4 +21,4 @@ res = intensities(swt, path; energies, kernel=gaussian(fwhm=35)) res.energies .*= 1.18 plot_intensities(res; units)Example block output

Plot instantaneous itensities, integrated over ω.

res = intensities_static(swt, path)
-plot_intensities(res; colorrange=(0,20), units)
Example block output +plot_intensities(res; colorrange=(0,20), units)Example block output diff --git a/previews/PR342/examples/spinw/SW12_Triangular_easy_plane.html b/previews/PR342/examples/spinw/SW12_Triangular_easy_plane.html index 671d4e032..af103d13f 100644 --- a/previews/PR342/examples/spinw/SW12_Triangular_easy_plane.html +++ b/previews/PR342/examples/spinw/SW12_Triangular_easy_plane.html @@ -29,4 +29,4 @@ res.data[7, 10]
3×3 StaticArraysCore.SMatrix{3, 3, ComplexF64, 9} with indices SOneTo(3)×SOneTo(3):
      0.241929+0.0im          …   1.99293e-16-9.12464e-17im
  -2.12299e-14-0.241929im        -9.12464e-17-1.99293e-16im
-  1.99293e-16+9.12464e-17im      1.98585e-31+0.0im
+ 1.99293e-16+9.12464e-17im 1.98585e-31+0.0im diff --git a/previews/PR342/examples/spinw/SW13_LiNiPO4.html b/previews/PR342/examples/spinw/SW13_LiNiPO4.html index 22d6241e0..7d6ba3ae7 100644 --- a/previews/PR342/examples/spinw/SW13_LiNiPO4.html +++ b/previews/PR342/examples/spinw/SW13_LiNiPO4.html @@ -47,4 +47,4 @@ lines!(ax, data_sorted[end, :]; label="Lower band") lines!(ax, data_sorted[end-1, :]; label="Upper band") axislegend(ax) -figExample block output +figExample block output diff --git a/previews/PR342/examples/spinw/SW14_YVO3.html b/previews/PR342/examples/spinw/SW14_YVO3.html index 8487bd23d..da1df6f9a 100644 --- a/previews/PR342/examples/spinw/SW14_YVO3.html +++ b/previews/PR342/examples/spinw/SW14_YVO3.html @@ -37,4 +37,4 @@ qs = [[0.75, 0.75, 0], [0.5, 0.5, 0], [0.5, 0.5, 1]] path = q_space_path(cryst, qs, 400) res = intensities_bands(swt, path) -plot_intensities(res; units)Example block output +plot_intensities(res; units)Example block output diff --git a/previews/PR342/examples/spinw/SW15_Ba3NbFe3Si2O14.html b/previews/PR342/examples/spinw/SW15_Ba3NbFe3Si2O14.html index 3ef9763ff..5145bb466 100644 --- a/previews/PR342/examples/spinw/SW15_Ba3NbFe3Si2O14.html +++ b/previews/PR342/examples/spinw/SW15_Ba3NbFe3Si2O14.html @@ -42,4 +42,4 @@ swt = SpinWaveTheorySpiral(sys; measure, k, axis) res = intensities(swt, path; energies, kernel=gaussian(fwhm=0.25)) plot_intensities(res; units, saturation=0.8, allpositive=false, - title="Im[S²³(q, ω) - S³²(q, ω)]")Example block output + title="Im[S²³(q, ω) - S³²(q, ω)]")Example block output diff --git a/previews/PR342/examples/spinw/SW18_Distorted_kagome.html b/previews/PR342/examples/spinw/SW18_Distorted_kagome.html index e6ce9ea19..58ec09ddf 100644 --- a/previews/PR342/examples/spinw/SW18_Distorted_kagome.html +++ b/previews/PR342/examples/spinw/SW18_Distorted_kagome.html @@ -41,4 +41,4 @@ res = powder_average(cryst, radii, 400) do qs intensities(swt, qs; energies, kernel) end -plot_intensities(res; units)Example block output +plot_intensities(res; units)Example block output diff --git a/previews/PR342/examples/spinw/SW19_Different_Ions.html b/previews/PR342/examples/spinw/SW19_Different_Ions.html index 472f4bd70..3694d226e 100644 --- a/previews/PR342/examples/spinw/SW19_Different_Ions.html +++ b/previews/PR342/examples/spinw/SW19_Different_Ions.html @@ -41,4 +41,4 @@ -0.13698215962703128 -0.13698215962697904 -0.5783052943276753 - -0.5783052943274667 + -0.5783052943274667 diff --git a/previews/PR342/index.html b/previews/PR342/index.html index ede98f8db..965a531af 100644 --- a/previews/PR342/index.html +++ b/previews/PR342/index.html @@ -1,2 +1,2 @@ -Welcome · Documentation

Welcome

Sunny provides powerful tools to simulate equilibrium and non-equilibrium magnetic phenomena from microscopic models. It also facilitates calculation of the dynamical spin structure factor $\mathcal{S}(𝐪,ω)$ for direct comparison to experimental scattering data.

Feature highlights include symmetry-guided modeling, interactive visualization, and more accurate approximations to quantum spin dynamics.

Browse the tutorials to get started. See also SpinW ports for traditional spin wave theory.

Library Reference lists all functions and their doc-strings.

We want to interact with you! Please join our Slack community and say hello. If you encounter a problem, please ask on the Slack #helpdesk channel. If you use Sunny in a paper, please add it to our Literature Wiki.

+Welcome · Documentation

Welcome

Sunny provides powerful tools to simulate equilibrium and non-equilibrium magnetic phenomena from microscopic models. It also facilitates calculation of the dynamical spin structure factor $\mathcal{S}(𝐪,ω)$ for direct comparison to experimental scattering data.

Feature highlights include symmetry-guided modeling, interactive visualization, and more accurate approximations to quantum spin dynamics.

Browse the tutorials to get started. See also SpinW ports for traditional spin wave theory.

Library Reference lists all functions and their doc-strings.

We want to interact with you! Please join our Slack community and say hello. If you encounter a problem, please ask on the Slack #helpdesk channel. If you use Sunny in a paper, please add it to our Literature Wiki.

diff --git a/previews/PR342/library.html b/previews/PR342/library.html index 01d80be1f..e3659e46b 100644 --- a/previews/PR342/library.html +++ b/previews/PR342/library.html @@ -1,7 +1,7 @@ Library Reference · Documentation

Library Reference

This page describes the public types and functions exported by Sunny. This documentation can be also be accessed using the Julia help system (enter ? at the Julia command prompt).

Index

Core Sunny functions

Sunny.BinningParametersType
BinningParameters(binstart, binend, binwidth; covectors=I(4))
 BinningParameters(binstart, binend; numbins, covectors=I(4))

Describes a 4D parallelepided histogram in a format compatible with experimental Inelasitic Neutron Scattering data. See generate_mantid_script_from_binning_parameters to convert BinningParameters to a format understandable by the Mantid software, or load_nxs to load BinningParameters from a Mantid .nxs file.

The coordinates of the histogram axes are specified by multiplication of (q,ω) with each row of the covectors matrix, with q given in [R.L.U.]. Since the default covectors matrix is the identity matrix, the default axes are (qx, qy, qz, ω) in absolute units.

The convention for the binning scheme is that:

  • The left edge of the first bin starts at binstart
  • The bin width is binwidth
  • The last bin contains binend
  • There are no "partial bins;" the last bin may contain values greater than binend.

A value can be binned by computing its bin index:

    coords = covectors * value
-    bin_ix = 1 .+ floor.(Int64, (coords .- binstart) ./ binwidth)
source
Sunny.BondType
Bond(i, j, n)

Represents a bond between atom indices i and j. n is a vector of three integers specifying unit cell displacement in terms of lattice vectors.

source
Sunny.CrystalType

An object describing a crystallographic unit cell and its space group symmetry. Constructors are as follows:

Crystal(filename; override_symmetry=false, symprec=nothing)

Reads the crystal from a .cif file located at the path filename. If override_symmetry=true, the spacegroup will be inferred based on atom positions and the returned unit cell may be reduced in size. For an mCIF file, the return value is the magnetic supercell, unless override_symmetry=true. If a precision for spacegroup symmetries cannot be inferred from the CIF file, it must be specified with symprec. The latvecs field of the returned Crystal will be in units of angstrom.

Crystal(latvecs, positions; types=nothing, symprec=1e-5)

Constructs a crystal from the complete list of atom positions positions, with coordinates (between 0 and 1) in units of lattice vectors latvecs. Spacegroup symmetry information is automatically inferred using the Spglib package [1]. The optional parameter types is a list of strings, one for each atom, and can be used to break symmetry-equivalence between atoms.

Crystal(latvecs, positions, spacegroup; types=nothing, choice=nothing, symprec=1e-5)

Builds a crystal using the symmetries of a spacegroup. One representative atom must be specified for each occupied Wyckoff. The spacegroup may be specified as a number 1..230 or as a string, e.g., Hermann–Mauguin or Hall symbol. If only a spacegroup number is provided, the ITA standard setting [2] will be employed, consistent with conventions from the Bilbao crystallographic server. If a spacegroup symbol is provided that allows for multiple ITA settings, the possible disambiguations will be included in an error message, and may involve a choice string.

Examples

# Read a Crystal from a .cif file
+    bin_ix = 1 .+ floor.(Int64, (coords .- binstart) ./ binwidth)
source
Sunny.BondType
Bond(i, j, n)

Represents a bond between atom indices i and j. n is a vector of three integers specifying unit cell displacement in terms of lattice vectors.

source
Sunny.CrystalType

An object describing a crystallographic unit cell and its space group symmetry. Constructors are as follows:

Crystal(filename; override_symmetry=false, symprec=nothing)

Reads the crystal from a .cif file located at the path filename. If override_symmetry=true, the spacegroup will be inferred based on atom positions and the returned unit cell may be reduced in size. For an mCIF file, the return value is the magnetic supercell, unless override_symmetry=true. If a precision for spacegroup symmetries cannot be inferred from the CIF file, it must be specified with symprec. The latvecs field of the returned Crystal will be in units of angstrom.

Crystal(latvecs, positions; types=nothing, symprec=1e-5)

Constructs a crystal from the complete list of atom positions positions, with coordinates (between 0 and 1) in units of lattice vectors latvecs. Spacegroup symmetry information is automatically inferred using the Spglib package [1]. The optional parameter types is a list of strings, one for each atom, and can be used to break symmetry-equivalence between atoms.

Crystal(latvecs, positions, spacegroup; types=nothing, choice=nothing, symprec=1e-5)

Builds a crystal using the symmetries of a spacegroup. One representative atom must be specified for each occupied Wyckoff. The spacegroup may be specified as a number 1..230 or as a string, e.g., Hermann–Mauguin or Hall symbol. If only a spacegroup number is provided, the ITA standard setting [2] will be employed, consistent with conventions from the Bilbao crystallographic server. If a spacegroup symbol is provided that allows for multiple ITA settings, the possible disambiguations will be included in an error message, and may involve a choice string.

Examples

# Read a Crystal from a .cif file
 Crystal("filename.cif")
 
 # Build a BCC crystal in the conventional cubic unit cell by specifying both
@@ -22,7 +22,7 @@
 
 # Build an equivalent crystal using a different origin choice.
 positions = [[0, 0, 0]]
-cryst = Crystal(latvecs, positions, 227; choice="1")

See also lattice_vectors.

References

  1. A. Togo, K. Shinohara, I. Tanaka, Spglib: a software library for crystal symmetry search (2018) [arXiv:1808.01590].
  2. International Tables of Crystallography, Volume A (2016).
source
Sunny.FormFactorType
FormFactor(ion::String; g_lande=2)

The magnetic form factor for a given magnetic ion and charge state. When passed to intensities, it rescales structure factor intensities based on the magnitude of the scattering vector, $|𝐪|$.

The parameter ion must be one of the following strings:

Am2, Am3, Am4, Am5, Am6, Am7, Au1, Au2, Au3, Au4, Au5, Ce2, Co0, Co1, Co2, Co3,
+cryst = Crystal(latvecs, positions, 227; choice="1")

See also lattice_vectors.

References

  1. A. Togo, K. Shinohara, I. Tanaka, Spglib: a software library for crystal symmetry search (2018) [arXiv:1808.01590].
  2. International Tables of Crystallography, Volume A (2016).
source
Sunny.FormFactorType
FormFactor(ion::String; g_lande=2)

The magnetic form factor for a given magnetic ion and charge state. When passed to intensities, it rescales structure factor intensities based on the magnitude of the scattering vector, $|𝐪|$.

The parameter ion must be one of the following strings:

Am2, Am3, Am4, Am5, Am6, Am7, Au1, Au2, Au3, Au4, Au5, Ce2, Co0, Co1, Co2, Co3,
 Co4, Cr0, Cr1, Cr2, Cr3, Cr4, Cu0, Cu1, Cu2, Cu3, Cu4, Dy2, Dy3, Er2, Er3, Eu2,
 Eu3, Fe0, Fe1, Fe2, Fe3, Fe4, Gd2, Gd3, Hf2, Hf3, Ho2, Ho3, Ir0a, Ir0b, Ir0c,
 Ir1a, Ir1b, Ir2, Ir3, Ir4, Ir5, Ir6, Mn0, Mn1, Mn2, Mn3, Mn4, Mn5, Mo0, Mo1, Nb0,
@@ -36,7 +36,7 @@
 ERROR: Disambiguate form factor according to electronic configuration:
     "Ir0a" -- 6s⁰5d⁹
     "Ir0b" -- 6s¹5d⁸
-    "Ir0c" -- 6s²5d⁷

In the dipolar approximation (small $|𝐪|$) the form factor is

$F(s) = ⟨j_0(s)⟩ + [(2-g)/g] ⟨j_2(s)⟩$,

involving $s = |𝐪|/4π$ and the Landé $g$-factor. The $⟨j_l(s)⟩$ are radial averages of the $l$th spherical Bessel function of the magnetic dipole. More details are provided in Ref. [1].

The standard approximation tables involve expansion in Gaussians,

\[⟨j_0(s)⟩ = A e^{-as^2} + B e^{-bs^2} + C e^{-cs^2} + D e^{-ds^2} + E\]

and

\[⟨j_2(s)⟩ = (A e^{-as^2} + B e^{-bs^2} + C e^{-cs^2} + D e^{-ds^2} + E) s^2.\]

For 3d, 4d, rare earth, and actinide ions, Sunny uses the revised tables of P. J. Brown, as documented in the McPhase package [2]. For 5d ions, Sunny uses the tables of Kobayashi, Nagao, Ito [3].

Two special, $𝐪$-independent form factor values are available: one(FormFactor) and zero(FormFactor). The first idealizes the magnetic ion as a perfect point particle, while the second zeros all contributions from the magnetic ion.

References

  1. P. J. Brown, The Neutron Data Booklet, 2nd ed., Sec. 2.5 Magnetic Form Factors (2003).
  2. Coefficient tables in McPhase documentation.
  3. K. Kobayashi, T. Nagao, M. Ito, Radial integrals for the magnetic form factor of 5d transition elements, Acta Cryst. A, 67, 473–480 (2011).
source
Sunny.ImplicitMidpointType
ImplicitMidpoint(dt::Float64; atol=1e-12) where N

The implicit midpoint method for integrating the Landau-Lifshitz spin dynamics or its generalization to SU(N) coherent states [1]. One call to the step! function will advance a System by dt units of time. This integration scheme is exactly symplectic and eliminates energy drift over arbitrarily long simulation trajectories.

References

  1. H. Zhang and C. D. Batista, Classical spin dynamics based on SU(N) coherent states, Phys. Rev. B 104, 104409 (2021).
source
Sunny.LangevinType
Langevin(dt::Float64; damping::Float64, kT::Float64)

An integrator for Langevin spin dynamics using the explicit Heun method. The damping parameter controls the coupling to an implicit thermal bath. One call to the step! function will advance a System by dt units of time. Can be used to sample from the Boltzmann distribution at temperature kT. An alternative approach to sampling states from thermal equilibrium is LocalSampler, which proposes local Monte Carlo moves. For example, use LocalSampler instead of Langevin to sample Ising-like spins.

Setting damping = 0 disables coupling to the thermal bath, yielding an energy-conserving spin dynamics. The Langevin integrator uses an explicit numerical integrator which cannot prevent energy drift. Alternatively, the ImplicitMidpoint method can be used, which is more expensive but prevents energy drift through exact conservation of the symplectic 2-form.

If the System has mode = :dipole, then the dynamics is the stochastic Landau-Lifshitz equation,

\[ d𝐒/dt = -𝐒 × (ξ - 𝐁 + λ 𝐒 × 𝐁),\]

where $𝐁 = -dE/d𝐒$ is the effective field felt by the expected spin dipole $𝐒$. The components of $ξ$ are Gaussian white noise, with magnitude $√(2 k_B T λ)$ set by a fluctuation-dissipation theorem. The parameter damping sets the phenomenological coupling $λ$ to the thermal bath.

If the System has mode = :SUN, then this dynamics generalizes [1] to a stochastic nonlinear Schrödinger equation for SU(N) coherent states $𝐙$,

\[ d𝐙/dt = -i P [ζ + (1 - i λ̃) ℋ 𝐙].\]

Here, $P$ projects onto the space orthogonal to $𝐙$, and $ζ$ denotes complex Gaussian white noise with magnitude $√(2 k_B T λ̃)$. The local-Hamiltonian $ℋ$ embeds the energy gradient into the 𝔰𝔲(N) Lie algebra, and generates evolution of spin dipoles, quadrupoles, etc. The parameter damping here sets $λ̃$, which is analogous to $λ$ above.

When applied to SU(2) coherent states, the generalized spin dynamics reduces exactly to the stochastic Landau-Lifshitz equation. The mapping is as follows. Normalized coherent states $𝐙$ map to dipole expectation values $𝐒 = 𝐙^{†} Ŝ 𝐙$, where spin operators $Ŝ$ are a spin-$|𝐒|$ representation of SU(2). The local effective Hamiltonian $ℋ = -𝐁 ⋅ Ŝ$ generates rotation of the dipole in analogy to the vector cross product $S × 𝐁$. The coupling to the thermal bath maps as $λ̃ = |𝐒| λ$. Note, therefore, that the scaling of the damping parameter varies subtly between :dipole and :SUN modes.

References

  1. D. Dahlbom et al., Langevin dynamics of generalized spins as SU(N) coherent states, Phys. Rev. B 106, 235154 (2022).
source
Sunny.LocalSamplerType
LocalSampler(; kT, nsweeps=1.0, propose=propose_uniform)

Monte Carlo simulation involving Metropolis updates to individual spins. One call to the step! function will perform nsweeps of MCMC sampling for a provided System. The default value of 1.0 means that step! performs, on average, one trial update per spin.

Assuming ergodicity, the LocalSampler will sample from thermal equilibrium for the target temperature kT.

The trial spin updates are sampled using the propose function. Options include propose_uniform, propose_flip, and propose_delta. Multiple proposals can be mixed with the macro @mix_proposals.

The returned object stores fields ΔE and ΔS, which represent the cumulative change to the net energy and dipole, respectively.

Efficiency considerations

Prefer Langevin sampling in most cases. Langevin dynamics will usually be much more efficient for sampling Heisenberg-like spins that vary continuously. LocalSampler is most useful for sampling from discrete spin states. In particular, propose_flip may be required for sampling Ising-like spins that arise due to a strong easy-axis anisotropy. For strong but finite single-ion anisotropy, consider alternating between Langevin and LocalSampler update steps.

source
Sunny.MomentType
Moment(; s, g)

Characterizes a effective spin magnetic moment on an atom. Quantum spin-s is a multiple of 1/2 in units of ħ. The g-factor or tensor defines the magnetic_moment $μ = - g 𝐒$ in units of the Bohr magneton.

Example

Moment(s=3/2, g=2)
source
Sunny.SampledCorrelationsType
SampledCorrelations(sys::System; measure, energies, dt)

An object to accumulate samples of dynamical pair correlations. The measure argument specifies a pair correlation type, e.g. ssf_perp. The energies must be evenly-spaced and starting from 0, e.g. energies = range(0, 3, 100). Select the integration time-step dt according to accuracy and speed considerations. suggest_timestep can help in selecting an appropriate value.

Dynamical correlations will be accumulated through calls to add_sample!, which expects a spin configuration in thermal equilibrium. A classical spin dynamics trajectory will be simulated of sufficient length to achieve the target energy resolution. The resulting data can can then be extracted as pair-correlation intensities with appropriate classical-to-quantum correction factors. See also intensities_static, which integrates over energy.

source
Sunny.SampledCorrelationsStaticType
SampledCorrelationsStatic(sys::System; measure)

An object to accumulate samples of static pair correlations. It is similar to SampledCorrelations, but no time-integration will be performed on calls to add_sample!. The resulting object can be used with intensities_static to calculate statistics from the classical Boltzmann distribution. Dynamical intensities data, however, will be unavailable. Similarly, classical-to-quantum corrections that rely on the excitation spectrum cannot be performed.

source
Sunny.SiteType
(cell1, cell2, cell3, i) :: Site

Four indices identifying a single site in a System. The first three indices select the unit cell and the last index selects the sublattice, i.e., the $i$th atom within the unit cell.

This object can be used to index dipoles and coherents fields of a System. A Site is also required to specify inhomogeneous interactions via functions such as set_field_at! or set_exchange_at!.

Note that the definition of a cell may change when a system is reshaped. In this case, it is convenient to construct the Site using position_to_site, which always takes a position in fractional coordinates of the original lattice vectors.

source
Sunny.SpinWaveTheoryType
SpinWaveTheory(sys::System; measure, regularization=1e-8)

Constructs an object to perform linear spin wave theory. The system must be in an energy minimizing configuration. Enables calculation of dispersion bands. If pair correlations are specified with correspec, one can also calculate intensities_bands and broadened intensities.

The spins in system must be energy-minimized, otherwise the Cholesky step of the Bogoliubov diagonalization procedure will fail. The parameter regularization adds a small positive shift to the diagonal of the dynamical matrix to avoid numerical issues with quasi-particle modes of vanishing energy. Physically, this shift can be interpreted as application of an inhomogeneous field aligned with the magnetic ordering.

source
Sunny.SpinWaveTheoryKPMType
SpinWaveTheoryKPM(sys::System; measure, regularization=1e-8, tol)

A variant of SpinWaveTheory that uses the kernel polynomial method (KPM) to perform intensities calculations [1]. Instead of explicitly diagonalizing the dynamical matrix, KPM approximates intensities using polynomial expansion truncated at order $M$. The reduces the computational cost from $𝒪(N^3)$ to $𝒪(N M)$, which is favorable for large system sizes $N$.

The polynomial order $M$ will be determined from the line broadening kernel and the specified error tolerance tol. Specifically, for each wavevector, $M$ scales like the spectral bandwidth of excitations, divided by the energy resolution of the broadening kernel, times the negative logarithm of tol.

The error tolerance tol should be tuned empirically for each calculation. Reasonable starting points are 1e-1 (more speed) or 1e-2 (more accuracy).

Missing intensity at small quasi-particle energy

The KPM-calculated intensities are unreliable at small energies $ω$. In particular, KPM may mask intensities that arise near the Goldstone modes of an ordered state with continuous symmetry.

References

  1. H. Lane et al., Kernel Polynomial Method for Linear Spin Wave Theory (2023) [arXiv:2312.08349].
source
Sunny.SpinWaveTheorySpiralType
SpinWaveTheorySpiral(sys::System; k, axis, measure, regularization=1e-8)

Analogous to SpinWaveTheory, but interprets the provided system as having a generalized spiral order. This order is described by a single propagation wavevector k, which may be incommensurate. The axis vector defines the polarization plane via its surface normal. Typically the spin configuration in sys and the propagation wavevector k will be optimized using minimize_spiral_energy!. In contrast, axis will typically be determined from symmetry considerations.

The resulting object can be used to calculate the spin wave dispersion, or the structure factor via intensities_bands and intensities.

The algorithm for this calculation was developed in Toth and Lake, J. Phys.: Condens. Matter 27, 166002 (2015) and implemented in the SpinW code.

source
Sunny.SystemType
System(crystal::Crystal, moments, mode; dims=(1, 1, 1), seed=nothing)

A spin system is constructed from the Crystal unit cell, a specification of the spin moments symmetry-distinct sites, and a calculation mode. Interactions can be added to the system using, e.g., set_exchange!. The default supercell dimensions are 1×1×1 chemical cells, but this can be changed with dims.

Spin moments comprise a list of pairs, [i1 => Moment(...), i2 => ...], where i1, i2, ... are a complete set of symmetry-distinct atoms. Each Moment contains spin and $g$-factor information.

The two primary options for mode are :SUN and :dipole. In the former, each spin-$s$ degree of freedom is described as an SU(N) coherent state, i.e. a quantum superposition of $N = 2s + 1$ levels. This formalism can be useful to capture multipolar spin fluctuations or local entanglement effects.

Mode :dipole projects the SU(N) dynamics onto the restricted space of pure dipoles. In practice this means that Sunny will simulate Landau-Lifshitz dynamics, but single-ion anisotropy and biquadratic exchange interactions will be renormalized to improve accuracy. To disable this renormalization, use the mode :dipole_uncorrected, which corresponds to the formal $s → ∞$ limit. For details, see the documentation page: Interaction Renormalization.

Stochastic operations on this system can be made reproducible by selecting a seed for this system's pseudo-random number generator. The default system seed will be generated from Julia's task-local RNG, which can itself be seeded using Random.seed!.

All spins are initially polarized in the global $z$-direction.

source
Sunny.UnitsType
Units(energy, length)

Physical constants in units of reference energy and length scales. Possible lengths are [:angstrom, :nm]. For atomic scale modeling, it is preferable to work in units of length=:angstrom, which follows the CIF file standard. Possible energy units are [:meV, :K, :THz, :inverse_cm, :T]. Kelvin is converted to energy via the Boltzmann constant $k_B$. Similarly, hertz is converted via the Planck constant $h$, inverse cm via the speed of light $c$, and tesla (field strength) via the Bohr magneton $μ_B$. For a given Units system, one can access any of the length and energy scale symbols listed above.

Examples

# Unit system with [energy] = meV and [length] = Å
+    "Ir0c" -- 6s²5d⁷

In the dipolar approximation (small $|𝐪|$) the form factor is

$F(s) = ⟨j_0(s)⟩ + [(2-g)/g] ⟨j_2(s)⟩$,

involving $s = |𝐪|/4π$ and the Landé $g$-factor. The $⟨j_l(s)⟩$ are radial averages of the $l$th spherical Bessel function of the magnetic dipole. More details are provided in Ref. [1].

The standard approximation tables involve expansion in Gaussians,

\[⟨j_0(s)⟩ = A e^{-as^2} + B e^{-bs^2} + C e^{-cs^2} + D e^{-ds^2} + E\]

and

\[⟨j_2(s)⟩ = (A e^{-as^2} + B e^{-bs^2} + C e^{-cs^2} + D e^{-ds^2} + E) s^2.\]

For 3d, 4d, rare earth, and actinide ions, Sunny uses the revised tables of P. J. Brown, as documented in the McPhase package [2]. For 5d ions, Sunny uses the tables of Kobayashi, Nagao, Ito [3].

Two special, $𝐪$-independent form factor values are available: one(FormFactor) and zero(FormFactor). The first idealizes the magnetic ion as a perfect point particle, while the second zeros all contributions from the magnetic ion.

References

  1. P. J. Brown, The Neutron Data Booklet, 2nd ed., Sec. 2.5 Magnetic Form Factors (2003).
  2. Coefficient tables in McPhase documentation.
  3. K. Kobayashi, T. Nagao, M. Ito, Radial integrals for the magnetic form factor of 5d transition elements, Acta Cryst. A, 67, 473–480 (2011).
source
Sunny.ImplicitMidpointType
ImplicitMidpoint(dt::Float64; atol=1e-12) where N

The implicit midpoint method for integrating the Landau-Lifshitz spin dynamics or its generalization to SU(N) coherent states [1]. One call to the step! function will advance a System by dt units of time. This integration scheme is exactly symplectic and eliminates energy drift over arbitrarily long simulation trajectories.

References

  1. H. Zhang and C. D. Batista, Classical spin dynamics based on SU(N) coherent states, Phys. Rev. B 104, 104409 (2021).
source
Sunny.LangevinType
Langevin(dt::Float64; damping::Float64, kT::Float64)

An integrator for Langevin spin dynamics using the explicit Heun method. The damping parameter controls the coupling to an implicit thermal bath. One call to the step! function will advance a System by dt units of time. Can be used to sample from the Boltzmann distribution at temperature kT. An alternative approach to sampling states from thermal equilibrium is LocalSampler, which proposes local Monte Carlo moves. For example, use LocalSampler instead of Langevin to sample Ising-like spins.

Setting damping = 0 disables coupling to the thermal bath, yielding an energy-conserving spin dynamics. The Langevin integrator uses an explicit numerical integrator which cannot prevent energy drift. Alternatively, the ImplicitMidpoint method can be used, which is more expensive but prevents energy drift through exact conservation of the symplectic 2-form.

If the System has mode = :dipole, then the dynamics is the stochastic Landau-Lifshitz equation,

\[ d𝐒/dt = -𝐒 × (ξ - 𝐁 + λ 𝐒 × 𝐁),\]

where $𝐁 = -dE/d𝐒$ is the effective field felt by the expected spin dipole $𝐒$. The components of $ξ$ are Gaussian white noise, with magnitude $√(2 k_B T λ)$ set by a fluctuation-dissipation theorem. The parameter damping sets the phenomenological coupling $λ$ to the thermal bath.

If the System has mode = :SUN, then this dynamics generalizes [1] to a stochastic nonlinear Schrödinger equation for SU(N) coherent states $𝐙$,

\[ d𝐙/dt = -i P [ζ + (1 - i λ̃) ℋ 𝐙].\]

Here, $P$ projects onto the space orthogonal to $𝐙$, and $ζ$ denotes complex Gaussian white noise with magnitude $√(2 k_B T λ̃)$. The local-Hamiltonian $ℋ$ embeds the energy gradient into the 𝔰𝔲(N) Lie algebra, and generates evolution of spin dipoles, quadrupoles, etc. The parameter damping here sets $λ̃$, which is analogous to $λ$ above.

When applied to SU(2) coherent states, the generalized spin dynamics reduces exactly to the stochastic Landau-Lifshitz equation. The mapping is as follows. Normalized coherent states $𝐙$ map to dipole expectation values $𝐒 = 𝐙^{†} Ŝ 𝐙$, where spin operators $Ŝ$ are a spin-$|𝐒|$ representation of SU(2). The local effective Hamiltonian $ℋ = -𝐁 ⋅ Ŝ$ generates rotation of the dipole in analogy to the vector cross product $S × 𝐁$. The coupling to the thermal bath maps as $λ̃ = |𝐒| λ$. Note, therefore, that the scaling of the damping parameter varies subtly between :dipole and :SUN modes.

References

  1. D. Dahlbom et al., Langevin dynamics of generalized spins as SU(N) coherent states, Phys. Rev. B 106, 235154 (2022).
source
Sunny.LocalSamplerType
LocalSampler(; kT, nsweeps=1.0, propose=propose_uniform)

Monte Carlo simulation involving Metropolis updates to individual spins. One call to the step! function will perform nsweeps of MCMC sampling for a provided System. The default value of 1.0 means that step! performs, on average, one trial update per spin.

Assuming ergodicity, the LocalSampler will sample from thermal equilibrium for the target temperature kT.

The trial spin updates are sampled using the propose function. Options include propose_uniform, propose_flip, and propose_delta. Multiple proposals can be mixed with the macro @mix_proposals.

The returned object stores fields ΔE and ΔS, which represent the cumulative change to the net energy and dipole, respectively.

Efficiency considerations

Prefer Langevin sampling in most cases. Langevin dynamics will usually be much more efficient for sampling Heisenberg-like spins that vary continuously. LocalSampler is most useful for sampling from discrete spin states. In particular, propose_flip may be required for sampling Ising-like spins that arise due to a strong easy-axis anisotropy. For strong but finite single-ion anisotropy, consider alternating between Langevin and LocalSampler update steps.

source
Sunny.MomentType
Moment(; s, g)

Characterizes a effective spin magnetic moment on an atom. Quantum spin-s is a multiple of 1/2 in units of ħ. The g-factor or tensor defines the magnetic_moment $μ = - g 𝐒$ in units of the Bohr magneton.

Example

Moment(s=3/2, g=2)
source
Sunny.SampledCorrelationsType
SampledCorrelations(sys::System; measure, energies, dt)

An object to accumulate samples of dynamical pair correlations. The measure argument specifies a pair correlation type, e.g. ssf_perp. The energies must be evenly-spaced and starting from 0, e.g. energies = range(0, 3, 100). Select the integration time-step dt according to accuracy and speed considerations. suggest_timestep can help in selecting an appropriate value.

Dynamical correlations will be accumulated through calls to add_sample!, which expects a spin configuration in thermal equilibrium. A classical spin dynamics trajectory will be simulated of sufficient length to achieve the target energy resolution. The resulting data can can then be extracted as pair-correlation intensities with appropriate classical-to-quantum correction factors. See also intensities_static, which integrates over energy.

source
Sunny.SampledCorrelationsStaticType
SampledCorrelationsStatic(sys::System; measure)

An object to accumulate samples of static pair correlations. It is similar to SampledCorrelations, but no time-integration will be performed on calls to add_sample!. The resulting object can be used with intensities_static to calculate statistics from the classical Boltzmann distribution. Dynamical intensities data, however, will be unavailable. Similarly, classical-to-quantum corrections that rely on the excitation spectrum cannot be performed.

source
Sunny.SiteType
(cell1, cell2, cell3, i) :: Site

Four indices identifying a single site in a System. The first three indices select the unit cell and the last index selects the sublattice, i.e., the $i$th atom within the unit cell.

This object can be used to index dipoles and coherents fields of a System. A Site is also required to specify inhomogeneous interactions via functions such as set_field_at! or set_exchange_at!.

Note that the definition of a cell may change when a system is reshaped. In this case, it is convenient to construct the Site using position_to_site, which always takes a position in fractional coordinates of the original lattice vectors.

source
Sunny.SpinWaveTheoryType
SpinWaveTheory(sys::System; measure, regularization=1e-8)

Constructs an object to perform linear spin wave theory. The system must be in an energy minimizing configuration. Enables calculation of dispersion bands. If pair correlations are specified with correspec, one can also calculate intensities_bands and broadened intensities.

The spins in system must be energy-minimized, otherwise the Cholesky step of the Bogoliubov diagonalization procedure will fail. The parameter regularization adds a small positive shift to the diagonal of the dynamical matrix to avoid numerical issues with quasi-particle modes of vanishing energy. Physically, this shift can be interpreted as application of an inhomogeneous field aligned with the magnetic ordering.

source
Sunny.SpinWaveTheoryKPMType
SpinWaveTheoryKPM(sys::System; measure, regularization=1e-8, tol)

A variant of SpinWaveTheory that uses the kernel polynomial method (KPM) to perform intensities calculations [1]. Instead of explicitly diagonalizing the dynamical matrix, KPM approximates intensities using polynomial expansion truncated at order $M$. The reduces the computational cost from $𝒪(N^3)$ to $𝒪(N M)$, which is favorable for large system sizes $N$.

The polynomial order $M$ will be determined from the line broadening kernel and the specified error tolerance tol. Specifically, for each wavevector, $M$ scales like the spectral bandwidth of excitations, divided by the energy resolution of the broadening kernel, times the negative logarithm of tol.

The error tolerance tol should be tuned empirically for each calculation. Reasonable starting points are 1e-1 (more speed) or 1e-2 (more accuracy).

Missing intensity at small quasi-particle energy

The KPM-calculated intensities are unreliable at small energies $ω$. In particular, KPM may mask intensities that arise near the Goldstone modes of an ordered state with continuous symmetry.

References

  1. H. Lane et al., Kernel Polynomial Method for Linear Spin Wave Theory (2023) [arXiv:2312.08349].
source
Sunny.SpinWaveTheorySpiralType
SpinWaveTheorySpiral(sys::System; k, axis, measure, regularization=1e-8)

Analogous to SpinWaveTheory, but interprets the provided system as having a generalized spiral order. This order is described by a single propagation wavevector k, which may be incommensurate. The axis vector defines the polarization plane via its surface normal. Typically the spin configuration in sys and the propagation wavevector k will be optimized using minimize_spiral_energy!. In contrast, axis will typically be determined from symmetry considerations.

The resulting object can be used to calculate the spin wave dispersion, or the structure factor via intensities_bands and intensities.

The algorithm for this calculation was developed in Toth and Lake, J. Phys.: Condens. Matter 27, 166002 (2015) and implemented in the SpinW code.

source
Sunny.SystemType
System(crystal::Crystal, moments, mode; dims=(1, 1, 1), seed=nothing)

A spin system is constructed from the Crystal unit cell, a specification of the spin moments symmetry-distinct sites, and a calculation mode. Interactions can be added to the system using, e.g., set_exchange!. The default supercell dimensions are 1×1×1 chemical cells, but this can be changed with dims.

Spin moments comprise a list of pairs, [i1 => Moment(...), i2 => ...], where i1, i2, ... are a complete set of symmetry-distinct atoms. Each Moment contains spin and $g$-factor information.

The two primary options for mode are :SUN and :dipole. In the former, each spin-$s$ degree of freedom is described as an SU(N) coherent state, i.e. a quantum superposition of $N = 2s + 1$ levels. This formalism can be useful to capture multipolar spin fluctuations or local entanglement effects.

Mode :dipole projects the SU(N) dynamics onto the restricted space of pure dipoles. In practice this means that Sunny will simulate Landau-Lifshitz dynamics, but single-ion anisotropy and biquadratic exchange interactions will be renormalized to improve accuracy. To disable this renormalization, use the mode :dipole_uncorrected, which corresponds to the formal $s → ∞$ limit. For details, see the documentation page: Interaction Renormalization.

Stochastic operations on this system can be made reproducible by selecting a seed for this system's pseudo-random number generator. The default system seed will be generated from Julia's task-local RNG, which can itself be seeded using Random.seed!.

All spins are initially polarized in the global $z$-direction.

source
Sunny.UnitsType
Units(energy, length)

Physical constants in units of reference energy and length scales. Possible lengths are [:angstrom, :nm]. For atomic scale modeling, it is preferable to work in units of length=:angstrom, which follows the CIF file standard. Possible energy units are [:meV, :K, :THz, :inverse_cm, :T]. Kelvin is converted to energy via the Boltzmann constant $k_B$. Similarly, hertz is converted via the Planck constant $h$, inverse cm via the speed of light $c$, and tesla (field strength) via the Bohr magneton $μ_B$. For a given Units system, one can access any of the length and energy scale symbols listed above.

Examples

# Unit system with [energy] = meV and [length] = Å
 units = Units(:meV, :angstrom)
 
 # Use the Boltzmann constant kB to convert 1 kelvin into meV
@@ -52,44 +52,44 @@
 @assert units.T ≈ 0.05788381806
 
 # The physical constant μ0 μB² in units of ų meV.
-@assert u.vacuum_permeability ≈ 0.6745817653
source
Sunny.add_sample!Function
add_sample!(sc::SampledCorrelations, sys::System)
-add_sample!(sc::SampledCorrelationsStatic, sys::System)

Measure pair correlation data for the spin configuration in sys, and accumulate these statistics into sc. For a dynamical SampledCorrelations, this involves time-integration of the provided spin trajectory, recording correlations in both space and time. Conversely, SampledCorrelationsStatic, will record only spatial correlations for the single spin configuration that is provided.

Time-integration will update the spin configuration of sys in-place. To avoid this mutation, consider calling clone_system prior to add_sample!.

source
Sunny.clone_systemFunction
clone_system(sys::System)

Creates a full clone of the system, such that mutable updates to one copy will not affect the other, and thread safety is guaranteed.

source
Sunny.dispersionFunction
dispersion(swt::SpinWaveTheory, qpts)

Given a list of wavevectors qpts in reciprocal lattice units (RLU), returns excitation energies for each band. The return value ret is 2D array, and should be indexed as ret[band_index, q_index].

source
Sunny.dmvecFunction
dmvec(D)

Antisymmetric matrix representation of the Dzyaloshinskii-Moriya pseudo-vector,

  [  0    D[3] -D[2]
+@assert u.vacuum_permeability ≈ 0.6745817653
source
Sunny.add_sample!Function
add_sample!(sc::SampledCorrelations, sys::System)
+add_sample!(sc::SampledCorrelationsStatic, sys::System)

Measure pair correlation data for the spin configuration in sys, and accumulate these statistics into sc. For a dynamical SampledCorrelations, this involves time-integration of the provided spin trajectory, recording correlations in both space and time. Conversely, SampledCorrelationsStatic, will record only spatial correlations for the single spin configuration that is provided.

Time-integration will update the spin configuration of sys in-place. To avoid this mutation, consider calling clone_system prior to add_sample!.

source
Sunny.clone_systemFunction
clone_system(sys::System)

Creates a full clone of the system, such that mutable updates to one copy will not affect the other, and thread safety is guaranteed.

source
Sunny.dispersionFunction
dispersion(swt::SpinWaveTheory, qpts)

Given a list of wavevectors qpts in reciprocal lattice units (RLU), returns excitation energies for each band. The return value ret is 2D array, and should be indexed as ret[band_index, q_index].

source
Sunny.dmvecFunction
dmvec(D)

Antisymmetric matrix representation of the Dzyaloshinskii-Moriya pseudo-vector,

  [  0    D[3] -D[2]
    -D[3]   0    D[1]
-    D[2] -D[1]   0  ]

By construction, Si'*dmvec(D)*Sj ≈ D⋅(Si×Sj) for any dipoles Si and Sj. This helper function is intended for use with set_exchange!.

source
Sunny.domain_averageFunction
domain_average(f, cryst, qpts; rotations, weights)

Calculate an average intensity for the reciprocal-space points qpts under a discrete set of rotations. Rotations, in global coordinates, may be given either as an axis-angle pair or as a 3×3 rotation matrix. Each rotation is weighted according to the elements in weights. The function f should accept a list of rotated q-points and return an intensities calculation.

Example

# 0, 120, and 240 degree rotations about the global z-axis
+    D[2] -D[1]   0  ]

By construction, Si'*dmvec(D)*Sj ≈ D⋅(Si×Sj) for any dipoles Si and Sj. This helper function is intended for use with set_exchange!.

source
Sunny.domain_averageFunction
domain_average(f, cryst, qpts; rotations, weights)

Calculate an average intensity for the reciprocal-space points qpts under a discrete set of rotations. Rotations, in global coordinates, may be given either as an axis-angle pair or as a 3×3 rotation matrix. Each rotation is weighted according to the elements in weights. The function f should accept a list of rotated q-points and return an intensities calculation.

Example

# 0, 120, and 240 degree rotations about the global z-axis
 rotations = [([0,0,1], n*(2π/3)) for n in 0:2]
 weights = [1, 1, 1]
 res = domain_average(cryst, path; rotations, weights) do path_rotated
     intensities(swt, path_rotated; energies, kernel)
 end
-plot_intensities(res)
source
Sunny.enable_dipole_dipole!Function
enable_dipole_dipole!(sys::System, μ0_μB²)

Enables long-range interactions between magnetic dipole moments,

\[ -(μ_0/4π) ∑_{⟨ij⟩} [3 (μ_i⋅𝐫̂_{ij})(μ_j⋅𝐫̂_{ij}) - μ_i⋅μ_j] / r_{ij}^3,\]

where the sum is over all pairs of sites (singly counted), including periodic images, regularized using the Ewald summation convention. Each magnetic moment is $μ = -g μ_B 𝐒$, where $𝐒$ is the spin angular momentum dipole. The parameter μ0_μB² specifies the physical constant $μ_0 μ_B^2$, which has dimensions of length³-energy. Obtain this constant for a given system of Units via its vacuum_permeability property.

Example

units = Units(:meV, :angstrom)
-enable_dipole_dipole!(sys, units.vacuum_permeability)
Efficiency considerations

Dipole-dipole interactions are very efficient in the context of spin dynamics simulation, e.g. Langevin. Sunny applies the fast Fourier transform (FFT) to spins on each Bravais sublattice, such that the computational cost to integrate one time-step scales like $M^2 N \ln N$, where $N$ is the number of cells in the system and $M$ is the number of Bravais sublattices per cell. Conversely, dipole-dipole interactions are highly inefficient in the context of a LocalSampler. Each Monte Carlo update of a single spin currently requires scanning over all other spins in the system.

See also modify_exchange_with_truncated_dipole_dipole!.

source
Sunny.excitationsFunction
excitations(swt::SpinWaveTheory, q)
-excitations(swt::SpinWaveTheorySpiral, q; branch)

Returns a pair (energies, T) providing the excitation energies and eigenvectors. Prefer excitations! for performance, which avoids matrix allocations. See the documentation of excitations! for more details.

source
Sunny.excitations!Function
excitations!(T, tmp, swt::SpinWaveTheory, q)

Given a wavevector q, solves for the matrix T representing quasi-particle excitations, and returns a list of quasi-particle energies. Both T and tmp must be supplied as $2L×2L$ complex matrices, where $L$ is the number of bands for a single $𝐪$ value.

The columns of T are understood to be contracted with the Holstein-Primakoff bosons $[𝐛_𝐪, 𝐛_{-𝐪}^†]$. The first $L$ columns provide the eigenvectors of the quadratic Hamiltonian for the wavevector $𝐪$. The next $L$ columns of T describe eigenvectors for $-𝐪$. The return value is a vector with similar grouping: the first $L$ values are energies for $𝐪$, and the next $L$ values are the negation of energies for $-𝐪$.

excitations!(T, tmp, swt::SpinWaveTheorySpiral, q; branch)

Calculations on a SpinWaveTheorySpiral additionally require a branch index. The possible branches $(1, 2, 3)$ correspond to scattering processes $𝐪 - 𝐤, 𝐪, 𝐪 + 𝐤$ respectively, where $𝐤$ is the ordering wavevector. Each branch will contribute $L$ excitations, where $L$ is the number of spins in the magnetic cell. This yields a total of $3L$ excitations for a given momentum transfer $𝐪$.

source
Sunny.gaussianFunction
gaussian(; {fwhm, σ})

Returns the function exp(-x^2/2σ^2) / √(2π*σ^2). Either fwhm or σ must be specified, where fwhm = (2.355...) * σ is the full width at half maximum.

source
Sunny.global_positionFunction
global_position(sys::System, site::Site)

Position of a Site in global coordinates.

To precompute a full list of positions, one can use eachsite as below:

pos = [global_position(sys, site) for site in eachsite(sys)]
source
Sunny.intensitiesFunction
intensities(swt::SpinWaveTheory, qpts; energies, kernel, kT=0)
-intensities(sc::SampledCorrelations, qpts; energies, kernel=nothing, kT)

Calculates dynamical pair correlation intensities for a set of $𝐪$-points in reciprocal space.

Linear spin wave theory calculations are performed with an instance of SpinWaveTheory. The alternative SpinWaveTheorySpiral allows to study generalized spiral orders with a single, incommensurate-$𝐤$ ordering wavevector. Another alternative SpinWaveTheoryKPM is favorable for calculations on large magnetic cells, and allows to study systems with disorder. An optional nonzero temperature kT will scale intensities by the quantum thermal occupation factor $|1 + n_B(ω)|$ where $n_B(ω) = 1/(e^{βω}-1)$ is the Bose function.

Intensities can also be calculated for SampledCorrelations associated with classical spin dynamics. In this case, thermal broadening will already be present, and the line-broadening kernel becomes optional. Conversely, the parameter kT becomes required. If positive, it will introduce an intensity correction factor $|βω (1 + n_B(ω))|$ that undoes the occupation factor for the classical Boltzmann distribution and applies the quantum thermal occupation factor. The special choice kT = nothing will suppress the classical-to-quantum correction factor, and yield statistics consistent with the classical Boltzmann distribution.

source
Sunny.intensities_bandsFunction
intensities_bands(swt::SpinWaveTheory, qpts; kT=0)

Calculate spin wave excitation bands for a set of q-points in reciprocal space. This calculation is analogous to intensities, but does not perform line broadening of the bands.

source
Sunny.intensities_staticFunction
intensities_static(swt::SpinWaveTheory, qpts; bounds=(-Inf, Inf), kernel=nothing, kT=0)
+plot_intensities(res)
source
Sunny.enable_dipole_dipole!Function
enable_dipole_dipole!(sys::System, μ0_μB²)

Enables long-range interactions between magnetic dipole moments,

\[ -(μ_0/4π) ∑_{⟨ij⟩} [3 (μ_i⋅𝐫̂_{ij})(μ_j⋅𝐫̂_{ij}) - μ_i⋅μ_j] / r_{ij}^3,\]

where the sum is over all pairs of sites (singly counted), including periodic images, regularized using the Ewald summation convention. Each magnetic moment is $μ = -g μ_B 𝐒$, where $𝐒$ is the spin angular momentum dipole. The parameter μ0_μB² specifies the physical constant $μ_0 μ_B^2$, which has dimensions of length³-energy. Obtain this constant for a given system of Units via its vacuum_permeability property.

Example

units = Units(:meV, :angstrom)
+enable_dipole_dipole!(sys, units.vacuum_permeability)
Efficiency considerations

Dipole-dipole interactions are very efficient in the context of spin dynamics simulation, e.g. Langevin. Sunny applies the fast Fourier transform (FFT) to spins on each Bravais sublattice, such that the computational cost to integrate one time-step scales like $M^2 N \ln N$, where $N$ is the number of cells in the system and $M$ is the number of Bravais sublattices per cell. Conversely, dipole-dipole interactions are highly inefficient in the context of a LocalSampler. Each Monte Carlo update of a single spin currently requires scanning over all other spins in the system.

See also modify_exchange_with_truncated_dipole_dipole!.

source
Sunny.excitationsFunction
excitations(swt::SpinWaveTheory, q)
+excitations(swt::SpinWaveTheorySpiral, q; branch)

Returns a pair (energies, T) providing the excitation energies and eigenvectors. Prefer excitations! for performance, which avoids matrix allocations. See the documentation of excitations! for more details.

source
Sunny.excitations!Function
excitations!(T, tmp, swt::SpinWaveTheory, q)

Given a wavevector q, solves for the matrix T representing quasi-particle excitations, and returns a list of quasi-particle energies. Both T and tmp must be supplied as $2L×2L$ complex matrices, where $L$ is the number of bands for a single $𝐪$ value.

The columns of T are understood to be contracted with the Holstein-Primakoff bosons $[𝐛_𝐪, 𝐛_{-𝐪}^†]$. The first $L$ columns provide the eigenvectors of the quadratic Hamiltonian for the wavevector $𝐪$. The next $L$ columns of T describe eigenvectors for $-𝐪$. The return value is a vector with similar grouping: the first $L$ values are energies for $𝐪$, and the next $L$ values are the negation of energies for $-𝐪$.

excitations!(T, tmp, swt::SpinWaveTheorySpiral, q; branch)

Calculations on a SpinWaveTheorySpiral additionally require a branch index. The possible branches $(1, 2, 3)$ correspond to scattering processes $𝐪 - 𝐤, 𝐪, 𝐪 + 𝐤$ respectively, where $𝐤$ is the ordering wavevector. Each branch will contribute $L$ excitations, where $L$ is the number of spins in the magnetic cell. This yields a total of $3L$ excitations for a given momentum transfer $𝐪$.

source
Sunny.gaussianFunction
gaussian(; {fwhm, σ})

Returns the function exp(-x^2/2σ^2) / √(2π*σ^2). Either fwhm or σ must be specified, where fwhm = (2.355...) * σ is the full width at half maximum.

source
Sunny.global_positionFunction
global_position(sys::System, site::Site)

Position of a Site in global coordinates.

To precompute a full list of positions, one can use eachsite as below:

pos = [global_position(sys, site) for site in eachsite(sys)]
source
Sunny.intensitiesFunction
intensities(swt::SpinWaveTheory, qpts; energies, kernel, kT=0)
+intensities(sc::SampledCorrelations, qpts; energies, kernel=nothing, kT)

Calculates dynamical pair correlation intensities for a set of $𝐪$-points in reciprocal space.

Linear spin wave theory calculations are performed with an instance of SpinWaveTheory. The alternative SpinWaveTheorySpiral allows to study generalized spiral orders with a single, incommensurate-$𝐤$ ordering wavevector. Another alternative SpinWaveTheoryKPM is favorable for calculations on large magnetic cells, and allows to study systems with disorder. An optional nonzero temperature kT will scale intensities by the quantum thermal occupation factor $|1 + n_B(ω)|$ where $n_B(ω) = 1/(e^{βω}-1)$ is the Bose function.

Intensities can also be calculated for SampledCorrelations associated with classical spin dynamics. In this case, thermal broadening will already be present, and the line-broadening kernel becomes optional. Conversely, the parameter kT becomes required. If positive, it will introduce an intensity correction factor $|βω (1 + n_B(ω))|$ that undoes the occupation factor for the classical Boltzmann distribution and applies the quantum thermal occupation factor. The special choice kT = nothing will suppress the classical-to-quantum correction factor, and yield statistics consistent with the classical Boltzmann distribution.

source
Sunny.intensities_bandsFunction
intensities_bands(swt::SpinWaveTheory, qpts; kT=0)

Calculate spin wave excitation bands for a set of q-points in reciprocal space. This calculation is analogous to intensities, but does not perform line broadening of the bands.

source
Sunny.intensities_staticFunction
intensities_static(swt::SpinWaveTheory, qpts; bounds=(-Inf, Inf), kernel=nothing, kT=0)
 intensities_static(sc::SampledCorrelations, qpts; bounds=(-Inf, Inf), kT)
-intensities_static(sc::SampledCorrelationsStatic, qpts)

Like intensities, but integrates the dynamical correlations $\mathcal{S}(𝐪, ω)$ over a range of energies $ω$. By default, the integration bounds are $(-∞, ∞)$, yielding the instantaneous (equal-time) correlations.

In SpinWaveTheory, the integral will be realized as a sum over discrete bands. Alternative calculation methods are SpinWaveTheorySpiral and SpinWaveTheoryKPM.

Classical dynamics data in SampledCorrelations can also be used to calculate static intensities. In this case, the domain of integration will be a finite grid of available energies. Here, the parameter kT will be used to account for the quantum thermal occupation of excitations, as documented in intensities.

Static intensities calculated from SampledCorrelationsStatic are dynamics-independent. Instead, instantaneous correlations sampled from the classical Boltzmann distribution will be reported.

source
Sunny.lattice_paramsFunction
lattice_params(latvecs)

Compute the lattice parameters $(a, b, c, α, β, γ)$ for the three lattice vectors provided as columns of latvecs. The inverse mapping is lattice_vectors.

source
Sunny.lattice_vectorsFunction
lattice_vectors(a, b, c, α, β, γ)

Return the lattice vectors, as columns of the $3×3$ output matrix, that define the shape of a crystallographic cell in global Cartesian coordinates. Conversely, one can view the output matrix as defining the global Cartesian coordinate system with respect to the lattice system.

The lattice constants $(a, b, c)$ have units of length, and the angles $(α, β, γ)$ are in degrees. The inverse mapping is lattice_params.

Example

latvecs = lattice_vectors(1, 1, 2, 90, 90, 120)
+intensities_static(sc::SampledCorrelationsStatic, qpts)

Like intensities, but integrates the dynamical correlations $\mathcal{S}(𝐪, ω)$ over a range of energies $ω$. By default, the integration bounds are $(-∞, ∞)$, yielding the instantaneous (equal-time) correlations.

In SpinWaveTheory, the integral will be realized as a sum over discrete bands. Alternative calculation methods are SpinWaveTheorySpiral and SpinWaveTheoryKPM.

Classical dynamics data in SampledCorrelations can also be used to calculate static intensities. In this case, the domain of integration will be a finite grid of available energies. Here, the parameter kT will be used to account for the quantum thermal occupation of excitations, as documented in intensities.

Static intensities calculated from SampledCorrelationsStatic are dynamics-independent. Instead, instantaneous correlations sampled from the classical Boltzmann distribution will be reported.

source
Sunny.lattice_paramsFunction
lattice_params(latvecs)

Compute the lattice parameters $(a, b, c, α, β, γ)$ for the three lattice vectors provided as columns of latvecs. The inverse mapping is lattice_vectors.

source
Sunny.lattice_vectorsFunction
lattice_vectors(a, b, c, α, β, γ)

Return the lattice vectors, as columns of the $3×3$ output matrix, that define the shape of a crystallographic cell in global Cartesian coordinates. Conversely, one can view the output matrix as defining the global Cartesian coordinate system with respect to the lattice system.

The lattice constants $(a, b, c)$ have units of length, and the angles $(α, β, γ)$ are in degrees. The inverse mapping is lattice_params.

Example

latvecs = lattice_vectors(1, 1, 2, 90, 90, 120)
 a1, a2, a3 = eachcol(latvecs)
 @assert a1 ≈ [1, 0, 0]       # a1 always aligned with global x
 @assert a2 ≈ [-1/2, √3/2, 0] # a2 always in global (x,y) plane
-@assert a3 ≈ [0, 0, 2]       # a3 may generally be a combination of (x,y,z)
source
Sunny.load_nxsFunction
params, signal = load_nxs(filename; field="signal")

Given the name of a Mantid-exported MDHistoWorkspace file, load the BinningParameters and the signal from that file.

To load another field instead of the signal, specify e.g. field="errors_squared". Typical fields include errors_squared, mask, num_events, and signal.

source
Sunny.lorentzianFunction
lorentzian(; fwhm)

Returns the function (Γ/2) / (π*(x^2+(Γ/2)^2)) where Γ = fwhm is the full width at half maximum.

source
Sunny.magnetic_momentFunction
magnetic_moment(sys::System, site::Site)

Returns $- g 𝐒$, the local magnetic moment in units of the Bohr magneton. The spin dipole $𝐒$ and $g$-tensor may both be Site dependent.

source
Sunny.merge_correlationsFunction
merge_correlations(scs::Vector{SampledCorrelations)

Accumulate a list of SampledCorrelations into a single, summary SampledCorrelations. Useful for reducing the results of parallel computations.

source
Sunny.minimize_energy!Function
minimize_energy!(sys::System{N}; maxiters=1000, method=Optim.ConjugateGradient(),
-                 kwargs...) where N

Optimizes the spin configuration in sys to minimize energy. A total of maxiters iterations will be attempted. The method parameter will be used in the optimize function of the Optim.jl package. Any remaining kwargs will be included in the Options constructor of Optim.jl.

source
Sunny.minimize_spiral_energy!Function
minimize_spiral_energy!(sys, axis; maxiters=10_000, k_guess=randn(sys.rng, 3))

Finds a generalized spiral order that minimizes the spiral_energy. This involves optimization of the spin configuration in sys, and the propagation wavevector $𝐤$, which will be returned in reciprocal lattice units (RLU). The axis vector normal to the polarization plane cannot yet be optimized; it should be determined according to symmetry considerations and provided in global Cartesian coordinates. The initial k_guess will be random, unless otherwise provided.

See also suggest_magnetic_supercell to find a system shape that is approximately commensurate with the returned propagation wavevector $𝐤$.

source
Sunny.modify_exchange_with_truncated_dipole_dipole!Function
modify_exchange_with_truncated_dipole_dipole!(sys::System, cutoff, μ0_μB²)

Like enable_dipole_dipole!, the purpose of this function is to introduce long-range dipole-dipole interactions between magnetic moments. Whereas enable_dipole_dipole! employs Ewald summation, this function instead employs real-space pair couplings with truncation at the specified cutoff distance. If the cutoff is relatively small, then this function may be faster than enable_dipole_dipole!.

Mutation of existing couplings

This function will modify existing bilinear couplings between spins by adding dipole-dipole interactions. It must therefore be called after all other pair couplings have been specified. Conversely, any calls to set_exchange!, set_pair_coupling!, etc. will irreversibly delete the dipole-dipole interactions that have been introduced by this function.

source
Sunny.position_to_siteFunction
position_to_site(sys::System, r)

Converts a position r to four indices of a Site. The coordinates of r are given in units of the lattice vectors for the original crystal. This function can be useful for working with systems that have been reshaped using reshape_supercell.

Example

# Find the `site` at the center of a unit cell which is displaced by four
+@assert a3 ≈ [0, 0, 2]       # a3 may generally be a combination of (x,y,z)
source
Sunny.load_nxsFunction
params, signal = load_nxs(filename; field="signal")

Given the name of a Mantid-exported MDHistoWorkspace file, load the BinningParameters and the signal from that file.

To load another field instead of the signal, specify e.g. field="errors_squared". Typical fields include errors_squared, mask, num_events, and signal.

source
Sunny.lorentzianFunction
lorentzian(; fwhm)

Returns the function (Γ/2) / (π*(x^2+(Γ/2)^2)) where Γ = fwhm is the full width at half maximum.

source
Sunny.magnetic_momentFunction
magnetic_moment(sys::System, site::Site)

Returns $- g 𝐒$, the local magnetic moment in units of the Bohr magneton. The spin dipole $𝐒$ and $g$-tensor may both be Site dependent.

source
Sunny.merge_correlationsFunction
merge_correlations(scs::Vector{SampledCorrelations)

Accumulate a list of SampledCorrelations into a single, summary SampledCorrelations. Useful for reducing the results of parallel computations.

source
Sunny.minimize_energy!Function
minimize_energy!(sys::System{N}; maxiters=1000, method=Optim.ConjugateGradient(),
+                 kwargs...) where N

Optimizes the spin configuration in sys to minimize energy. A total of maxiters iterations will be attempted. The method parameter will be used in the optimize function of the Optim.jl package. Any remaining kwargs will be included in the Options constructor of Optim.jl.

source
Sunny.minimize_spiral_energy!Function
minimize_spiral_energy!(sys, axis; maxiters=10_000, k_guess=randn(sys.rng, 3))

Finds a generalized spiral order that minimizes the spiral_energy. This involves optimization of the spin configuration in sys, and the propagation wavevector $𝐤$, which will be returned in reciprocal lattice units (RLU). The axis vector normal to the polarization plane cannot yet be optimized; it should be determined according to symmetry considerations and provided in global Cartesian coordinates. The initial k_guess will be random, unless otherwise provided.

See also suggest_magnetic_supercell to find a system shape that is approximately commensurate with the returned propagation wavevector $𝐤$.

source
Sunny.modify_exchange_with_truncated_dipole_dipole!Function
modify_exchange_with_truncated_dipole_dipole!(sys::System, cutoff, μ0_μB²)

Like enable_dipole_dipole!, the purpose of this function is to introduce long-range dipole-dipole interactions between magnetic moments. Whereas enable_dipole_dipole! employs Ewald summation, this function instead employs real-space pair couplings with truncation at the specified cutoff distance. If the cutoff is relatively small, then this function may be faster than enable_dipole_dipole!.

Mutation of existing couplings

This function will modify existing bilinear couplings between spins by adding dipole-dipole interactions. It must therefore be called after all other pair couplings have been specified. Conversely, any calls to set_exchange!, set_pair_coupling!, etc. will irreversibly delete the dipole-dipole interactions that have been introduced by this function.

source
Sunny.position_to_siteFunction
position_to_site(sys::System, r)

Converts a position r to four indices of a Site. The coordinates of r are given in units of the lattice vectors for the original crystal. This function can be useful for working with systems that have been reshaped using reshape_supercell.

Example

# Find the `site` at the center of a unit cell which is displaced by four
 # multiples of the first lattice vector
 site = position_to_site(sys, [4.5, 0.5, 0.5])
 
 # Print the dipole at this site
-println(sys.dipoles[site])
source
Sunny.powder_averageFunction
powder_average(f, cryst, radii, n; seed=0)

Calculate a powder-average over structure factor intensities. The radii, with units of inverse length, define spherical shells in reciprocal space. The Fibonacci lattice yields n points on the sphere, with quasi-uniformity. Sample points on different shells are decorrelated through random rotations. A consistent random number seed will yield reproducible results. The function f should accept a list of q-points and call intensities.

Example

radii = range(0.0, 3.0, 200)
+println(sys.dipoles[site])
source
Sunny.powder_averageFunction
powder_average(f, cryst, radii, n; seed=0)

Calculate a powder-average over structure factor intensities. The radii, with units of inverse length, define spherical shells in reciprocal space. The Fibonacci lattice yields n points on the sphere, with quasi-uniformity. Sample points on different shells are decorrelated through random rotations. A consistent random number seed will yield reproducible results. The function f should accept a list of q-points and call intensities.

Example

radii = range(0.0, 3.0, 200)
 res = powder_average(cryst, radii, 500) do qs
     intensities(swt, qs; energies, kernel)
 end
-plot_intensities(res)
source
Sunny.primitive_cellFunction
primitive_cell(cryst)

The shape of a primitive cell in multiples of the lattice vectors for cryst. Specifically, columns of cryst.latvecs * primitive(cryst) define the primitive lattice vectors in global Cartesian coordinates. Returns nothing if spacegroup setting information is missing.

This function may be useful for constructing inputs to reshape_supercell.

source
Sunny.print_bondFunction
print_bond(cryst::Crystal, b::Bond; b_ref=b)

Prints symmetry information for bond b. An optional symmetry-equivalent reference bond b_ref can be provided to keep a consistent meaning of the free parameters A, B, etc.

source
Sunny.print_irreducible_bz_pathsFunction
print_irreducible_bz_paths(cryst::Crystal)

Prints certain high-symmetry points with suggested paths between them. The points lie in the irreducible Brillouin, which is reduced from the first Brillouin zone by the point group symmetries of the crystal. Coordinates are printed in reciprocal lattice units (RLU), i.e., as multiples of the conventional lattice vectors of cryst. These high-symmetry paths were originally formulated in Ref. [1] and implemented in SeeK-path. Sunny obtains this functionality from the Brillouin.jl package.

See also view_bz for an interactive visualization of these high-symmetry paths.

References

  1. Y. Hinuma, G. Pizzi, Y. Kumagai, F. Oba, I. Tanaka, Band structure diagram paths based on crystallography, Comp. Mat. Sci. 128, 140 (2017).
source
Sunny.print_siteFunction
print_site(cryst, i; i_ref=i, R=I)

Print symmetry information for the site i, including allowed g-tensor and allowed anisotropy operator. An optional symmetry-equivalent reference atom i_ref can be provided to keep a consistent meaning of the free parameters. An optional rotation matrix R can map to a new Cartesian reference frame for expression of the allowed anisotropy.

source
Sunny.print_stevens_expansionFunction
function print_stevens_expansion(op)

Prints a local Hermitian operator as a linear combination of Stevens operators. The operator op may be a finite-dimensional matrix or an abstract spin polynomial in the large-$s$ limit.

Examples

S = spin_matrices(2)
+plot_intensities(res)
source
Sunny.primitive_cellFunction
primitive_cell(cryst)

The shape of a primitive cell in multiples of the lattice vectors for cryst. Specifically, columns of cryst.latvecs * primitive(cryst) define the primitive lattice vectors in global Cartesian coordinates. Returns nothing if spacegroup setting information is missing.

This function may be useful for constructing inputs to reshape_supercell.

source
Sunny.print_bondFunction
print_bond(cryst::Crystal, b::Bond; b_ref=b)

Prints symmetry information for bond b. An optional symmetry-equivalent reference bond b_ref can be provided to keep a consistent meaning of the free parameters A, B, etc.

source
Sunny.print_irreducible_bz_pathsFunction
print_irreducible_bz_paths(cryst::Crystal)

Prints certain high-symmetry points with suggested paths between them. The points lie in the irreducible Brillouin, which is reduced from the first Brillouin zone by the point group symmetries of the crystal. Coordinates are printed in reciprocal lattice units (RLU), i.e., as multiples of the conventional lattice vectors of cryst. These high-symmetry paths were originally formulated in Ref. [1] and implemented in SeeK-path. Sunny obtains this functionality from the Brillouin.jl package.

See also view_bz for an interactive visualization of these high-symmetry paths.

References

  1. Y. Hinuma, G. Pizzi, Y. Kumagai, F. Oba, I. Tanaka, Band structure diagram paths based on crystallography, Comp. Mat. Sci. 128, 140 (2017).
source
Sunny.print_siteFunction
print_site(cryst, i; i_ref=i, R=I)

Print symmetry information for the site i, including allowed g-tensor and allowed anisotropy operator. An optional symmetry-equivalent reference atom i_ref can be provided to keep a consistent meaning of the free parameters. An optional rotation matrix R can map to a new Cartesian reference frame for expression of the allowed anisotropy.

source
Sunny.print_stevens_expansionFunction
function print_stevens_expansion(op)

Prints a local Hermitian operator as a linear combination of Stevens operators. The operator op may be a finite-dimensional matrix or an abstract spin polynomial in the large-$s$ limit.

Examples

S = spin_matrices(2)
 print_stevens_expansion(S[1]^4 + S[2]^4 + S[3]^4)
 # Prints: (1/20)𝒪₄₀ + (1/4)𝒪₄₄ + 102/5
 
 S = spin_matrices(Inf)
 print_stevens_expansion(S[1]^4 + S[2]^4 + S[3]^4)
-# Prints: (1/20)𝒪₄₀ + (1/4)𝒪₄₄ + (3/5)𝒮⁴
source
Sunny.print_suggested_frameFunction
print_suggested_frame(cryst, i)

Print a suggested reference frame, as a rotation matrix R, that can be used as input to print_site(). The purpose is to simplify the description of allowed anisotropies.

source
Sunny.print_symmetry_tableFunction
print_symmetry_table(cryst::Crystal, max_dist)

Print symmetry information for all equivalence classes of sites and bonds, up to a maximum bond distance of max_dist. Equivalent to calling print_bond(cryst, b) for every bond b in reference_bonds(cryst, max_dist), where Bond(i, i, [0,0,0]) refers to a single site i.

source
Sunny.print_wrapped_intensitiesFunction
print_wrapped_intensities(sys::System; nmax=10)

For Bravais lattices: Prints up to nmax wavevectors according to their instantaneous (static) structure factor intensities, listed in descending order. For non-Bravais lattices: Performs the same analysis for each spin sublattice independently; the output weights are naïvely averaged over sublattices, without incorporating phase shift information. This procedure therefore wraps all wavevectors into the first Brillouin zone. Each wavevector coordinate is given between $-1/2$ and $1/2$ in reciprocal lattice units (RLU). The output from this function will typically be used as input to suggest_magnetic_supercell.

Because this function does not incorporate phase information in its averaging over sublattices, the printed weights are not directly comparable with experiment. For that purpose, use SampledCorrelationsStatic instead.

source
Sunny.propose_deltaFunction
propose_delta(magnitude)

Generate a proposal function that adds a Gaussian perturbation to the existing spin state. In :dipole mode, the procedure is to first introduce a random three-vector perturbation $𝐒′ = 𝐒 + |𝐒| ξ$ and then return the properly normalized spin $|𝐒| (𝐒′/|𝐒′|)$. Each component of the random vector $ξ$ is Gaussian distributed with a standard deviation of magnitude; the latter is dimensionless and typically smaller than one.

In :SUN mode, the procedure is analogous, but now involving Gaussian perturbations to each of the $N$ complex components of an SU(N) coherent state.

In the limit of very large magnitude, this function coincides with propose_uniform.

Consider also Langevin sampling, which is rejection free.

source
Sunny.propose_flipFunction
propose_flip

Function to propose pure spin flip updates in the context of a LocalSampler. Dipoles are flipped as $𝐒 → -𝐒$. SU(N) coherent states are flipped using the time-reversal operator.

source
Sunny.propose_uniformFunction
propose_uniform

Function to propose a uniformly random spin update in the context of a LocalSampler. In :dipole mode, the result is a random three-vector with appropriate normalization. In :SUN mode, the result is a random SU(N) coherent state with appropriate normalization.

For low-temperature Monte Carlo simulations, uniform spin proposals can be very inefficient due to a high probability of rejection in the Metropolis accept/reject step. Consider also Langevin sampling, which is rejection free.

source
Sunny.q_space_gridFunction
q_space_grid(cryst::Crystal, axis1, range1, axis2, range2; offset=[0,0,0], orthogonalize=false)
-q_space_grid(cryst::Crystal, axis1, range1, axis2, range2, axis3, range3; orthogonalize=false)

Returns a 2D or 3D grid of q-points with uniform spacing. The volume shape is defined by (axis1, axis2, ...) in reciprocal lattice units (RLU). Elements of (range1, range2, ...) provide coefficients $c_i$ used to define grid positions,

    offset + c1 * axis1 + c2 * axis2 + ...

A nonzero offset is allowed only in the 2D case.

The first range parameter, range1, must be a regularly spaced list of coefficients, e.g., range1 = range(lo1, hi1, n). Subsequent range parameters may be a pair of bounds, without grid spacing information. For example, by selecting range2 = (lo2, hi2), an appropriate step-size will be inferred to provide an approximately uniform sampling density in global Cartesian coordinates.

The axes may be non-orthogonal. To extend to an orthohombic volume in global Cartesian coordinates, set orthogonalize=true.

For a 1D grid, use q_space_path instead.

source
Sunny.q_space_pathFunction
q_space_path(cryst::Crystal, qs, n; labels=nothing)

Returns a 1D path consisting of n wavevectors sampled piecewise-linearly between the points in qs. Although the qs are provided in reciprocal lattice units (RLU), consecutive samples are spaced uniformly in the global (inverse-length) Cartesian coordinate system. Optional labels can be associated with each special q-point, and will be used in plotting functions.

See also q_space_grid.

source
Sunny.reference_bondsFunction
reference_bonds(cryst::Crystal, max_dist)

Returns a full list of bonds, one for each symmetry equivalence class, up to distance max_dist. The reference bond b for each equivalence class is selected according to a scoring system that prioritizes simplification of the elements in basis_for_symmetry_allowed_couplings(cryst, b).

source
Sunny.remove_periodicity!Function
remove_periodicity!(sys::System, flags)

Remove periodic interactions along each dimension d if flags[d] is true. The system must support inhomogeneous interactions via to_inhomogeneous.

Example

# Remove periodic boundaries along the 1st and 3rd dimensions
-remove_periodicity!(sys::System, (true, false, true))
source
Sunny.repeat_periodically_as_spiralFunction
repeat_periodically_as_spiral(sys::System, counts::NTuple{3, Int}; k, axis)

Repeats the magnetic cell of System a number of times along each system axis according to the specified counts. Spins in each system image will be rotated according to the propagation wavevector k (in RLU) and the rotation axis (in global Cartesian coordinates). Coincides with repeat_periodically in the special case of k = [0, 0, 0]

See also minimize_spiral_energy! to find an energy-minimizing wavevector k and spin dipole configuration.

Example

k = minimize_spiral_energy!(sys, axis; k_guess=randn(3))
-repeat_periodically_as_spiral(sys, counts; k, axis)
source
Sunny.reshape_supercellFunction
reshape_supercell(sys::System, shape)

Maps an existing System to a new one that has the shape and periodicity of a requested supercell. The columns of the $3×3$ integer matrix shape represent the supercell lattice vectors measured in units of the original crystal lattice vectors. Interactions, spins, and other settings will be inherited from sys.

In the special case that shape is a diagonal matrix, this function coincides with resize_supercell.

See also repeat_periodically.

source
Sunny.resize_supercellFunction
resize_supercell(sys::System, dims::NTuple{3, Int})

Creates a System with a given number of conventional unit cells in each lattice vector direction. Interactions, spins, and other settings will be inherited from sys.

Equivalent to:

reshape_supercell(sys, [dims[1] 0 0; 0 dims[2] 0; 0 0 dims[3]])

See also reshape_supercell and repeat_periodically.

source
Sunny.rotate_operatorFunction
rotate_operator(A, R)

Rotates the local quantum operator A according to the $3×3$ rotation matrix R.

source
Sunny.set_coherent!Function
set_coherent!(sys::System, Z, site::Site)

Set a coherent spin state at a Site using the $N$ complex amplitudes in Z.

For a single quantum spin-$s$, these amplitudes will be interpreted in the eigenbasis of $Ŝ^z$. That is, Z[1] represents the amplitude for the basis state fully polarized along the $ẑ$-direction, and subsequent components represent states with decreasing angular momentum along this axis ($m = s, s-1, …, -s$).

source
Sunny.set_dipoles_from_mcif!Function
set_dipoles_from_mcif!(sys::System, filename::AbstractString)

Load the magnetic supercell according to an mCIF file. System sys must already be resized to the correct supercell dimensions.

source
Sunny.set_exchange!Function
set_exchange!(sys::System, J, bond::Bond; biquad=0)

Sets an exchange interaction $𝐒_i⋅J 𝐒_j$ along the specified bond. This interaction will be propagated to equivalent bonds in consistency with crystal symmetry. Any previous interactions on these bonds will be overwritten. The parameter bond has the form Bond(i, j, offset), where i and j are atom indices within the unit cell, and offset is a displacement in unit cells.

As a convenience, scalar J can be used to specify a Heisenberg interaction. Also, the function dmvec(D) can be used to construct the antisymmetric part of the exchange, where D is the Dzyaloshinskii-Moriya pseudo-vector. The resulting interaction will be $𝐃⋅(𝐒_i×𝐒_j)$.

The optional numeric parameter biquad multiplies a scalar biquadratic interaction, $(𝐒_i⋅𝐒_j)^2$, with Interaction Renormalization if appropriate. For more general interactions, use set_pair_coupling! instead.

Examples

using LinearAlgebra
+# Prints: (1/20)𝒪₄₀ + (1/4)𝒪₄₄ + (3/5)𝒮⁴
source
Sunny.print_suggested_frameFunction
print_suggested_frame(cryst, i)

Print a suggested reference frame, as a rotation matrix R, that can be used as input to print_site(). The purpose is to simplify the description of allowed anisotropies.

source
Sunny.print_symmetry_tableFunction
print_symmetry_table(cryst::Crystal, max_dist)

Print symmetry information for all equivalence classes of sites and bonds, up to a maximum bond distance of max_dist. Equivalent to calling print_bond(cryst, b) for every bond b in reference_bonds(cryst, max_dist), where Bond(i, i, [0,0,0]) refers to a single site i.

source
Sunny.print_wrapped_intensitiesFunction
print_wrapped_intensities(sys::System; nmax=10)

For Bravais lattices: Prints up to nmax wavevectors according to their instantaneous (static) structure factor intensities, listed in descending order. For non-Bravais lattices: Performs the same analysis for each spin sublattice independently; the output weights are naïvely averaged over sublattices, without incorporating phase shift information. This procedure therefore wraps all wavevectors into the first Brillouin zone. Each wavevector coordinate is given between $-1/2$ and $1/2$ in reciprocal lattice units (RLU). The output from this function will typically be used as input to suggest_magnetic_supercell.

Because this function does not incorporate phase information in its averaging over sublattices, the printed weights are not directly comparable with experiment. For that purpose, use SampledCorrelationsStatic instead.

source
Sunny.propose_deltaFunction
propose_delta(magnitude)

Generate a proposal function that adds a Gaussian perturbation to the existing spin state. In :dipole mode, the procedure is to first introduce a random three-vector perturbation $𝐒′ = 𝐒 + |𝐒| ξ$ and then return the properly normalized spin $|𝐒| (𝐒′/|𝐒′|)$. Each component of the random vector $ξ$ is Gaussian distributed with a standard deviation of magnitude; the latter is dimensionless and typically smaller than one.

In :SUN mode, the procedure is analogous, but now involving Gaussian perturbations to each of the $N$ complex components of an SU(N) coherent state.

In the limit of very large magnitude, this function coincides with propose_uniform.

Consider also Langevin sampling, which is rejection free.

source
Sunny.propose_flipFunction
propose_flip

Function to propose pure spin flip updates in the context of a LocalSampler. Dipoles are flipped as $𝐒 → -𝐒$. SU(N) coherent states are flipped using the time-reversal operator.

source
Sunny.propose_uniformFunction
propose_uniform

Function to propose a uniformly random spin update in the context of a LocalSampler. In :dipole mode, the result is a random three-vector with appropriate normalization. In :SUN mode, the result is a random SU(N) coherent state with appropriate normalization.

For low-temperature Monte Carlo simulations, uniform spin proposals can be very inefficient due to a high probability of rejection in the Metropolis accept/reject step. Consider also Langevin sampling, which is rejection free.

source
Sunny.q_space_gridFunction
q_space_grid(cryst::Crystal, axis1, range1, axis2, range2; offset=[0,0,0], orthogonalize=false)
+q_space_grid(cryst::Crystal, axis1, range1, axis2, range2, axis3, range3; orthogonalize=false)

Returns a 2D or 3D grid of q-points with uniform spacing. The volume shape is defined by (axis1, axis2, ...) in reciprocal lattice units (RLU). Elements of (range1, range2, ...) provide coefficients $c_i$ used to define grid positions,

    offset + c1 * axis1 + c2 * axis2 + ...

A nonzero offset is allowed only in the 2D case.

The first range parameter, range1, must be a regularly spaced list of coefficients, e.g., range1 = range(lo1, hi1, n). Subsequent range parameters may be a pair of bounds, without grid spacing information. For example, by selecting range2 = (lo2, hi2), an appropriate step-size will be inferred to provide an approximately uniform sampling density in global Cartesian coordinates.

The axes may be non-orthogonal. To extend to an orthohombic volume in global Cartesian coordinates, set orthogonalize=true.

For a 1D grid, use q_space_path instead.

source
Sunny.q_space_pathFunction
q_space_path(cryst::Crystal, qs, n; labels=nothing)

Returns a 1D path consisting of n wavevectors sampled piecewise-linearly between the points in qs. Although the qs are provided in reciprocal lattice units (RLU), consecutive samples are spaced uniformly in the global (inverse-length) Cartesian coordinate system. Optional labels can be associated with each special q-point, and will be used in plotting functions.

See also q_space_grid.

source
Sunny.reference_bondsFunction
reference_bonds(cryst::Crystal, max_dist)

Returns a full list of bonds, one for each symmetry equivalence class, up to distance max_dist. The reference bond b for each equivalence class is selected according to a scoring system that prioritizes simplification of the elements in basis_for_symmetry_allowed_couplings(cryst, b).

source
Sunny.remove_periodicity!Function
remove_periodicity!(sys::System, flags)

Remove periodic interactions along each dimension d if flags[d] is true. The system must support inhomogeneous interactions via to_inhomogeneous.

Example

# Remove periodic boundaries along the 1st and 3rd dimensions
+remove_periodicity!(sys::System, (true, false, true))
source
Sunny.repeat_periodically_as_spiralFunction
repeat_periodically_as_spiral(sys::System, counts::NTuple{3, Int}; k, axis)

Repeats the magnetic cell of System a number of times along each system axis according to the specified counts. Spins in each system image will be rotated according to the propagation wavevector k (in RLU) and the rotation axis (in global Cartesian coordinates). Coincides with repeat_periodically in the special case of k = [0, 0, 0]

See also minimize_spiral_energy! to find an energy-minimizing wavevector k and spin dipole configuration.

Example

k = minimize_spiral_energy!(sys, axis; k_guess=randn(3))
+repeat_periodically_as_spiral(sys, counts; k, axis)
source
Sunny.reshape_supercellFunction
reshape_supercell(sys::System, shape)

Maps an existing System to a new one that has the shape and periodicity of a requested supercell. The columns of the $3×3$ integer matrix shape represent the supercell lattice vectors measured in units of the original crystal lattice vectors. Interactions, spins, and other settings will be inherited from sys.

In the special case that shape is a diagonal matrix, this function coincides with resize_supercell.

See also repeat_periodically.

source
Sunny.resize_supercellFunction
resize_supercell(sys::System, dims::NTuple{3, Int})

Creates a System with a given number of conventional unit cells in each lattice vector direction. Interactions, spins, and other settings will be inherited from sys.

Equivalent to:

reshape_supercell(sys, [dims[1] 0 0; 0 dims[2] 0; 0 0 dims[3]])

See also reshape_supercell and repeat_periodically.

source
Sunny.rotate_operatorFunction
rotate_operator(A, R)

Rotates the local quantum operator A according to the $3×3$ rotation matrix R.

source
Sunny.set_coherent!Function
set_coherent!(sys::System, Z, site::Site)

Set a coherent spin state at a Site using the $N$ complex amplitudes in Z.

For a single quantum spin-$s$, these amplitudes will be interpreted in the eigenbasis of $Ŝ^z$. That is, Z[1] represents the amplitude for the basis state fully polarized along the $ẑ$-direction, and subsequent components represent states with decreasing angular momentum along this axis ($m = s, s-1, …, -s$).

source
Sunny.set_dipoles_from_mcif!Function
set_dipoles_from_mcif!(sys::System, filename::AbstractString)

Load the magnetic supercell according to an mCIF file. System sys must already be resized to the correct supercell dimensions.

source
Sunny.set_exchange!Function
set_exchange!(sys::System, J, bond::Bond; biquad=0)

Sets an exchange interaction $𝐒_i⋅J 𝐒_j$ along the specified bond. This interaction will be propagated to equivalent bonds in consistency with crystal symmetry. Any previous interactions on these bonds will be overwritten. The parameter bond has the form Bond(i, j, offset), where i and j are atom indices within the unit cell, and offset is a displacement in unit cells.

As a convenience, scalar J can be used to specify a Heisenberg interaction. Also, the function dmvec(D) can be used to construct the antisymmetric part of the exchange, where D is the Dzyaloshinskii-Moriya pseudo-vector. The resulting interaction will be $𝐃⋅(𝐒_i×𝐒_j)$.

The optional numeric parameter biquad multiplies a scalar biquadratic interaction, $(𝐒_i⋅𝐒_j)^2$, with Interaction Renormalization if appropriate. For more general interactions, use set_pair_coupling! instead.

Examples

using LinearAlgebra
 
 # Set a Heisenberg and DM interaction: 2Si⋅Sj + D⋅(Si×Sj)
 D = [0, 0, 3]
@@ -99,9 +99,9 @@
 J = [2 3 0;
     -3 2 0;
      0 0 2]
-set_exchange!(sys, J, bond)
source
Sunny.set_exchange_at!Function
set_exchange_at!(sys::System, J, site1::Site, site2::Site; biquad=0, offset=nothing)

Sets an exchange interaction `𝐒_i⋅J 𝐒_j along the single bond connecting two Sites, ignoring crystal symmetry. Any previous coupling on this bond will be overwritten. The system must support inhomogeneous interactions via to_inhomogeneous.

Use symmetry_equivalent_bonds to find (site1, site2, offset) values that would be symmetry equivalent to a given Bond in a homogeneous system. For smaller systems, the offset vector (in multiples of unit cells) will resolve ambiguities in the periodic wrapping.

See also set_exchange! for more details on specifying J and biquad. For more general couplings, use set_pair_coupling_at! instead.

source
Sunny.set_field!Function
set_field!(sys::System, B_μB)

Sets the external magnetic field $𝐁$ scaled by the Bohr magneton $μ_B$. This scaled field has units of energy and couples directly to the dimensionless magnetic_moment. At every site, the Zeeman coupling contributes an energy $+ (𝐁 μ_B) ⋅ (g 𝐒)$, involving the local $g$-tensor and spin angular momentum $𝐒$. Commonly, $g ≈ +2$ such that $𝐒$ is favored to anti-align with the applied field $𝐁$. Note that a given system of Units will implicitly use the Bohr magneton to convert between field and energy dimensions.

Example

# In units of meV, apply a 2 tesla field in the z-direction
+set_exchange!(sys, J, bond)
source
Sunny.set_exchange_at!Function
set_exchange_at!(sys::System, J, site1::Site, site2::Site; biquad=0, offset=nothing)

Sets an exchange interaction `𝐒_i⋅J 𝐒_j along the single bond connecting two Sites, ignoring crystal symmetry. Any previous coupling on this bond will be overwritten. The system must support inhomogeneous interactions via to_inhomogeneous.

Use symmetry_equivalent_bonds to find (site1, site2, offset) values that would be symmetry equivalent to a given Bond in a homogeneous system. For smaller systems, the offset vector (in multiples of unit cells) will resolve ambiguities in the periodic wrapping.

See also set_exchange! for more details on specifying J and biquad. For more general couplings, use set_pair_coupling_at! instead.

source
Sunny.set_field!Function
set_field!(sys::System, B_μB)

Sets the external magnetic field $𝐁$ scaled by the Bohr magneton $μ_B$. This scaled field has units of energy and couples directly to the dimensionless magnetic_moment. At every site, the Zeeman coupling contributes an energy $+ (𝐁 μ_B) ⋅ (g 𝐒)$, involving the local $g$-tensor and spin angular momentum $𝐒$. Commonly, $g ≈ +2$ such that $𝐒$ is favored to anti-align with the applied field $𝐁$. Note that a given system of Units will implicitly use the Bohr magneton to convert between field and energy dimensions.

Example

# In units of meV, apply a 2 tesla field in the z-direction
 units = Units(:meV, :angstrom)
-set_field!(sys, [0, 0, 2] * units.T)
source
Sunny.set_field_at!Function
set_field_at!(sys::System, B_μB, site::Site)

Sets the external magnetic field $𝐁$ scaled by the Bohr magneton $μ_B$ for a single Site. This scaled field has units of energy and couples directly to the dimensionless magnetic_moment. Note that a given system of Units will implicitly use the Bohr magneton to convert between field and energy dimensions.

See the documentation of set_field! for more information.

source
Sunny.set_onsite_coupling!Function
set_onsite_coupling!(sys::System, op, i::Int)

Set the single-ion anisotropy for the ith atom of every unit cell, as well as all symmetry-equivalent atoms. The operator op may be provided as an abstract function of the local spin operators, as a polynomial of spin_matrices, or as a linear combination of stevens_matrices.

Examples

# An easy axis anisotropy in the z-direction
+set_field!(sys, [0, 0, 2] * units.T)
source
Sunny.set_field_at!Function
set_field_at!(sys::System, B_μB, site::Site)

Sets the external magnetic field $𝐁$ scaled by the Bohr magneton $μ_B$ for a single Site. This scaled field has units of energy and couples directly to the dimensionless magnetic_moment. Note that a given system of Units will implicitly use the Bohr magneton to convert between field and energy dimensions.

See the documentation of set_field! for more information.

source
Sunny.set_onsite_coupling!Function
set_onsite_coupling!(sys::System, op, i::Int)

Set the single-ion anisotropy for the ith atom of every unit cell, as well as all symmetry-equivalent atoms. The operator op may be provided as an abstract function of the local spin operators, as a polynomial of spin_matrices, or as a linear combination of stevens_matrices.

Examples

# An easy axis anisotropy in the z-direction
 set_onsite_coupling!(sys, S -> -D*S[3]^3, i)
 
 # The unique quartic single-ion anisotropy for a site with cubic point group
@@ -110,35 +110,35 @@
 
 # An equivalent expression of this quartic anisotropy, up to a constant shift
 O = stevens_matrices(spin_label(sys, i))
-set_onsite_coupling!(sys, O[4,0] + 5*O[4,4], i)
Limitations arising from quantum spin operators

Single-ion anisotropy is physically impossible for local moments with quantum spin $s = 1/2$. Consider, for example, that any Pauli matrix squared gives the identity. More generally, one can verify that the $k$th order Stevens operators O[k, q] are zero whenever $s < k/2$. Consequently, an anisotropy quartic in the spin operators requires $s ≥ 2$ and an anisotropy of sixth order requires $s ≥ 3$. To circumvent this physical limitation, Sunny provides a mode :dipole_uncorrected that naïvely replaces quantum spin operators with classical moments. See the documentation page Interaction Renormalization for more information.

source
Sunny.set_pair_coupling!Function
set_pair_coupling!(sys::System, op, bond)

Sets an arbitrary coupling op along bond. This coupling will be propagated to equivalent bonds in consistency with crystal symmetry. Any previous interactions on these bonds will be overwritten. The parameter bond has the form Bond(i, j, offset), where i and j are atom indices within the unit cell, and offset is a displacement in unit cells. The operator op may be provided as an anonymous function that accepts two spin dipole operators, or as a matrix that acts in the tensor product space of the two sites.

Examples

# Bilinear+biquadratic exchange involving 3×3 matrices J1 and J2
+set_onsite_coupling!(sys, O[4,0] + 5*O[4,4], i)
Limitations arising from quantum spin operators

Single-ion anisotropy is physically impossible for local moments with quantum spin $s = 1/2$. Consider, for example, that any Pauli matrix squared gives the identity. More generally, one can verify that the $k$th order Stevens operators O[k, q] are zero whenever $s < k/2$. Consequently, an anisotropy quartic in the spin operators requires $s ≥ 2$ and an anisotropy of sixth order requires $s ≥ 3$. To circumvent this physical limitation, Sunny provides a mode :dipole_uncorrected that naïvely replaces quantum spin operators with classical moments. See the documentation page Interaction Renormalization for more information.

source
Sunny.set_pair_coupling!Function
set_pair_coupling!(sys::System, op, bond)

Sets an arbitrary coupling op along bond. This coupling will be propagated to equivalent bonds in consistency with crystal symmetry. Any previous interactions on these bonds will be overwritten. The parameter bond has the form Bond(i, j, offset), where i and j are atom indices within the unit cell, and offset is a displacement in unit cells. The operator op may be provided as an anonymous function that accepts two spin dipole operators, or as a matrix that acts in the tensor product space of the two sites.

Examples

# Bilinear+biquadratic exchange involving 3×3 matrices J1 and J2
 set_pair_coupling!(sys, (Si, Sj) -> Si'*J1*Sj + (Si'*J2*Sj)^2, bond)
 
 # Equivalent expression using an appropriate fixed matrix representation
 S = spin_matrices(1/2)
 Si, Sj = to_product_space(S, S)
-set_pair_coupling!(sys, Si'*J1*Sj + (Si'*J2*Sj)^2, bond)

See also spin_matrices, to_product_space.

source
Sunny.set_pair_coupling_at!Function
set_pair_coupling_at!(sys::System, op, site1::Site, site2::Site; offset=nothing)

Sets an arbitrary coupling along the single bond connecting two Sites, ignoring crystal symmetry. Any previous coupling on this bond will be overwritten. The system must support inhomogeneous interactions via to_inhomogeneous.

Use symmetry_equivalent_bonds to find (site1, site2, offset) values that would be symmetry equivalent to a given Bond in a homogeneous system. For smaller systems, the offset vector (in multiples of unit cells) will resolve ambiguities in the periodic wrapping.

The operator op may be provided as an anonymous function that accepts two spin dipole operators, or as a matrix that acts in the tensor product space of the two sites. The documentation for set_pair_coupling! provides examples constructing op.

source
Sunny.set_spin_rescaling!Function
set_spin_rescaling!(sys, α)

In dipole mode, rescale all spin magnitudes $S → α S$. In SU(N) mode, rescale all SU(N) coherent states $Z → √α Z$ such that every expectation value rescales like $⟨A⟩ → α ⟨A⟩$.

source
Sunny.set_vacancy_at!Function
set_vacancy_at!(sys::System, site::Site)

Make a single site nonmagnetic. Site includes a unit cell and a sublattice index.

source
Sunny.spin_labelFunction
spin_label(sys::System, i::Int)

If atom i carries a single spin-$s$ moment, then returns the half-integer label $s$. Otherwise, throws an error.

source
Sunny.spin_matricesFunction
spin_matrices(s)

Returns a triple of $N×N$ spin matrices, where $N = 2s+1$. These are the generators of SU(2) in the spin-s representation.

If s == Inf, then the return values are abstract symbols denoting infinite-dimensional matrices that commute. These can be useful for repeating historical studies, or modeling micromagnetic systems. A technical discussion appears in the Sunny documentation page: Interaction Renormalization.

Example

S = spin_matrices(3/2)
+set_pair_coupling!(sys, Si'*J1*Sj + (Si'*J2*Sj)^2, bond)

See also spin_matrices, to_product_space.

source
Sunny.set_pair_coupling_at!Function
set_pair_coupling_at!(sys::System, op, site1::Site, site2::Site; offset=nothing)

Sets an arbitrary coupling along the single bond connecting two Sites, ignoring crystal symmetry. Any previous coupling on this bond will be overwritten. The system must support inhomogeneous interactions via to_inhomogeneous.

Use symmetry_equivalent_bonds to find (site1, site2, offset) values that would be symmetry equivalent to a given Bond in a homogeneous system. For smaller systems, the offset vector (in multiples of unit cells) will resolve ambiguities in the periodic wrapping.

The operator op may be provided as an anonymous function that accepts two spin dipole operators, or as a matrix that acts in the tensor product space of the two sites. The documentation for set_pair_coupling! provides examples constructing op.

source
Sunny.set_spin_rescaling!Function
set_spin_rescaling!(sys, α)

In dipole mode, rescale all spin magnitudes $S → α S$. In SU(N) mode, rescale all SU(N) coherent states $Z → √α Z$ such that every expectation value rescales like $⟨A⟩ → α ⟨A⟩$.

source
Sunny.set_vacancy_at!Function
set_vacancy_at!(sys::System, site::Site)

Make a single site nonmagnetic. Site includes a unit cell and a sublattice index.

source
Sunny.spin_labelFunction
spin_label(sys::System, i::Int)

If atom i carries a single spin-$s$ moment, then returns the half-integer label $s$. Otherwise, throws an error.

source
Sunny.spin_matricesFunction
spin_matrices(s)

Returns a triple of $N×N$ spin matrices, where $N = 2s+1$. These are the generators of SU(2) in the spin-s representation.

If s == Inf, then the return values are abstract symbols denoting infinite-dimensional matrices that commute. These can be useful for repeating historical studies, or modeling micromagnetic systems. A technical discussion appears in the Sunny documentation page: Interaction Renormalization.

Example

S = spin_matrices(3/2)
 @assert S'*S ≈ (3/2)*(3/2+1)*I
 @assert S[1]*S[2] - S[2]*S[1] ≈ im*S[3]
 
 S = spin_matrices(Inf)
-@assert S[1]*S[2] - S[2]*S[1] == 0

See also print_stevens_expansion.

source
Sunny.spiral_energyFunction
spiral_energy(sys::System; k, axis)

Returns the energy of a generalized spiral phase associated with the propagation wavevector k (in reciprocal lattice units, RLU) and an axis vector that is normal to the polarization plane (in global Cartesian coordinates).

When $𝐤$ is incommensurate, this calculation can be viewed as creating an infinite number of periodic copies of sys. The spins on each periodic copy are rotated about the axis vector, with the angle $θ = 2π 𝐤⋅𝐫$, where 𝐫 denotes the displacement vector between periodic copies of sys in multiples of the lattice vectors of the chemical cell.

The return value is the energy associated with one periodic copy of sys. The special case $𝐤 = 0$ yields result is identical to energy.

See also minimize_spiral_energy! and repeat_periodically_as_spiral.

source
Sunny.ssf_customFunction
ssf_custom(f, sys::System; apply_g=true, formfactors=nothing)

Specify measurement of the spin structure factor with a custom contraction function f. This function accepts a wavevector $𝐪$ in global Cartesian coordinates, and a 3×3 matrix with structure factor intensity components $\mathcal{S}^{αβ}(𝐪,ω)$. Indices $(α, β)$ denote dipole components in global coordinates. The return value of f can be any number or isbits type. With specific choices of f, one can obtain measurements such as defined in ssf_perp and ssf_trace.

By default, the g-factor or tensor is applied at each site, such that the structure factor components are correlations between the magnetic moment operators. Set apply_g = false to measure correlations between the bare spin operators.

The optional formfactors comprise a list of pairs [i1 => FormFactor(...), i2 => ...], where i1, i2, ... are a complete set of symmetry-distinct atoms, and each FormFactor implements $𝐪$-space attenuation for the given atom.

Intended for use with SpinWaveTheory and instances of SampledCorrelations.

Examples

# Measure all 3×3 structure factor components Sᵅᵝ
+@assert S[1]*S[2] - S[2]*S[1] == 0

See also print_stevens_expansion.

source
Sunny.spiral_energyFunction
spiral_energy(sys::System; k, axis)

Returns the energy of a generalized spiral phase associated with the propagation wavevector k (in reciprocal lattice units, RLU) and an axis vector that is normal to the polarization plane (in global Cartesian coordinates).

When $𝐤$ is incommensurate, this calculation can be viewed as creating an infinite number of periodic copies of sys. The spins on each periodic copy are rotated about the axis vector, with the angle $θ = 2π 𝐤⋅𝐫$, where 𝐫 denotes the displacement vector between periodic copies of sys in multiples of the lattice vectors of the chemical cell.

The return value is the energy associated with one periodic copy of sys. The special case $𝐤 = 0$ yields result is identical to energy.

See also minimize_spiral_energy! and repeat_periodically_as_spiral.

source
Sunny.ssf_customFunction
ssf_custom(f, sys::System; apply_g=true, formfactors=nothing)

Specify measurement of the spin structure factor with a custom contraction function f. This function accepts a wavevector $𝐪$ in global Cartesian coordinates, and a 3×3 matrix with structure factor intensity components $\mathcal{S}^{αβ}(𝐪,ω)$. Indices $(α, β)$ denote dipole components in global coordinates. The return value of f can be any number or isbits type. With specific choices of f, one can obtain measurements such as defined in ssf_perp and ssf_trace.

By default, the g-factor or tensor is applied at each site, such that the structure factor components are correlations between the magnetic moment operators. Set apply_g = false to measure correlations between the bare spin operators.

The optional formfactors comprise a list of pairs [i1 => FormFactor(...), i2 => ...], where i1, i2, ... are a complete set of symmetry-distinct atoms, and each FormFactor implements $𝐪$-space attenuation for the given atom.

Intended for use with SpinWaveTheory and instances of SampledCorrelations.

Examples

# Measure all 3×3 structure factor components Sᵅᵝ
 measure = ssf_custom((q, ssf) -> ssf, sys)
 
 # Measure the structure factor trace Sᵅᵅ
-measure = ssf_custom((q, ssf) -> real(sum(ssf)), sys)

See also the Sunny documentation on Structure Factor Conventions.

source
Sunny.ssf_custom_bmFunction
ssf_custom_bm(f, sys::System; u, v, apply_g=true, formfactors=nothing)

Specify measurement of the spin structure factor with a custom contraction function f. The interface is identical to ssf_custom except that f here receives momentum $𝐪$ and the 3×3 structure factor data $\mathcal{S}^{αβ}(𝐪, ω)$ in the basis of the Blume-Maleev axis system. The wavevectors u and v, provided in reciprocal lattice units, will be used to define the scattering plane. In global Cartesian coordinates, the three orthonormal BM axes (e1, e2, e3) are defined as follows:

e3 = normalize(u × v)  # normal to the scattering plane (u, v)
+measure = ssf_custom((q, ssf) -> real(sum(ssf)), sys)

See also the Sunny documentation on Structure Factor Conventions.

source
Sunny.ssf_custom_bmFunction
ssf_custom_bm(f, sys::System; u, v, apply_g=true, formfactors=nothing)

Specify measurement of the spin structure factor with a custom contraction function f. The interface is identical to ssf_custom except that f here receives momentum $𝐪$ and the 3×3 structure factor data $\mathcal{S}^{αβ}(𝐪, ω)$ in the basis of the Blume-Maleev axis system. The wavevectors u and v, provided in reciprocal lattice units, will be used to define the scattering plane. In global Cartesian coordinates, the three orthonormal BM axes (e1, e2, e3) are defined as follows:

e3 = normalize(u × v)  # normal to the scattering plane (u, v)
 e1 = normalize(q)      # momentum transfer q within scattering plane
 e2 = normalize(e3 × q) # perpendicular to q and in the scattering plane

Example

# Measure imaginary part of S²³ - S³² in the Blume-Maleev axis system for
 # the scattering plane [0, K, L].
 measure = ssf_custom_bm(sys; u=[0, 1, 0], v=[0, 0, 1]) do q, ssf
     imag(ssf[2,3] - ssf[3,2])
-end
source
Sunny.ssf_perpFunction
ssf_perp(sys::System; apply_g=true, formfactors=nothing)

Specify measurement of the spin structure factor with contraction by $(I-𝐪⊗𝐪/q^2)$. The contracted value provides an estimate of unpolarized scattering intensity. In the singular limit $𝐪 → 0$, the contraction matrix is replaced by its rotational average, $(2/3) I$.

This function is a special case of ssf_custom.

Example

# Select Co²⁺ form factor for atom 1 and its symmetry equivalents
+end
source
Sunny.ssf_perpFunction
ssf_perp(sys::System; apply_g=true, formfactors=nothing)

Specify measurement of the spin structure factor with contraction by $(I-𝐪⊗𝐪/q^2)$. The contracted value provides an estimate of unpolarized scattering intensity. In the singular limit $𝐪 → 0$, the contraction matrix is replaced by its rotational average, $(2/3) I$.

This function is a special case of ssf_custom.

Example

# Select Co²⁺ form factor for atom 1 and its symmetry equivalents
 formfactors = [1 => FormFactor("Co2")]
-ssf_perp(sys; formfactors)
source
Sunny.ssf_traceFunction
ssf_trace(sys::System; apply_g=true, formfactors=nothing)

Specify measurement of the spin structure factor, with trace over spin components. This quantity can be useful for checking quantum sum rules.

This function is a special case of ssf_custom.

source
Sunny.standardizeFunction
standardize(cryst::Crystal; idealize=true)

Return the symmetry-inferred standardized crystal unit cell. If idealize=true, then the lattice vectors and site positions will be adapted. See "definitions and conventions" of the spglib documentation for more information.

source
Sunny.step!Function
step!(sys::System, dynamics)

Advance the spin configuration one dynamical time-step. The dynamics object may be a continuous spin dynamics, such as Langevin or ImplicitMidpoint, or it may be a discrete Monte Carlo sampling scheme such as LocalSampler.

source
Sunny.stevens_matricesFunction
stevens_matrices(s)

Returns the Stevens operators in the spin-s representation. The return value O can be indexed as O[k,q], where $0 ≤ k ≤ 6$ labels an irrep of SO(3) and $-k ≤ q ≤ k$. This will produce an $N×N$ matrix where $N = 2s + 1$. Linear combinations of Stevens operators can be used as a "physical basis" for decomposing local observables. To see this decomposition, use print_stevens_expansion.

If s == Inf, then symbolic operators will be returned. In this infinite dimensional representation, the Stevens operators become homogeneous polynomials of commuting spin operators.

Example

O = stevens_matrices(2)
+ssf_perp(sys; formfactors)
source
Sunny.ssf_traceFunction
ssf_trace(sys::System; apply_g=true, formfactors=nothing)

Specify measurement of the spin structure factor, with trace over spin components. This quantity can be useful for checking quantum sum rules.

This function is a special case of ssf_custom.

source
Sunny.standardizeFunction
standardize(cryst::Crystal; idealize=true)

Return the symmetry-inferred standardized crystal unit cell. If idealize=true, then the lattice vectors and site positions will be adapted. See "definitions and conventions" of the spglib documentation for more information.

source
Sunny.step!Function
step!(sys::System, dynamics)

Advance the spin configuration one dynamical time-step. The dynamics object may be a continuous spin dynamics, such as Langevin or ImplicitMidpoint, or it may be a discrete Monte Carlo sampling scheme such as LocalSampler.

source
Sunny.stevens_matricesFunction
stevens_matrices(s)

Returns the Stevens operators in the spin-s representation. The return value O can be indexed as O[k,q], where $0 ≤ k ≤ 6$ labels an irrep of SO(3) and $-k ≤ q ≤ k$. This will produce an $N×N$ matrix where $N = 2s + 1$. Linear combinations of Stevens operators can be used as a "physical basis" for decomposing local observables. To see this decomposition, use print_stevens_expansion.

If s == Inf, then symbolic operators will be returned. In this infinite dimensional representation, the Stevens operators become homogeneous polynomials of commuting spin operators.

Example

O = stevens_matrices(2)
 S = spin_matrices(2)
 
 A = (1/20)O[4,0] + (1/4)O[4,4] + (102/5)I
 B = S[1]^4 + S[2]^4 + S[3]^4
-@assert A ≈ B

See also spin_matrices and Interaction Renormalization.

source
Sunny.subcrystalFunction
subcrystal(cryst, types) :: Crystal

Filters sublattices of a Crystal by atom types, keeping the space group unchanged.

subcrystal(cryst, classes) :: Crystal

Filters sublattices of Crystal by equivalence classes, keeping the space group unchanged.

source
Sunny.suggest_magnetic_supercellFunction
suggest_magnetic_supercell(ks; tol=1e-12, maxsize=100)

Suggests a magnetic supercell, in units of the crystal lattice vectors, that is consistent with periodicity of the wavevectors ks in RLU. If the wavevectors are incommensurate (with respect to the maximum supercell size maxsize), one can select a larger error tolerance tol to find a supercell that is almost commensurate.

Prints a $3×3$ matrix of integers that is suitable for use in reshape_supercell.

Examples

# A magnetic supercell for a single-Q structure. Will print
+@assert A ≈ B

See also spin_matrices and Interaction Renormalization.

source
Sunny.subcrystalFunction
subcrystal(cryst, types) :: Crystal

Filters sublattices of a Crystal by atom types, keeping the space group unchanged.

subcrystal(cryst, classes) :: Crystal

Filters sublattices of Crystal by equivalence classes, keeping the space group unchanged.

source
Sunny.suggest_magnetic_supercellFunction
suggest_magnetic_supercell(ks; tol=1e-12, maxsize=100)

Suggests a magnetic supercell, in units of the crystal lattice vectors, that is consistent with periodicity of the wavevectors ks in RLU. If the wavevectors are incommensurate (with respect to the maximum supercell size maxsize), one can select a larger error tolerance tol to find a supercell that is almost commensurate.

Prints a $3×3$ matrix of integers that is suitable for use in reshape_supercell.

Examples

# A magnetic supercell for a single-Q structure. Will print
 k1 = [0, -1/4, 1/4]
 suggest_magnetic_supercell([k1])       # [1 0 0; 0 2 1; 0 -2 1]
 
@@ -151,13 +151,13 @@
 suggest_magnetic_supercell([[0, 0, 1/√5], [0, 0, 1/√7]]; tol=1e-2)
 
 # This prints [1 0 0; 0 1 0; 0 0 16], which becomes commensurate under the
-# approximations `1/√5 ≈ 7/16` and `1/√7 ≈ 3/8`.
source
Sunny.suggest_timestepFunction
suggest_timestep(sys, integrator; tol)

Suggests a timestep for the numerical integration of spin dynamics according to a given error tolerance tol. The integrator should be Langevin or ImplicitMidpoint. The suggested $dt$ will be inversely proportional to the magnitude of the effective field $|dE/d𝐒|$ arising from the current spin configuration in sys. The recommended timestep $dt$ scales like √tol, which assumes second-order accuracy of the integrator.

The system sys should be initialized to an equilibrium spin configuration for the target temperature. Alternatively, a reasonably timestep estimate can be obtained from any low-energy spin configuration. For this, one can use randomize_spins! and then minimize_energy!.

Large damping magnitude or target temperature kT will tighten the timestep bound. If damping exceeds 1, it will rescale the suggested timestep by an approximate the factor $1/damping$. If kT is the largest energy scale, then the suggested timestep will scale like 1/(damping*kT). Quantification of numerical error for stochastic dynamics is subtle. The stochastic Heun integration scheme is weakly convergent of order-1, such that errors in the estimates of averaged observables may scale like dt. This implies that the tol argument may actually scale like the square of the true numerical error, and should be selected with this in mind.

source
Sunny.symmetry_equivalent_bondsFunction
symmetry_equivalent_bonds(sys::System, bond::Bond)

Given a Bond for the original (unreshaped) crystal, return all symmetry equivalent bonds in the System. Each returned bond is represented as a pair of Sites and an offset, which may be used as input to set_exchange_at! or set_pair_coupling_at!. Reverse bonds are not included in the iterator (no double counting).

Example

for (site1, site2, offset) in symmetry_equivalent_bonds(sys, bond)
+# approximations `1/√5 ≈ 7/16` and `1/√7 ≈ 3/8`.
source
Sunny.suggest_timestepFunction
suggest_timestep(sys, integrator; tol)

Suggests a timestep for the numerical integration of spin dynamics according to a given error tolerance tol. The integrator should be Langevin or ImplicitMidpoint. The suggested $dt$ will be inversely proportional to the magnitude of the effective field $|dE/d𝐒|$ arising from the current spin configuration in sys. The recommended timestep $dt$ scales like √tol, which assumes second-order accuracy of the integrator.

The system sys should be initialized to an equilibrium spin configuration for the target temperature. Alternatively, a reasonably timestep estimate can be obtained from any low-energy spin configuration. For this, one can use randomize_spins! and then minimize_energy!.

Large damping magnitude or target temperature kT will tighten the timestep bound. If damping exceeds 1, it will rescale the suggested timestep by an approximate the factor $1/damping$. If kT is the largest energy scale, then the suggested timestep will scale like 1/(damping*kT). Quantification of numerical error for stochastic dynamics is subtle. The stochastic Heun integration scheme is weakly convergent of order-1, such that errors in the estimates of averaged observables may scale like dt. This implies that the tol argument may actually scale like the square of the true numerical error, and should be selected with this in mind.

source
Sunny.symmetry_equivalent_bondsFunction
symmetry_equivalent_bonds(sys::System, bond::Bond)

Given a Bond for the original (unreshaped) crystal, return all symmetry equivalent bonds in the System. Each returned bond is represented as a pair of Sites and an offset, which may be used as input to set_exchange_at! or set_pair_coupling_at!. Reverse bonds are not included in the iterator (no double counting).

Example

for (site1, site2, offset) in symmetry_equivalent_bonds(sys, bond)
     @assert site1 < site2
     set_exchange_at!(sys, J, site1, site2; offset)
-end
source
Sunny.to_product_spaceFunction
to_product_space(A, B, ...)

Given lists of operators acting on local Hilbert spaces individually, return the corresponding operators that act on the tensor product space. In typical usage, the inputs will represent local physical observables and the outputs will be used to define quantum couplings.

source
Sunny.@mix_proposalsMacro
@mix_proposals weight1 propose1 weight2 propose2 ...

Macro to generate a proposal function that randomly selects among the provided functions according to the provided probability weights. For use with LocalSampler.

Example

# A proposal function that proposes a spin flip 40% of the time, and a
+end
source
Sunny.to_product_spaceFunction
to_product_space(A, B, ...)

Given lists of operators acting on local Hilbert spaces individually, return the corresponding operators that act on the tensor product space. In typical usage, the inputs will represent local physical observables and the outputs will be used to define quantum couplings.

source
Sunny.@mix_proposalsMacro
@mix_proposals weight1 propose1 weight2 propose2 ...

Macro to generate a proposal function that randomly selects among the provided functions according to the provided probability weights. For use with LocalSampler.

Example

# A proposal function that proposes a spin flip 40% of the time, and a
 # Gaussian perturbation 60% of the time.
-@mix_proposals 0.4 propose_flip 0.6 propose_delta(0.2)
source

Optional Makie extensions

Load a Makie graphics package (GLMakie, WGLMakie, or CairoMakie) to enable the following extensions:

Sunny.view_bzFunction
view_bz(crystal::Crystal, objs...; orthographic=false, compass=true)

Experimental

Launches a graphical user interface to visualize reciprocal space with respect to the Crystal unit cell. The first Brilliouin zone for the primitive lattice is shown as a convex polyhedron. High-symmetry points and paths between them are inspectable, consistent with the data in print_irreducible_bz_paths. Additional objs may be passed, e.g., to visualize custom paths or grids in reciprocal space.

  • orthographic: Use orthographic camera perspective.
  • compass: If true, draw Cartesian axes in bottom left.
source
Sunny.view_crystalFunction
view_crystal(crystal::Crystal; refbonds=10, orthographic=false, ghost_radius=nothing, ndims=3, compass=true)
-view_crystal(sys::System; ...)

Launches a graphical user interface to visualize the Crystal unit cell. If a System is provided, then the 3×3 exchange matrices for each bond will be depicted graphically.

  • refbonds: By default, calculate up to 10 reference bonds using the reference_bonds function. An explicit list of reference bonds may also be provided.
  • orthographic: Use orthographic camera perspective.
  • ghost_radius: Show periodic images up to a given distance. Defaults to the cell size.
  • ndims: Spatial dimensions of system (1, 2, or 3).
  • compass: If true, draw Cartesian axes in bottom left.
source
Sunny.plot_intensitiesFunction
plot_intensities(res::BandIntensities; colormap=nothing, colorrange=nothing, allpositive=true,
+@mix_proposals 0.4 propose_flip 0.6 propose_delta(0.2)
source

Optional Makie extensions

Load a Makie graphics package (GLMakie, WGLMakie, or CairoMakie) to enable the following extensions:

Sunny.view_bzFunction
view_bz(crystal::Crystal, objs...; orthographic=false, compass=true)

Experimental

Launches a graphical user interface to visualize reciprocal space with respect to the Crystal unit cell. The first Brilliouin zone for the primitive lattice is shown as a convex polyhedron. High-symmetry points and paths between them are inspectable, consistent with the data in print_irreducible_bz_paths. Additional objs may be passed, e.g., to visualize custom paths or grids in reciprocal space.

  • orthographic: Use orthographic camera perspective.
  • compass: If true, draw Cartesian axes in bottom left.
source
Sunny.view_crystalFunction
view_crystal(crystal::Crystal; refbonds=10, orthographic=false, ghost_radius=nothing, ndims=3, compass=true)
+view_crystal(sys::System; ...)

Launches a graphical user interface to visualize the Crystal unit cell. If a System is provided, then the 3×3 exchange matrices for each bond will be depicted graphically.

  • refbonds: By default, calculate up to 10 reference bonds using the reference_bonds function. An explicit list of reference bonds may also be provided.
  • orthographic: Use orthographic camera perspective.
  • ghost_radius: Show periodic images up to a given distance. Defaults to the cell size.
  • ndims: Spatial dimensions of system (1, 2, or 3).
  • compass: If true, draw Cartesian axes in bottom left.
source
Sunny.plot_intensitiesFunction
plot_intensities(res::BandIntensities; colormap=nothing, colorrange=nothing, allpositive=true,
                  saturation=0.9, sensitivity=0.0025, fwhm=nothing, ylims=nothing, units=nothing,
                  into=nothing, title="")
 plot_intensities(res::Intensities; colormap=nothing, colorrange=nothing, allpositive=true, 
@@ -165,12 +165,12 @@
 plot_intensities(res::StaticIntensities; colormap=nothing, colorrange=nothing, allpositive=true, 
                  saturation=0.9, units=nothing, into=nothing, title="")
 plot_intensities(res::PowderIntensities; colormap=nothing, colorrange=nothing, allpositive=true, 
-                 saturation=0.9, units=nothing, into=nothing, title="")

Keyword arguments:

  • colormap: Color palette for plotting broadened intensities. See Makie docs for allowed values.
  • colorrange: A lower and upper bound on intensities. For heatmaps, these bounds define the intensity values that saturate the colormap.
  • allpositive: Should intensities be all positive, apart from numerical error? If true, the default colors will clip below zero intensity. If false, the default colors will be symmetric about zero intensity.
  • saturation: If colorrange is not explicitly set, this dimensionless parameter defines the upper saturated intensity value as a quantile of maximum intensities taken over wavevectors.
  • sensitivity: When plotting BandIntensities, this defines a lower bound on the visible intensities as a fraction of the upper saturated intensity value.
  • fwhm: When plotting BandIntensities, this overrides the full-width at half-maximum value used for Gaussian broadening.
  • ylims: Limits of the y-axis.
  • units: A Units instance for labeling axes and performing conversions.
  • into: A symbol for conversion into a new base energy unit (e.g. :meV, :K, etc.)
  • title: An optional title for the plot.
source
Sunny.plot_intensities!Function
plot_intensities!(panel, res::AbstractIntensities; opts...)

Mutating variant of plot_intensities that allows drawing into a single panel of a Makie figure.

Example

fig = Figure()
+                 saturation=0.9, units=nothing, into=nothing, title="")

Keyword arguments:

  • colormap: Color palette for plotting broadened intensities. See Makie docs for allowed values.
  • colorrange: A lower and upper bound on intensities. For heatmaps, these bounds define the intensity values that saturate the colormap.
  • allpositive: Should intensities be all positive, apart from numerical error? If true, the default colors will clip below zero intensity. If false, the default colors will be symmetric about zero intensity.
  • saturation: If colorrange is not explicitly set, this dimensionless parameter defines the upper saturated intensity value as a quantile of maximum intensities taken over wavevectors.
  • sensitivity: When plotting BandIntensities, this defines a lower bound on the visible intensities as a fraction of the upper saturated intensity value.
  • fwhm: When plotting BandIntensities, this overrides the full-width at half-maximum value used for Gaussian broadening.
  • ylims: Limits of the y-axis.
  • units: A Units instance for labeling axes and performing conversions.
  • into: A symbol for conversion into a new base energy unit (e.g. :meV, :K, etc.)
  • title: An optional title for the plot.
source
Sunny.plot_intensities!Function
plot_intensities!(panel, res::AbstractIntensities; opts...)

Mutating variant of plot_intensities that allows drawing into a single panel of a Makie figure.

Example

fig = Figure()
 plot_intensities!(fig[1, 1], res1; title="Panel 1")
 plot_intensities!(fig[2, 1], res2; title="Panel 2")
-display(fig)
source
Sunny.plot_spinsFunction
plot_spins(sys::System; arrowscale=1.0, color=:red, colorfn=nothing,
+display(fig)
source
Sunny.plot_spinsFunction
plot_spins(sys::System; arrowscale=1.0, color=:red, colorfn=nothing,
            colormap=:viridis, colorrange=nothing, show_cell=true, orthographic=false,
-           ghost_radius=0, ndims=3, compass=true)

Plot the spin configuration defined by sys. Optional parameters are:

  • arrowscale: Scale all arrows by dimensionless factor.
  • color: Arrow colors. May be symbolic or numeric. If scalar, will be shared among all sites.
  • colorfn: Function that dynamically maps from a site index to a numeric color value. Useful for animations.
  • colormap, colorrange: Used to populate colors from numbers following Makie conventions.
  • show_cell: Show original crystallographic unit cell.
  • orthographic: Use orthographic camera perspective.
  • ghost_radius: Show periodic images up to a given distance (length units).
  • ndims: Spatial dimensions of system (1, 2, or 3).
  • compass: If true, draw Cartesian axes in bottom left.

Calling notify on the return value will animate the figure.

source
Sunny.plot_spins!Function
plot_spins!(ax, sys::System; opts...)

Mutating variant of plot_spins that allows drawing into a single panel of a Makie figure.

Example

fig = Figure()
+           ghost_radius=0, ndims=3, compass=true)

Plot the spin configuration defined by sys. Optional parameters are:

  • arrowscale: Scale all arrows by dimensionless factor.
  • color: Arrow colors. May be symbolic or numeric. If scalar, will be shared among all sites.
  • colorfn: Function that dynamically maps from a site index to a numeric color value. Useful for animations.
  • colormap, colorrange: Used to populate colors from numbers following Makie conventions.
  • show_cell: Show original crystallographic unit cell.
  • orthographic: Use orthographic camera perspective.
  • ghost_radius: Show periodic images up to a given distance (length units).
  • ndims: Spatial dimensions of system (1, 2, or 3).
  • compass: If true, draw Cartesian axes in bottom left.

Calling notify on the return value will animate the figure.

source
Sunny.plot_spins!Function
plot_spins!(ax, sys::System; opts...)

Mutating variant of plot_spins that allows drawing into a single panel of a Makie figure.

Example

fig = Figure()
 plot_spins!(fig[1, 1], sys1)
 plot_spins!(fig[2, 1], sys2)
-display(fig)
source

Optional WriteVTK extensions

Load the WriteVTK package to enable the following extensions:

Sunny.export_vtkFunction
export_vtk(filename,params::BinningParameters,data)

Export a VTK-compatible file to filename (do not include file extension when specifying the file name) which contains the data as VTK Cell Data on a grid parameterized by params.

At least one axis of the BinningParameters must be integrated over, since VTK does not support 4D data. See integrate_axes!.

source
+display(fig)source

Optional WriteVTK extensions

Load the WriteVTK package to enable the following extensions:

Sunny.export_vtkFunction
export_vtk(filename,params::BinningParameters,data)

Export a VTK-compatible file to filename (do not include file extension when specifying the file name) which contains the data as VTK Cell Data on a grid parameterized by params.

At least one axis of the BinningParameters must be integrated over, since VTK does not support 4D data. See integrate_axes!.

source
diff --git a/previews/PR342/objects.inv b/previews/PR342/objects.inv index f3dee3d66c74b0f9dc51da8ec7d12e1b616cc78c..f20aadc1c48727796805e359750464c9b5f65e3e 100644 GIT binary patch delta 12 Tcmdm?vO{HpE2HT~w@-oqAE^Ys delta 12 Tcmdm?vO{HpE2GIqw@-oqAEX4m diff --git a/previews/PR342/parallelism.html b/previews/PR342/parallelism.html index 13d4f399d..63e482090 100644 --- a/previews/PR342/parallelism.html +++ b/previews/PR342/parallelism.html @@ -69,4 +69,4 @@ end return sc -end

Finally, merge the results into a summary SampledCorrelations.

sc = merge_correlations(scs)
+end

Finally, merge the results into a summary SampledCorrelations.

sc = merge_correlations(scs)
diff --git a/previews/PR342/renormalization.html b/previews/PR342/renormalization.html index 67fff0045..9a535c170 100644 --- a/previews/PR342/renormalization.html +++ b/previews/PR342/renormalization.html @@ -49,4 +49,4 @@ \hat{\mathcal{O}}_{6,\pm2} & =\phi_{\pm}(\hat{S}_{+}^{2}\pm\hat{S}_{-}^{2})(33\hat{S}_{z}^{4}-(18X+123)\hat{S}_{z}^{2}+X^{2}+10X+102)+\mathrm{h.c.}\\ \hat{\mathcal{O}}_{6,\pm1} & =\phi_{\pm}(\hat{S}_{+}\pm\hat{S}_{-})(33\hat{S}_{z}^{5}-(30X-15)\hat{S}_{z}^{3}+(5X^{2}-10X+12)\hat{S}_{z})+\mathrm{h.c.}\\ \hat{\mathcal{O}}_{6,0} & =231\hat{S}_{z}^{6}-(315X-735)\hat{S}_{z}^{4}+(105X^{2}-525X+294)\hat{S}_{z}^{2}-5X^{3}+40X^{2}-60X -\end{align*}\]

Computer-generated tables of Stevens operators with $k > 6$ are available from C. Rudowicz and C. Y. Chung, J. Phys.: Condens. Matter 16, 5825 (2004), but these typically do not appear in magnetic simulations.

The case $k=1$ gives the dipole operators,

\[(\hat{\mathcal{O}}_{1,1}, \hat{\mathcal{O}}_{1,0}, \hat{\mathcal{O}}_{1,-1}) = (\hat{S}_{x}, \hat{S}_{z}, \hat{S}_{y}).\]

The case $k=2$ gives the quadrupole operators,

\[(\hat{\mathcal{O}}_{2,2}, \dots, \hat{\mathcal{O}}_{2,-2}) = \left(\hat{S}_x^2 - \hat{S}_y^2, \frac{\hat{S}_x \hat{S}_z + \hat{S}_z \hat{S}_x}{2}, 2\hat{S}_z^2-\hat{S}_x^2-\hat{S}_y^2, \frac{\hat{S}_y \hat{S}_z + \hat{S}_z \hat{S}_y}{2}, \hat{S}_x \hat{S}_y + \hat{S}_y \hat{S}_x\right).\]

For each $k$ value, the set of operators $\hat{\mathcal{O}}_{k,q'}$ for $q' = -k, \dots, k$ form an irreducible representation of the group of rotations O(3). That is, rotation will transform $\hat{\mathcal{O}}_{k,q}$ into a linear combination of $\hat{\mathcal{O}}_{k,q'}$ where $q'$ varies but $k$ remains fixed.

In taking the large-$s$ limit, each dipole operator is replaced by its expectation value $\boldsymbol{\Omega} = \langle \hat{\mathbf{S}} \rangle$, and only leading-order terms are retained. The operator $\hat{\mathcal{O}}_{k,q}$ becomes a homogeneous polynomial $O_{k,q}(\boldsymbol{\Omega})$ of order $k$ in the spin components $\Omega^\alpha$. One can see these polynomials by constructing stevens_matrices with the argument s = Inf. Due to the normalization constraint, each dipole can be expressed in polar angles, $(\theta, \phi)$. Then the Stevens functions $O_{k,q}(\boldsymbol{\Omega})$ correspond to the spherical harmonic functions $Y_l^m(\theta, \phi)$ where $l=k$ and $m=q$; this correspondence is valid up to $k$ and $q$-dependent rescaling factors.

+\end{align*}\]

Computer-generated tables of Stevens operators with $k > 6$ are available from C. Rudowicz and C. Y. Chung, J. Phys.: Condens. Matter 16, 5825 (2004), but these typically do not appear in magnetic simulations.

The case $k=1$ gives the dipole operators,

\[(\hat{\mathcal{O}}_{1,1}, \hat{\mathcal{O}}_{1,0}, \hat{\mathcal{O}}_{1,-1}) = (\hat{S}_{x}, \hat{S}_{z}, \hat{S}_{y}).\]

The case $k=2$ gives the quadrupole operators,

\[(\hat{\mathcal{O}}_{2,2}, \dots, \hat{\mathcal{O}}_{2,-2}) = \left(\hat{S}_x^2 - \hat{S}_y^2, \frac{\hat{S}_x \hat{S}_z + \hat{S}_z \hat{S}_x}{2}, 2\hat{S}_z^2-\hat{S}_x^2-\hat{S}_y^2, \frac{\hat{S}_y \hat{S}_z + \hat{S}_z \hat{S}_y}{2}, \hat{S}_x \hat{S}_y + \hat{S}_y \hat{S}_x\right).\]

For each $k$ value, the set of operators $\hat{\mathcal{O}}_{k,q'}$ for $q' = -k, \dots, k$ form an irreducible representation of the group of rotations O(3). That is, rotation will transform $\hat{\mathcal{O}}_{k,q}$ into a linear combination of $\hat{\mathcal{O}}_{k,q'}$ where $q'$ varies but $k$ remains fixed.

In taking the large-$s$ limit, each dipole operator is replaced by its expectation value $\boldsymbol{\Omega} = \langle \hat{\mathbf{S}} \rangle$, and only leading-order terms are retained. The operator $\hat{\mathcal{O}}_{k,q}$ becomes a homogeneous polynomial $O_{k,q}(\boldsymbol{\Omega})$ of order $k$ in the spin components $\Omega^\alpha$. One can see these polynomials by constructing stevens_matrices with the argument s = Inf. Due to the normalization constraint, each dipole can be expressed in polar angles, $(\theta, \phi)$. Then the Stevens functions $O_{k,q}(\boldsymbol{\Omega})$ correspond to the spherical harmonic functions $Y_l^m(\theta, \phi)$ where $l=k$ and $m=q$; this correspondence is valid up to $k$ and $q$-dependent rescaling factors.

diff --git a/previews/PR342/structure-factor.html b/previews/PR342/structure-factor.html index 0f96c241d..c96cf123f 100644 --- a/previews/PR342/structure-factor.html +++ b/previews/PR342/structure-factor.html @@ -64,4 +64,4 @@ for _ in 1:nsamples decorrelate_system(sys) # Perform some type of Monte Carlo simulation add_sample!(sc, sys) # Use spins to calculate trajectory and accumulate new sample of 𝒮(𝐪,ω) -end

Extracting intensities sampled correlation data

Like in spin wave theory, the basic function for extracting intensities information from a SampledCorrelations is intensities. It takes a SampledCorrelations, a collection of $𝐪$-vectors, a collection of energies, and possible other options.

Since classical dynamics simulation take place on a finite lattice, the fundamental intensities measurements are only available at a discrete grid of wave vectors. In reciprocal lattice units, available grid points are $𝐪 = [\frac{n_1}{L_1}, \frac{n_2}{L_2}, \frac{n_3}{L_3}]$, where $n_i$ runs from $(\frac{-L_i}{2}+1)$ to $\frac{L_i}{2}$ and $L_i$ is the linear dimension of the lattice used in the calculation. (An internal function Sunny.available_wave_vectors provides access to this grid.) By default intensities will adjust each wavevector $𝐪$ to the nearest available grid point.

Similarly, the resolution in energies is controlled the dynamical trajectory length in real-time. Because the dynamical trajectory is not periodic in time, some blurring between neighboring energy bins is unavoidable. Sunny's algorithm for estimating the structure factor from real-time dynamics is specified here.

The temperature parameter kT is required for SampledCorrelations calculations, and will be used to perform classical-to-quantum rescaling of intensities. If kT = nothing, then intensities will be provided according to the classical Boltzmann distribution.

The instantaneous structure factor

Use intensities_static to calculate $\mathcal{S}(𝐪)$, i.e., correlations that are "instantaneous" in real-time. Mathematically, $\mathcal{S}(𝐪)$ denotes an integral of the dynamical structure factor $\mathcal{S}(𝐪, ω)$ over all energies $ω$. In SpinWaveTheory, the energy integral becomes a discrete sum over bands. In SampledCorrelations, a classical-to-quantum correction factor will be applied within intensities prior to energy integration.

Sunny also supports a mechanism to calculate static correlations without any spin dynamics. To collect such statistics, construct a SampledCorrelationsStatic object. In this case, intensities_static will return static correlations sampled from the classical Boltzmann distribution. This dynamics-free approach is faster, but may miss important features that derive from the quantum mechanical excitation spectrum.

+end

Extracting intensities sampled correlation data

Like in spin wave theory, the basic function for extracting intensities information from a SampledCorrelations is intensities. It takes a SampledCorrelations, a collection of $𝐪$-vectors, a collection of energies, and possible other options.

Since classical dynamics simulation take place on a finite lattice, the fundamental intensities measurements are only available at a discrete grid of wave vectors. In reciprocal lattice units, available grid points are $𝐪 = [\frac{n_1}{L_1}, \frac{n_2}{L_2}, \frac{n_3}{L_3}]$, where $n_i$ runs from $(\frac{-L_i}{2}+1)$ to $\frac{L_i}{2}$ and $L_i$ is the linear dimension of the lattice used in the calculation. (An internal function Sunny.available_wave_vectors provides access to this grid.) By default intensities will adjust each wavevector $𝐪$ to the nearest available grid point.

Similarly, the resolution in energies is controlled the dynamical trajectory length in real-time. Because the dynamical trajectory is not periodic in time, some blurring between neighboring energy bins is unavoidable. Sunny's algorithm for estimating the structure factor from real-time dynamics is specified here.

The temperature parameter kT is required for SampledCorrelations calculations, and will be used to perform classical-to-quantum rescaling of intensities. If kT = nothing, then intensities will be provided according to the classical Boltzmann distribution.

The instantaneous structure factor

Use intensities_static to calculate $\mathcal{S}(𝐪)$, i.e., correlations that are "instantaneous" in real-time. Mathematically, $\mathcal{S}(𝐪)$ denotes an integral of the dynamical structure factor $\mathcal{S}(𝐪, ω)$ over all energies $ω$. In SpinWaveTheory, the energy integral becomes a discrete sum over bands. In SampledCorrelations, a classical-to-quantum correction factor will be applied within intensities prior to energy integration.

Sunny also supports a mechanism to calculate static correlations without any spin dynamics. To collect such statistics, construct a SampledCorrelationsStatic object. In this case, intensities_static will return static correlations sampled from the classical Boltzmann distribution. This dynamics-free approach is faster, but may miss important features that derive from the quantum mechanical excitation spectrum.

diff --git a/previews/PR342/versions.html b/previews/PR342/versions.html index aad0d37b2..8ffa097ae 100644 --- a/previews/PR342/versions.html +++ b/previews/PR342/versions.html @@ -1,2 +1,2 @@ -Version History · Documentation

Version History

v0.7.5

(In development)

  • view_crystal shows allowed quadratic anisotropy. print_site accepts an optional reference atom i_ref, with default of i. The optional reference bond b_ref of print_bond now defaults to b.

v0.7.4

(Dec 6, 2024)

v0.7.3

(Nov 12, 2024)

  • Fix error in print_symmetry_table for slightly-distorted crystal cells (PR #317).
  • Stabilize SpinWaveTheoryKPM. It now automatically selects the polynomial order according to an error tolerance.
  • Rename mode :dipole_large_S to :dipole_uncorrected to emphasize that corrections are missing.
  • The Crystal constructor, by default, interprets a spacegroup number in its ITA standard setting, e.g., as used by the Bilbao crystallographic server. The keyword argument setting becomes choice, and can typically be omitted.
  • Rename primitive_cell_shape to primitive_cell.

v0.7.2

(Sep 11, 2024)

  • Fix error in SampledCorrelations with a coarse $𝐪$-grid. (PR #314).
  • Fix colorbar in plot_intensities! when all data is uniform (PR #315).
  • An explicit colorrange can be used for plotting intensities_bands.

v0.7.1

(Sep 3, 2024)

  • Correctness fix for scalar biquadratic interactions specified with option biquad to set_exchange!.
  • Prototype implementation of entangled units.

v0.7.0

(Aug 30, 2024)

This major release introduces breaking interface changes.

  • The interface for calculating intensities has been revised to unify functionality across backends. The functions intensities_bands, intensities, and intensities_static no longer expect a "formula", and instead take keyword arguments directly. Pair correlations are now specified using ssf_perp and related functions. The constructors SampledCorrelations and SampledCorrelationsStatic replace dynamic_correlations and static_correlations, respectively.
  • New function plot_intensities enables convenient plotting for many types of intensities plots. Mutating variant plot_intensities! enables multi-panel plots.
  • One should now specify a range of $𝐪$-points with q_space_path or q_space_grid.
  • SpinWaveTheorySpiral is available to perform calculations on generalized spiral structures, which may be incommensurate.
  • repeat_periodically_as_spiral replaces set_spiral_order_on_sublattice! and set_spiral_order!.
  • New convenience functions powder_average and domain_average, which wrap intensities.
  • System now expects supercell dimensions as a dims keyword argument. Moment replaces SpinInfo. Lower-case s now labels quantum spin.
  • In view_crystal and plot_spins use ndims instead of dims for the number of spatial dimensions.
  • Binning features have been removed. Some functionality may be added back in a future release.
  • Experimental SpinWaveTheoryKPM feature implements a new algorithm to enable intensities calculations at a computational cost that scales linearly in system size.

v0.6.1

(Aug 2, 2024)

  • Breaking changes: magnetic_moment is now reported in units of the Bohr magneton, $μ_B$. For model systems where the Zeeman coupling aligns spin dipole with field (e.g., the Ising model convention), create a SpinInfo with g=-1. (PR 284).
  • More flexible Units system. set_external_field! is deprecated in favor of set_field!, which now expects a field in energy units. enable_dipole_dipole! now expects a scale parameter $μ_0 μ_B^2$ that can be obtained from units.vacuum_permeability.

v0.6.0

(Jun 18, 2024)

  • Various correctness fixes. The magnetic moment is now anti-aligned with the spin dipole (Issue 190), and the wavevector $𝐪$ in structure factor intensities $\mathcal{S}(𝐪,ω)$ now consistently represents momentum transfer to the sample (Issue 270). The new Example 8 demonstrates a model system where momentum transfers $±𝐪$ are inequivalent.
  • Dynamical structure factor intensities now have a precisely defined scale, independent of the calculator (Issue 264). Consequently, color ranges in plots may need to be rescaled.
  • Crystal can now infer a chemical unit cell from an mCIF file. System now supports set_dipoles_from_mcif!. Through spglib, one can now standardize any Crystal, with an option to idealize site positions.

v0.5.11

(Jun 2, 2024)

  • Fixes for Makie 0.21.

v0.5.10

(May 27, 2024)

  • view_crystal called on a System now shows interactions, and optionally the spin or magnetic dipoles.
  • Interactions for enable_dipole_dipole! are now supported in linear spin wave theory, with proper Ewald summation. For a faster alternative, the experimental function modify_exchange_with_truncated_dipole_dipole! will accept a real-space cutoff.
  • Intensities calculated with dynamic_correlations now avoid "bleeding artifacts" at low-energy (long-timescale) modes. See PR 246 for details. This eliminates the need for process_trajectory=:symmetrize.
  • When passed to intensity_formula, the special value zero(FormFactor) can now be used to disable contributions from a given site. For an example, see the ported SpinW tutorial 19.
  • Broadening kernels gaussian and lorentzian now expect a full width at half maximum (fwhm) keyword argument.
  • Experimental support for calculations on generalized spiral phases. For an example, see the ported SpinW tutorial 18.
  • Correctness fix for the case where spin-$S$ varies between sites in dipole-mode. In SU($N$) mode, however, there is still no support for varying the Hilbert space dimension $N$ between sites.
  • Correctness fix in long-range dipole-dipole interactions for systems with multiple cells.
  • Correctness fix in general biquadratic interactions (beyond scalar) for spin wave theory in dipole-mode.
  • Correctness fix for reading Mantid .nxs files.

v0.5.9

(Mar 25, 2024)

  • Correctness fixes: Structure factor conventions are now uniform across modes and precisely specified. The g-tensor is applied by default (disable with apply_g = false). The intensity is additive with increasing number of magnetic ions in the chemical cell, consistent with SpinW. Issue #235.
  • Enhancements to view_crystal. If a bond allows a DM interaction, its orientation will be shown visually. If a System argument is supplied, its exchange interactions will be shown..
  • New function suggest_timestep to assist in performing accurate and efficient simulation of classical spin dynamics. Issue #149.
  • Scalar biquadratic interactions can again be set in :dipole_large_S mode via the keyword argument biquad of set_exchange!.
  • Significantly speed up dynamic_correlations for crystals with many atoms in the unit cell. Issue #204.
  • Renamings: dt replaces Δt and damping replaces λ. This affects Langevin, [ImplicitMidpoint], and dynamic_correlations functions.

v0.5.8

(Jan 4, 2024)

  • Many bugs in the WGLMakie backend have become apparent, and are being tracked at Issue #211. Emit a warning if WGLMakie is detected, suggesting that GLMakie is preferred.
  • Various improvements to view_crystal. A distance parameter is no longer expected. Cartesian axes now appear as "compass" in bottom-left. Custom list of reference bonds can be passed. Toggle to view non-magnetic atoms in root crystal. Atoms now colored using CPK/JMol conventions.

v0.5.7

(Nov 26, 2023)

  • Update form factor coefficients, which now include Mn5.
  • Fix merge_correlations and the Parallelizing Calculations tutorial.
  • Remove internal functions *_primitive_crystal. Instead, it is recommended to use the conventional unit cell, and later call reshape_supercell.
  • Require Makie 0.20. An important new feature is resolution-independent scaling of font sizes. New figures expect size instead of resolution, and no longer accept rescale.

v0.5.6

(Nov 8, 2023)

This release initiates some major enhancements to the user interface in support of generalized SU(N) spin models. See this documentation page for an illustration of the new features. Most existing Sunny 0.5 models will continue to work with deprecation warnings, but these will become hard errors Sunny v0.6.

  • General pair couplings are now supported in set_pair_coupling! and set_pair_coupling_at!. :SUN mode supports interactions of any order, but :dipole mode is limited to bilinear and biquadratic coupling of the spin.
  • To perform a calculation with dipoles in the large-$S$ limit, use the new mode :dipole_large_S when constructing a System.
  • Deprecate the option biquad to set_exchange!. Use instead set_pair_coupling!, which generalizes beyond the scalar biquadratic.
  • Deprecate spin_operators, stevens_operators, large_S_spin_operators and large_S_stevens_operators. Use instead spin_matrices and stevens_matrices, which require a specific spin-$S$ label. To infer this, one can use spin_label.
  • Remove unused option energy_tol in SpinWaveTheory.
  • Animated spin dynamics is now possible. Call notify on the result of plot_spins to trigger redrawing of the frame. The argument colorfn to plot_spins supports animation of colors. See example usage for a Heisenberg ferromagnetic.
  • Add set_spin_rescaling! feature, which supports improved spectral measurements at finite-$T$. This follows the method proposed in Dahlbom et al., [arXiv:2310.19905].

v0.5.5

(Sep 29, 2023)

  • reshape_supercell now allows reshaping to multiples of the primitive unit cell, which can speed up certain calculations. This is illustrated in the CoRh₂O₄ powder averaging tutorial.
  • resize_supercell now allows all resizings.
  • Added energy_per_site.
  • set_spiral_order_on_sublattice! cannot work on reshaped systems.
  • Various bug fixes. In particular, an intensity_formula with :full will now uniformly calculate a 3x3 matrix of complex numbers.

v0.5.4

(Sep 11, 2023)

  • Various enhancements to view_crystal. Atoms are now labeled by index, and bonds support interactive inspection (GLMakie only). Font sizes work correctly on Makie v0.20-beta. If using Makie v0.19 on a high-resolution display, pass rescale=1.5 to enlarge font sizes.
  • The function suggest_magnetic_supercell now requires only a list of wavevectors, and will return a $3×3$ matrix that can be programmatically passed to reshape_supercell. The new tolerance parameter tol allows suggest_magnetic_supercell to approximate incommensurate wavevectors with nearby commensurate ones.
  • New functions set_spiral_order! and set_spiral_order_on_sublattice! can be used to initialize a spiral, single-$Q$ order.
  • Sunny now retains all constant energy shifts that have been introduced by anisotropy operators.
  • Fix export_vtk functionality.

v0.5.3

(Sep 8, 2023)

  • Add large_S_spin_operators and large_S_stevens_operators to support single-ion anisotropies in dipole mode without renormalization. Set large_S=true in set_exchange! to avoid renormalization of biquadratics.
  • view_crystal has been rewritten in Makie.
  • plot_spins now expects ghost_radius in physical length units.
  • SpinWaveTheory will (currently) error if provided a system with enable_dipole_dipole!.

v0.5.2

(Aug 30, 2023)

  • Form factors for 5d transition ions.
  • Download links for notebooks and scripts on each doc example
  • Various bug fixes.

v0.5.1

(Aug 23, 2023)

  • Fix binning edge cases.
  • plot_spins accepts resolution argument.

v0.5.0

(Aug 21, 2023)

New features.

Support for Linear Spin Wave Theory in :dipole and :SUN modes. (Thanks Hao Zhang!)

New function minimize_energy! to efficiently find an optimal configuration of spin dipoles or SU(N) coherent states.

Major refactors and enhancements to intensity calculations. This new interface allows unification between LSWT and classical spin dynamics calculations. This interface allows: Custom observables as local quantum operators, better support for linebroadening, and automatic binning to facilitate comparison with experimental data. See intensity_formula for documentation. Use load_nxs to load experimental neutron scattering data.

Breaking changes.

Require Julia 1.9.

Replace set_anisotropy! with a new function set_onsite_coupling! (and similarly set_onsite_coupling_at!). The latter expects an explicit matrix representation for the local Hamiltonian. This can be constructed, e.g., as a linear combination of stevens_operators, or as a polynomial of spin_operators. To understand the mapping between these two, the new function print_stevens_expansion acts on an arbitrary local operator.

Remove set_biquadratic!. Instead, use an optional keyword argument biquad to set_exchange!.

Rename DynamicStructureFactor to dynamic_correlations. Similarly, replace InstantStructureFactor with instant_correlations. The return type has been renamed SampledCorrelations to emphasize that the object may be holding thermodynamic samples, which are collected using add_sample!. Upon construction, the SampledCorrelations object will be empty (no initial sample).

Remove intensities function. Instead, use one of intensities_interpolated or intensities_binned. These will require an intensity_formula, which defines a calculator (e.g., LSWT).

Rename connected_path to reciprocal_space_path, which now returns an xticks object that can be used in plotting. Replace spherical_shell with reciprocal_space_shell that functions similarly.

Rename polarize_spin! to set_dipole! for consistency with set_coherent!. The behavior of the former function is unchanged: the spin at a given site will still be polarized along the provided direction.

Rename all_sites to eachsite consistent with Julia convention for iterators.

Rename reshape_geometry to reshape_supercell, which is the fundamental reshaping function. Rename resize_periodically to resize_supercell.

The constructor SpinInfo now requires a $g$-factor or tensor as a named argument.

The constructor FormFactor no longer accepts an atom index. Instead, the form factors are associated with site-symmetry classes in order of appearance.

v0.4.3

(Jun 23, 2023)

Experimental support for linear SpinWaveTheory, implemented in SU(N) mode. This module may evolve rapidly.

Implement renormalization of single-ion anisotropy and biquadratic interactions when in :dipole mode. This makes the model more faithful to the quantum mechanical Hamiltonian, but is also a breaking change.

Various improvements and bugfixes for to_inhomogeneous. Setting inhomogeneous interactions via set_exchange_at! should now infer the correct bond offset direction, or will report an ambiguity error. Ambiguities can be resolved by passing an explicit offset.

The function remove_periodicity! disables periodicity along specified dimensions.

Rename StaticStructureFactor to InstantStructureFactor.

v0.4.2

(Feb 27, 2023)

Introduce LocalSampler, a framework for MCMC sampling with local spin updates.

Rename print_dominant_wavevectors to print_wrapped_intensities to reduce confusion with the physical instantaneous intensities.

The function spherical_shell now takes a radius in physical units of inverse Å.

New exported functions global_position, magnetic_moment, all_sites.

Remove all uses of Base.deepcopy which resolves crashes.

v0.4.1

(Feb 13, 2023)

The function to_inhomogeneous creates a system that supports inhomogeneous interactions, which can be set using set_exchange_at!, etc.

set_biquadratic! replaces set_exchange_with_biquadratic!.

v0.4.0

(Feb 10, 2023)

This update includes many breaking changes, and is missing some features of 0.3.0.

Creating a spin System

Rename SpinSystem to System. Its constructor now has the form,

System(crystal, dims, infos, mode)

The parameter infos is now a list of SpinInfo objects. Each defines spin angular momentum $S = \frac{1}{2}, 1, \frac{3}{2}, …$, and an optional $g$-factor or tensor.

The parameter mode is one of :SUN or :dipole.

Setting interactions

Interactions are now added mutably to an existing System using the following functions: set_external_field!, set_exchange!, set_onsite_coupling!, enable_dipole_dipole!.

As a convenience, one can use dmvec(D) to convert a DM vector to a $3×3$ antisymmetric exchange matrix.

Fully general single-ion anisotropy is now possible. The function set_onsite_coupling! expects the single ion anisotropy to be expressed as a polynomial in symbolic spin operators 𝒮, or as a linear combination of symbolic Stevens operators 𝒪. For example, an easy axis anisotropy in the direction n may be written D*(𝒮⋅n)^2.

Stevens operators 𝒪[k,q] admit polynomial expression in spin operators 𝒮[α]. Conversely, a polynomial of spin operators can be expressed as a linear combination of Stevens operators. To see this expansion use print_anisotropy_as_stevens.

Inhomogeneous field

An external field can be applied to a single site with set_external_field_at!.

Structure factor rewrite

The calculation of structure factors has been completely rewritten. For the new interface see the documentation tutorials.

Various

  • The "Sampler" interface is in flux. Langevin replaces both LangevinHeunP and LangevinSampler. Local spin-flip Monte Carlo sampling methods are temporarily broken.

  • repeat_periodically replaces extend_periodically.

Additional related functions include resize_periodically and reshape_geometry, the latter being fundamental.

The new function includes the list of symmetry-allowed single ion anisotropies in addition to exchange interactions.

  • When reading CIF files, the field _atom_site_label is now used in place of the field _atom_site_type_symbol.

This is required for correctness. The field _atom_site_label is guaranteed to be present, and is guaranteed to be a distinct label for each symmetry-inequivalent site. Code that explicitly referred to site labels (e.g. in calls to subcrystal) will need to be updated to use the new label.

+Version History · Documentation

Version History

v0.7.5

(In development)

  • view_crystal shows allowed quadratic anisotropy. print_site accepts an optional reference atom i_ref, with default of i. The optional reference bond b_ref of print_bond now defaults to b.

v0.7.4

(Dec 6, 2024)

v0.7.3

(Nov 12, 2024)

  • Fix error in print_symmetry_table for slightly-distorted crystal cells (PR #317).
  • Stabilize SpinWaveTheoryKPM. It now automatically selects the polynomial order according to an error tolerance.
  • Rename mode :dipole_large_S to :dipole_uncorrected to emphasize that corrections are missing.
  • The Crystal constructor, by default, interprets a spacegroup number in its ITA standard setting, e.g., as used by the Bilbao crystallographic server. The keyword argument setting becomes choice, and can typically be omitted.
  • Rename primitive_cell_shape to primitive_cell.

v0.7.2

(Sep 11, 2024)

  • Fix error in SampledCorrelations with a coarse $𝐪$-grid. (PR #314).
  • Fix colorbar in plot_intensities! when all data is uniform (PR #315).
  • An explicit colorrange can be used for plotting intensities_bands.

v0.7.1

(Sep 3, 2024)

  • Correctness fix for scalar biquadratic interactions specified with option biquad to set_exchange!.
  • Prototype implementation of entangled units.

v0.7.0

(Aug 30, 2024)

This major release introduces breaking interface changes.

  • The interface for calculating intensities has been revised to unify functionality across backends. The functions intensities_bands, intensities, and intensities_static no longer expect a "formula", and instead take keyword arguments directly. Pair correlations are now specified using ssf_perp and related functions. The constructors SampledCorrelations and SampledCorrelationsStatic replace dynamic_correlations and static_correlations, respectively.
  • New function plot_intensities enables convenient plotting for many types of intensities plots. Mutating variant plot_intensities! enables multi-panel plots.
  • One should now specify a range of $𝐪$-points with q_space_path or q_space_grid.
  • SpinWaveTheorySpiral is available to perform calculations on generalized spiral structures, which may be incommensurate.
  • repeat_periodically_as_spiral replaces set_spiral_order_on_sublattice! and set_spiral_order!.
  • New convenience functions powder_average and domain_average, which wrap intensities.
  • System now expects supercell dimensions as a dims keyword argument. Moment replaces SpinInfo. Lower-case s now labels quantum spin.
  • In view_crystal and plot_spins use ndims instead of dims for the number of spatial dimensions.
  • Binning features have been removed. Some functionality may be added back in a future release.
  • Experimental SpinWaveTheoryKPM feature implements a new algorithm to enable intensities calculations at a computational cost that scales linearly in system size.

v0.6.1

(Aug 2, 2024)

  • Breaking changes: magnetic_moment is now reported in units of the Bohr magneton, $μ_B$. For model systems where the Zeeman coupling aligns spin dipole with field (e.g., the Ising model convention), create a SpinInfo with g=-1. (PR 284).
  • More flexible Units system. set_external_field! is deprecated in favor of set_field!, which now expects a field in energy units. enable_dipole_dipole! now expects a scale parameter $μ_0 μ_B^2$ that can be obtained from units.vacuum_permeability.

v0.6.0

(Jun 18, 2024)

  • Various correctness fixes. The magnetic moment is now anti-aligned with the spin dipole (Issue 190), and the wavevector $𝐪$ in structure factor intensities $\mathcal{S}(𝐪,ω)$ now consistently represents momentum transfer to the sample (Issue 270). The new Example 8 demonstrates a model system where momentum transfers $±𝐪$ are inequivalent.
  • Dynamical structure factor intensities now have a precisely defined scale, independent of the calculator (Issue 264). Consequently, color ranges in plots may need to be rescaled.
  • Crystal can now infer a chemical unit cell from an mCIF file. System now supports set_dipoles_from_mcif!. Through spglib, one can now standardize any Crystal, with an option to idealize site positions.

v0.5.11

(Jun 2, 2024)

  • Fixes for Makie 0.21.

v0.5.10

(May 27, 2024)

  • view_crystal called on a System now shows interactions, and optionally the spin or magnetic dipoles.
  • Interactions for enable_dipole_dipole! are now supported in linear spin wave theory, with proper Ewald summation. For a faster alternative, the experimental function modify_exchange_with_truncated_dipole_dipole! will accept a real-space cutoff.
  • Intensities calculated with dynamic_correlations now avoid "bleeding artifacts" at low-energy (long-timescale) modes. See PR 246 for details. This eliminates the need for process_trajectory=:symmetrize.
  • When passed to intensity_formula, the special value zero(FormFactor) can now be used to disable contributions from a given site. For an example, see the ported SpinW tutorial 19.
  • Broadening kernels gaussian and lorentzian now expect a full width at half maximum (fwhm) keyword argument.
  • Experimental support for calculations on generalized spiral phases. For an example, see the ported SpinW tutorial 18.
  • Correctness fix for the case where spin-$S$ varies between sites in dipole-mode. In SU($N$) mode, however, there is still no support for varying the Hilbert space dimension $N$ between sites.
  • Correctness fix in long-range dipole-dipole interactions for systems with multiple cells.
  • Correctness fix in general biquadratic interactions (beyond scalar) for spin wave theory in dipole-mode.
  • Correctness fix for reading Mantid .nxs files.

v0.5.9

(Mar 25, 2024)

  • Correctness fixes: Structure factor conventions are now uniform across modes and precisely specified. The g-tensor is applied by default (disable with apply_g = false). The intensity is additive with increasing number of magnetic ions in the chemical cell, consistent with SpinW. Issue #235.
  • Enhancements to view_crystal. If a bond allows a DM interaction, its orientation will be shown visually. If a System argument is supplied, its exchange interactions will be shown..
  • New function suggest_timestep to assist in performing accurate and efficient simulation of classical spin dynamics. Issue #149.
  • Scalar biquadratic interactions can again be set in :dipole_large_S mode via the keyword argument biquad of set_exchange!.
  • Significantly speed up dynamic_correlations for crystals with many atoms in the unit cell. Issue #204.
  • Renamings: dt replaces Δt and damping replaces λ. This affects Langevin, [ImplicitMidpoint], and dynamic_correlations functions.

v0.5.8

(Jan 4, 2024)

  • Many bugs in the WGLMakie backend have become apparent, and are being tracked at Issue #211. Emit a warning if WGLMakie is detected, suggesting that GLMakie is preferred.
  • Various improvements to view_crystal. A distance parameter is no longer expected. Cartesian axes now appear as "compass" in bottom-left. Custom list of reference bonds can be passed. Toggle to view non-magnetic atoms in root crystal. Atoms now colored using CPK/JMol conventions.

v0.5.7

(Nov 26, 2023)

  • Update form factor coefficients, which now include Mn5.
  • Fix merge_correlations and the Parallelizing Calculations tutorial.
  • Remove internal functions *_primitive_crystal. Instead, it is recommended to use the conventional unit cell, and later call reshape_supercell.
  • Require Makie 0.20. An important new feature is resolution-independent scaling of font sizes. New figures expect size instead of resolution, and no longer accept rescale.

v0.5.6

(Nov 8, 2023)

This release initiates some major enhancements to the user interface in support of generalized SU(N) spin models. See this documentation page for an illustration of the new features. Most existing Sunny 0.5 models will continue to work with deprecation warnings, but these will become hard errors Sunny v0.6.

  • General pair couplings are now supported in set_pair_coupling! and set_pair_coupling_at!. :SUN mode supports interactions of any order, but :dipole mode is limited to bilinear and biquadratic coupling of the spin.
  • To perform a calculation with dipoles in the large-$S$ limit, use the new mode :dipole_large_S when constructing a System.
  • Deprecate the option biquad to set_exchange!. Use instead set_pair_coupling!, which generalizes beyond the scalar biquadratic.
  • Deprecate spin_operators, stevens_operators, large_S_spin_operators and large_S_stevens_operators. Use instead spin_matrices and stevens_matrices, which require a specific spin-$S$ label. To infer this, one can use spin_label.
  • Remove unused option energy_tol in SpinWaveTheory.
  • Animated spin dynamics is now possible. Call notify on the result of plot_spins to trigger redrawing of the frame. The argument colorfn to plot_spins supports animation of colors. See example usage for a Heisenberg ferromagnetic.
  • Add set_spin_rescaling! feature, which supports improved spectral measurements at finite-$T$. This follows the method proposed in Dahlbom et al., [arXiv:2310.19905].

v0.5.5

(Sep 29, 2023)

  • reshape_supercell now allows reshaping to multiples of the primitive unit cell, which can speed up certain calculations. This is illustrated in the CoRh₂O₄ powder averaging tutorial.
  • resize_supercell now allows all resizings.
  • Added energy_per_site.
  • set_spiral_order_on_sublattice! cannot work on reshaped systems.
  • Various bug fixes. In particular, an intensity_formula with :full will now uniformly calculate a 3x3 matrix of complex numbers.

v0.5.4

(Sep 11, 2023)

  • Various enhancements to view_crystal. Atoms are now labeled by index, and bonds support interactive inspection (GLMakie only). Font sizes work correctly on Makie v0.20-beta. If using Makie v0.19 on a high-resolution display, pass rescale=1.5 to enlarge font sizes.
  • The function suggest_magnetic_supercell now requires only a list of wavevectors, and will return a $3×3$ matrix that can be programmatically passed to reshape_supercell. The new tolerance parameter tol allows suggest_magnetic_supercell to approximate incommensurate wavevectors with nearby commensurate ones.
  • New functions set_spiral_order! and set_spiral_order_on_sublattice! can be used to initialize a spiral, single-$Q$ order.
  • Sunny now retains all constant energy shifts that have been introduced by anisotropy operators.
  • Fix export_vtk functionality.

v0.5.3

(Sep 8, 2023)

  • Add large_S_spin_operators and large_S_stevens_operators to support single-ion anisotropies in dipole mode without renormalization. Set large_S=true in set_exchange! to avoid renormalization of biquadratics.
  • view_crystal has been rewritten in Makie.
  • plot_spins now expects ghost_radius in physical length units.
  • SpinWaveTheory will (currently) error if provided a system with enable_dipole_dipole!.

v0.5.2

(Aug 30, 2023)

  • Form factors for 5d transition ions.
  • Download links for notebooks and scripts on each doc example
  • Various bug fixes.

v0.5.1

(Aug 23, 2023)

  • Fix binning edge cases.
  • plot_spins accepts resolution argument.

v0.5.0

(Aug 21, 2023)

New features.

Support for Linear Spin Wave Theory in :dipole and :SUN modes. (Thanks Hao Zhang!)

New function minimize_energy! to efficiently find an optimal configuration of spin dipoles or SU(N) coherent states.

Major refactors and enhancements to intensity calculations. This new interface allows unification between LSWT and classical spin dynamics calculations. This interface allows: Custom observables as local quantum operators, better support for linebroadening, and automatic binning to facilitate comparison with experimental data. See intensity_formula for documentation. Use load_nxs to load experimental neutron scattering data.

Breaking changes.

Require Julia 1.9.

Replace set_anisotropy! with a new function set_onsite_coupling! (and similarly set_onsite_coupling_at!). The latter expects an explicit matrix representation for the local Hamiltonian. This can be constructed, e.g., as a linear combination of stevens_operators, or as a polynomial of spin_operators. To understand the mapping between these two, the new function print_stevens_expansion acts on an arbitrary local operator.

Remove set_biquadratic!. Instead, use an optional keyword argument biquad to set_exchange!.

Rename DynamicStructureFactor to dynamic_correlations. Similarly, replace InstantStructureFactor with instant_correlations. The return type has been renamed SampledCorrelations to emphasize that the object may be holding thermodynamic samples, which are collected using add_sample!. Upon construction, the SampledCorrelations object will be empty (no initial sample).

Remove intensities function. Instead, use one of intensities_interpolated or intensities_binned. These will require an intensity_formula, which defines a calculator (e.g., LSWT).

Rename connected_path to reciprocal_space_path, which now returns an xticks object that can be used in plotting. Replace spherical_shell with reciprocal_space_shell that functions similarly.

Rename polarize_spin! to set_dipole! for consistency with set_coherent!. The behavior of the former function is unchanged: the spin at a given site will still be polarized along the provided direction.

Rename all_sites to eachsite consistent with Julia convention for iterators.

Rename reshape_geometry to reshape_supercell, which is the fundamental reshaping function. Rename resize_periodically to resize_supercell.

The constructor SpinInfo now requires a $g$-factor or tensor as a named argument.

The constructor FormFactor no longer accepts an atom index. Instead, the form factors are associated with site-symmetry classes in order of appearance.

v0.4.3

(Jun 23, 2023)

Experimental support for linear SpinWaveTheory, implemented in SU(N) mode. This module may evolve rapidly.

Implement renormalization of single-ion anisotropy and biquadratic interactions when in :dipole mode. This makes the model more faithful to the quantum mechanical Hamiltonian, but is also a breaking change.

Various improvements and bugfixes for to_inhomogeneous. Setting inhomogeneous interactions via set_exchange_at! should now infer the correct bond offset direction, or will report an ambiguity error. Ambiguities can be resolved by passing an explicit offset.

The function remove_periodicity! disables periodicity along specified dimensions.

Rename StaticStructureFactor to InstantStructureFactor.

v0.4.2

(Feb 27, 2023)

Introduce LocalSampler, a framework for MCMC sampling with local spin updates.

Rename print_dominant_wavevectors to print_wrapped_intensities to reduce confusion with the physical instantaneous intensities.

The function spherical_shell now takes a radius in physical units of inverse Å.

New exported functions global_position, magnetic_moment, all_sites.

Remove all uses of Base.deepcopy which resolves crashes.

v0.4.1

(Feb 13, 2023)

The function to_inhomogeneous creates a system that supports inhomogeneous interactions, which can be set using set_exchange_at!, etc.

set_biquadratic! replaces set_exchange_with_biquadratic!.

v0.4.0

(Feb 10, 2023)

This update includes many breaking changes, and is missing some features of 0.3.0.

Creating a spin System

Rename SpinSystem to System. Its constructor now has the form,

System(crystal, dims, infos, mode)

The parameter infos is now a list of SpinInfo objects. Each defines spin angular momentum $S = \frac{1}{2}, 1, \frac{3}{2}, …$, and an optional $g$-factor or tensor.

The parameter mode is one of :SUN or :dipole.

Setting interactions

Interactions are now added mutably to an existing System using the following functions: set_external_field!, set_exchange!, set_onsite_coupling!, enable_dipole_dipole!.

As a convenience, one can use dmvec(D) to convert a DM vector to a $3×3$ antisymmetric exchange matrix.

Fully general single-ion anisotropy is now possible. The function set_onsite_coupling! expects the single ion anisotropy to be expressed as a polynomial in symbolic spin operators 𝒮, or as a linear combination of symbolic Stevens operators 𝒪. For example, an easy axis anisotropy in the direction n may be written D*(𝒮⋅n)^2.

Stevens operators 𝒪[k,q] admit polynomial expression in spin operators 𝒮[α]. Conversely, a polynomial of spin operators can be expressed as a linear combination of Stevens operators. To see this expansion use print_anisotropy_as_stevens.

Inhomogeneous field

An external field can be applied to a single site with set_external_field_at!.

Structure factor rewrite

The calculation of structure factors has been completely rewritten. For the new interface see the documentation tutorials.

Various

  • The "Sampler" interface is in flux. Langevin replaces both LangevinHeunP and LangevinSampler. Local spin-flip Monte Carlo sampling methods are temporarily broken.

  • repeat_periodically replaces extend_periodically.

Additional related functions include resize_periodically and reshape_geometry, the latter being fundamental.

The new function includes the list of symmetry-allowed single ion anisotropies in addition to exchange interactions.

  • When reading CIF files, the field _atom_site_label is now used in place of the field _atom_site_type_symbol.

This is required for correctness. The field _atom_site_label is guaranteed to be present, and is guaranteed to be a distinct label for each symmetry-inequivalent site. Code that explicitly referred to site labels (e.g. in calls to subcrystal) will need to be updated to use the new label.

diff --git a/previews/PR342/why.html b/previews/PR342/why.html index 075b441d0..e9e62041e 100644 --- a/previews/PR342/why.html +++ b/previews/PR342/why.html @@ -1,2 +1,2 @@ -Why Choose Sunny? · Documentation

Why Choose Sunny?

Powerful and easy to use

Feature highlights include:

But still evolving:

  • Sunny does not yet have GPU acceleration of classical spin dynamics. An alternative here might be Vampire.

Advanced theory made accessible

Sunny is also a platform for disseminating foundational advances in quantum magnetism and computational methods. The theory of SU(N) coherent states offers a group theoretic framework to formulate alternative classical limits of a microscopic quantum model. New algorithms enable highly efficient simulation of spin-multipoles and beyond. For reasons not fully understood, such classical limits can be remarkably accurate at finite temperatures when used in conjunction with appropriate renormalization schemes. The SU(N) picture also suggests new geometric interpretations of quantum spin. This leads to a deeper understanding of existing renormalization schemes for traditional spin wave theory, and suggests a whole landscape in which to search for novel topological states. Ongoing Sunny research aims to incorporate more quantum entanglement into the classical picture. Local units of strongly entangled spins will soon be supported and show great promise for cases like dimerized ladders. Longer term, Sunny also aims to include perturbative corrections beyond linear spin wave theory, as well as a non-perturbative treatment of quantum bound states.

+Why Choose Sunny? · Documentation

Why Choose Sunny?

Powerful and easy to use

Feature highlights include:

But still evolving:

  • Sunny does not yet have GPU acceleration of classical spin dynamics. An alternative here might be Vampire.

Advanced theory made accessible

Sunny is also a platform for disseminating foundational advances in quantum magnetism and computational methods. The theory of SU(N) coherent states offers a group theoretic framework to formulate alternative classical limits of a microscopic quantum model. New algorithms enable highly efficient simulation of spin-multipoles and beyond. For reasons not fully understood, such classical limits can be remarkably accurate at finite temperatures when used in conjunction with appropriate renormalization schemes. The SU(N) picture also suggests new geometric interpretations of quantum spin. This leads to a deeper understanding of existing renormalization schemes for traditional spin wave theory, and suggests a whole landscape in which to search for novel topological states. Ongoing Sunny research aims to incorporate more quantum entanglement into the classical picture. Local units of strongly entangled spins will soon be supported and show great promise for cases like dimerized ladders. Longer term, Sunny also aims to include perturbative corrections beyond linear spin wave theory, as well as a non-perturbative treatment of quantum bound states.

diff --git a/previews/PR342/writevtk.html b/previews/PR342/writevtk.html index 6ff5f527e..1e6b5ef24 100644 --- a/previews/PR342/writevtk.html +++ b/previews/PR342/writevtk.html @@ -53,4 +53,4 @@ signal = sum(signal; dims = 4) # Export to ParaView -export_vtk("experiment_data_as_vtk", params, signal) +export_vtk("experiment_data_as_vtk", params, signal)