Atomistic Spin Simulation Framework
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Minor: updated AppVeyor CI QT paths, fixed PR template and Method_MC. May 28, 2018
CMake CMake: improved compile flags and added default build type. Jan 31, 2018
VFRendering Updated VFRendering to 0.11.0. Jan 3, 2018
core Bugfix for some crashes in Hamiltonian API and improvements. Jul 6, 2018
docs Fixed conf.py for documentation generation. Jun 13, 2018
input Bugfix for some crashes in Hamiltonian API and improvements. Jul 6, 2018
output INIT Jul 6, 2016
thirdparty/qhull Moved Eigen and Spectra to core/thirdparty. Dec 6, 2016
ui-cpp Bugfix for some crashes in Hamiltonian API and improvements. Jul 6, 2018
ui-julia Core: refactoring spirit to self-contained library Feb 10, 2017
ui-python Core: fixes and improvements for MC Method. May 23, 2018
ui-web Added Version functions to Core API and used them in QT and Web UIs. Jan 23, 2018
.appveyor.yml Minor: updated AppVeyor CI QT paths, fixed PR template and Method_MC. May 28, 2018
.gitignore UI-Web: fixed some issues with building the javascript module. Jan 23, 2018
.travis.yml CI: fixed QT path on Travis OSX build and UI-CPP QT includes. May 23, 2018
CMakeLists.txt UI-Web: fixed some issues with building the javascript module. Jan 23, 2018
LICENSE.txt Improved documentation. Apr 7, 2017
README.md Minor documentation update. Jun 13, 2018
build_python.sh Core: clean python package build. May 28, 2017
clean.sh Core: improved locking for image chains. Apr 10, 2017
clean_log.sh Core: added chain API functions. Jan 31, 2017
clean_output.sh Bugfixes: llg file output and SIB spin torque. Mar 27, 2017
cmake.sh Fixed scripts for CIs. May 15, 2017
conf.py Fixed conf.py for documentation generation. Jun 13, 2018
ctest.sh Re-simpliefied ctest.sh Aug 11, 2017
install.sh Fixed scripts for CIs. May 15, 2017
make.sh Fixed scripts for CIs. May 15, 2017

README.md

SPIRIT

SPIN SIMULATION FRAMEWORK

 

Core Library:

Service System Compiler Status
Travis-CI Ubuntu 14.04
macOS
GCC 6
Clang
master: Build Status
develop: Build Status
AppVeyor Windows MSVC14
MSVC14.1
master: Build status
develop: Build status

Python package: PyPI version

Branch Python Package Coverage Core Library Coverage
master: Coverage Status Coverage Status
develop: Coverage Status Coverage Status

 

The code is released under MIT License.
If you intend to present and/or publish scientific results or visualisations for which you used Spirit, please read the REFERENCE.md

This is an open project and contributions and collaborations are always welcome!! See CONTRIBUTING.md on how to contribute or write an email to g.mueller@fz-juelich.de
For contributions and affiliations, see CONTRIBUTORS.md.

Please note that a version of the Spirit Web interface is hosted by the Research Centre Jülich at http://juspin.de

 

Skyrmions

 

Contents

  1. Introduction
  2. Getting started with the Desktop User Interface
  3. Getting started with the Python Package

 

Introduction

A modern framework for magnetism science on clusters, desktops & laptops and even your Phone

Spirit is a platform-independent framework for spin dynamics, written in C++11. It combines the traditional cluster work, using using the command-line, with modern visualisation capabilites in order to maximize scientists' productivity.

"It is unworthy of excellent men to lose hours like slaves in the labour of calculation which could safely be relegated to anyone else if machines were used."

  • Gottfried Wilhelm Leibniz

Our goal is to build such machines. The core library of the Spirit framework provides an easy to use API, which can be used from almost any programming language, and includes ready-to-use python bindings. A powerful desktop user interface is available, providing real-time visualisation and control of parameters.

Physics Features

  • Atomistic Spin Lattice Heisenberg Model including also DMI and dipole-dipole
  • Spin Dynamics simulations obeying the Landau-Lifschitz-Gilbert equation
  • Direct Energy minimisation with different solvers
  • Minimum Energy Path calculations for transitions between different spin configurations, using the GNEB method

Highlights of the Framework

  • Cross-platform: everything can be built and run on Linux, OSX and Windows
  • Standalone core library with C API which can be used from almost any programming language
  • Python package making complex simulation workflows easy
  • Desktop UI with powerful, live 3D visualisations and direct control of most system parameters
  • Modular backends including parallelisation on GPU (CUDA) and CPU (OpenMP)

Documentation

More details may be found at spirit-docs.readthedocs.io or in the Reference section including

There is also a Wiki, hosted by the Research Centre Jülich.


 

Getting started with the Desktop Interface

See BUILD.md on how to install the desktop user interface.

Desktop UI with Isosurfaces in a thin layer

The user interface provides a powerful OpenGL visualisation window using the VFRendering library. It provides functionality to

  • Control Calculations
  • Locally insert Configurations (homogeneous, skyrmions, spin spiral, ... )
  • Generate homogeneous Transition Paths
  • Change parameters of the Hamiltonian
  • Change parameters of the Method and Solver
  • Configure the Visualization (arrows, isosurfaces, lighting, ...)

See the UI-QT Reference for the key bindings of the various features.

Unfortunately, distribution of binaries for the Desktop UI is not possible due to the restrictive license on QT-Charts.


 

Getting started with the Python Package

To install the Spirit python package, either build and install from source or simply use

pip install spirit

With this package you have access to powerful Python APIs to run and control dynamics simulations or optimizations. This is especially useful for work on clusters, where you can now script your workflow, never having to re-compile when testing, debugging or adding features.

The most simple example of a spin dynamics simulation would be

    from spirit import state, simulation
    with state.State("input/input.cfg") as p_state:
        simulation.PlayPause(p_state, "LLG", "SIB")

Where "SIB" denotes the semi-implicit method B and the starting configuration will be random.

To add some meaningful content, we can change the initial configuration by inserting a Skyrmion into a homogeneous background:

    def skyrmion_on_homogeneous(p_state):
        from spirit import configuration
        configuration.PlusZ(p_state)
        configuration.Skyrmion(p_state, 5.0, phase=-90.0)

If we want to calculate a minimum energy path for a transition, we need to generate a sensible initial guess for the path and use the GNEB method. Let us consider the collapse of a skyrmion to the homogeneous state:

    from spirit import state, chain, configuration, transition, simulation 

    ### Copy the system a few times
    chain.Image_to_Clipboard(p_state)
    for number in range(1,7):
        chain.Insert_Image_After(p_state)
    noi = chain.Get_NOI(p_state)

    ### First image is homogeneous with a Skyrmion in the center
    configuration.PlusZ(p_state, idx_image=0)
    configuration.Skyrmion(p_state, 5.0, phase=-90.0, idx_image=0)
    simulation.PlayPause(p_state, "LLG", "VP", idx_image=0)
    ### Last image is homogeneous
    configuration.PlusZ(p_state, idx_image=noi-1)
    simulation.PlayPause(p_state, "LLG", "VP", idx_image=noi-1)

    ### Create transition of images between first and last
    transition.Homogeneous(p_state, 0, noi-1)

    ### GNEB calculation
    simulation.PlayPause(p_state, "GNEB", "VP")

where "VP" denotes a direct minimization with the velocity projection algorithm.

You may also use Spirit order to extract quantitative data, such as the energy.

    def evaluate(p_state):
        from spirit import system, quantities
        M = quantities.Get_Magnetization(p_state)
        E = system.Get_Energy(p_state)
        return M, E

Obviously you may easily create significantly more complex workflows and use Python to e.g. pre- or post-process data or to distribute your work on a cluster and much more!