Sunny.jl

A package for simulating classical spin systems, including the Landau-Lifshitz dynamics of spin dipoles and its generalization to multipolar spin components. In the latter case, Sunny resolves the local quantum structure of individual spins, making it particularly suited for modeling magnetic compounds with strong local anisotropy.

Sunny additionally provides Monte Carlo algorithms for sampling from thermal equilibrium, as well as tools for measuring dynamical structure factors that can be compared with experimental neutron scattering data. Sunny provides symmetry analyses to facilitate the design and specification of model Hamiltonians, and interactive tools to visualize 3D crystal structures and (coming soon) structure factor data.

Example notebooks

To get a feeling for what Sunny can do, we recommend browsing some Jupyter notebook examples.

Technical description of SU(N) spin dynamics.

A quantum spin of magnitude S has $N = 2 S + 1$ distinct levels, and evolves under the group of special unitary transformations, SU(N). Local physical observables correspond to expectation values of the $N^2-1$ generators of SU(N), which may be interpreted as multipolar spin components. The standard treatment keeps only the expected dipole components, $\langle \hat S^x\rangle,\langle \hat S^y\rangle,\langle \hat S^z\rangle$, yielding the Landau-Lifshitz dynamics. The "SU(N) spin dynamics" naturally generalizes the LL equation by modeling the coupled dynamics of all $N^2-1$ generalized spin components. For more details, please see our papers:

  • H. Zhang and C. D. Batista, Classical spin dynamics based on SU(N) coherent states, Phys. Rev. B 104, 104409 (2021) [arXiv:2106.14125].
  • D. Dahlbom et al., Geometric integration of classical spin dynamics via a mean-field Schrödinger equation [arXiv:2204.07563].

Comparison with other tools

A defining feature of Sunny is its support for generalized SU(N) spin dynamics. As a special case, however, Sunny can be restricted to the dipole-only approximation of spin. In this mode, the capabilities of Sunny are similar to SpinW. A key difference is that Sunny does not (currently) employ linear spin wave theory. Advantages are: (1) Applicability to finite temperature measurements and (2) Support for single-ion anisotropies beyond quadratic order. A disadvantage is that structure factor measurements $\mathcal S(q,\omega)$ have momentum-space ($q$) resolution that is limited by the size of magnetic super cell.

Installation

Sunny is implemented in the Julia programming language. New Julia users may wish to start with our Getting Started guide.

From the Julia prompt, one can install Sunny using the built-in package manager:

julia> ]
pkg> add Sunny

Check that Sunny is working properly by running the unit tests: pkg> test Sunny. Please keep up-to-date by periodically running the Julia update command: pkg> update.

A good way to interact with Sunny is through the Jupyter notebook interface. This support can be installed through the IJulia package.

API Reference

Documentation available here.

Contact us

Sunny is developed collaboratively across many institutions, with leadership from Los Alamos National Lab, U. Tennessee, and Georgia Tech. If you discover bugs, or find Sunny useful, please contact kbarros@lanl.gov and ddahlbom@utk.edu.

LANL U. Tennessee Georgia Tech.