The Spirit Atomistic Spin Code is a Open Source Spin Dynamics Code developed in large part at the PGI-1 at Forschungszentrum Jülich (FZJ). It simulates the dynamics of magnetic structures and provides optimization tools for studying transitions and energy landscapes. Noteably, this code provides live visualisations and data plots during simulations. This is a descriptive article, details about the code's implementation can be found under Spirit Code Structure.
The code is hosted on GitHub:
- Home page: https://spirit-code.github.io
- Readme: https://github.com/spirit-code/spirit/blob/master/README.md
- Contributors: https://github.com/spirit-code/spirit/blob/master/CONTRIBUTORS.md
- License (MIT): https://github.com/spirit-code/spirit/blob/master/LICENSE.txt
- Report issues: https://github.com/spirit-code/spirit/issues
Spirit's Web UI can be found hosted at http://iffwww.iff.kfa-juelich.de/pub/spiritdemo/ (it does not require any installation on the user's side).
- Modularity and extensibility
- Few external dependencies
- Desktop User Interface with live visualisation
- Web interface for e.g. education and portable presentations
- Accessibility from different programming languages through C API
This code is written in platform-independent C++ and utilizes a modular class structure to enable flexible workflows. The build process is platform-independent as well, due to the use of CMake. This code has been tested on Windows 7 and 10, OSX Yosemite and upwards and various Linux systems including Ubuntu, Arch and CentOS 6. It should run on most other machines as well.
A main focus of the core library is the independence from third party libraries which the user would need to install. It was thus written such that it can be easily integrated into existing CMake projects without adding further dependencies.
A Desktop User Interface (UI) has been written, using QT and OpenGL, enabling the live visualisation of simulation data, including spins and energy gradients. Charts help to visualise the current state with energy plots, including interpolated energies for transitions. For use on clusters or e.g. when a graphical user interface is not needed, the core library can be scripted from Python or Julia. Alternatively, a C++ console version is available, where the user can easily modify the main.cpp to suit his needs.
Due to the modular structure and the highly portable core library, a wide variety of further UIs are theoretically possible.
Visualise without optimisation
- e.g. Magnetic field, Effective field, Spin configuration, …
- Read in from File or create states from UI
Spin Dynamics Simulations (LLG Solvers)
- Choice of Hamiltonian (Isotropic, Anisotropic, non-heisenberg?, …) for Eff. Field and Energy
- Choice of Force (pure eff. Field, projections, …)
- Choice of Optimizer (SIB, Heun, Conj. Gradient, …) and corresponding Parameters. These should take a spin configuration and a force and do one optimisation iteration
- Run on a single image (choice of single image)
- Run on an image and save periodically into a chain
- Choice of Hamiltonian for eff. Field and energy
- Choice of Force (pure eff. Field, projections, spring forces, …)
- Choice of Optimizer for single images (Heun, …)
- Run on an image chain (choice of subset of image chain on which to iterate)
- Run on a collection of image chains, where each chain is built by saving the corresponding image periodically
- ASE compatibility? https://wiki.fysik.dtu.dk/ase/tutorials/surface.html
- ParaView connection?
- Uppsala Spin Code (link?)
- ASE (https://wiki.fysik.dtu.dk/ase/about.html)
- Eon (http://theory.cm.utexas.edu/eon)
Micromagnetics is quite different from atomistic spin treatments, but there is a significant overlap. A few examples of micromagnetic codes:
File I/O and User Input
- Manipulate visualisation
- Change Parameters of Simulations
- Start and Stop Simulations
- Code version and “run” information, e.g. version nr., initial state used, …
- Energies (.dat and .csv output file formats)
- Configurations, Atom Positions, Neighbours(.dat output format)
- Vector field (B-field, effective field)
- Video Capture
- Basis (Atom positions)
- Shape (Basis translations)
- Interaction constants (J_ij, D_ij, …)
- General constants (RNG Seed, …)
- modular input of Neighbours, spins, spin_pos and so on