All Projects → spirit-code → Spirit

spirit-code / Spirit

Licence: mit
Atomistic Spin Simulation Framework

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Spirit

magpylib
Python package for computation of magnetic fields of magnets, currents and moments.
Stars: ✭ 95 (+41.79%)
Mutual labels:  physics, scientific, physics-simulation
Su2
SU2: An Open-Source Suite for Multiphysics Simulation and Design
Stars: ✭ 731 (+991.04%)
Mutual labels:  simulation, physics, optimization
Incoherent-Light-Simulation
Simulation of the propagation of incoherent light, aiming to illustrate the concept of spatial coherence.
Stars: ✭ 98 (+46.27%)
Mutual labels:  simulation, physics, physics-simulation
Polyfem
A polyvalent C++ FEM library
Stars: ✭ 147 (+119.4%)
Mutual labels:  cmake, cross-platform, simulation
Stuntrally
The main repository containing Stunt Rally sources and game data. A 3D racing game based on VDrift and OGRE with track editor.
Stars: ✭ 314 (+368.66%)
Mutual labels:  cmake, simulation, physics
Core
The core source repository for the Cherab project.
Stars: ✭ 26 (-61.19%)
Mutual labels:  framework, physics, scientific-computing
opem
OPEM (Open Source PEM Fuel Cell Simulation Tool)
Stars: ✭ 107 (+59.7%)
Mutual labels:  simulation, physics, physics-simulation
workshop
Workshop: Micromagnetics with Ubermag
Stars: ✭ 19 (-71.64%)
Mutual labels:  physics, visualisation, scientific-computing
Simpeg
Simulation and Parameter Estimation in Geophysics - A python package for simulation and gradient based parameter estimation in the context of geophysical applications.
Stars: ✭ 283 (+322.39%)
Mutual labels:  simulation, scientific-computing, optimization
GAMES103
notes and related materials for GAMES103
Stars: ✭ 21 (-68.66%)
Mutual labels:  simulation, physics, physics-simulation
Maze
Maze Applied Reinforcement Learning Framework
Stars: ✭ 85 (+26.87%)
Mutual labels:  framework, simulation, optimization
Sofa
Real-time multi-physics simulation with an emphasis on medical simulation.
Stars: ✭ 435 (+549.25%)
Mutual labels:  framework, simulation, physics
fdtd
A 3D electromagnetic FDTD simulator written in Python
Stars: ✭ 195 (+191.04%)
Mutual labels:  simulation, physics, physics-simulation
siconos
Simulation framework for nonsmooth dynamical systems
Stars: ✭ 120 (+79.1%)
Mutual labels:  simulation, optimization, scientific-computing
Ark
ARK is a lightweight, agility, elastic, distributed plugin framework written in C++,make it easier and faster to create your own application service.
Stars: ✭ 370 (+452.24%)
Mutual labels:  cmake, framework, cross-platform
Awesome Robotics
A curated list of awesome links and software libraries that are useful for robots.
Stars: ✭ 478 (+613.43%)
Mutual labels:  simulation, physics, optimization
Xtd forms
Modern c++17 library to create native gui for Microsoft Windows, Apple macOS and Linux.
Stars: ✭ 25 (-62.69%)
Mutual labels:  framework, cross-platform
Owl
Owl - OCaml Scientific and Engineering Computing @ http://ocaml.xyz
Stars: ✭ 919 (+1271.64%)
Mutual labels:  scientific-computing, optimization
Imagine Old
Modeling and simulations using computational graphs
Stars: ✭ 25 (-62.69%)
Mutual labels:  simulation, physics
Creeper
🐾 Creeper - The Next Generation Crawler Framework (Go)
Stars: ✭ 762 (+1037.31%)
Mutual labels:  framework, cross-platform

SPIRIT

SPIN SIMULATION FRAMEWORK

Logo

 

Core Library:

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

Python package: PyPI version

 

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 cite G. P. Müller et al., Phys. Rev. B 99, 224414 (2019) and read the docs/REFERENCE.md.

This is an open project and contributions and collaborations are always welcome!! See docs/CONTRIBUTING.md on how to contribute or write an email to [email protected]
For contributions and affiliations, see docs/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 the build instructions for Unix/OSX or Windows on how to get 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 (Unix/OSX, Windows) 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.start(p_state, simulation.METHOD_LLG, simulation.SOLVER_SIB)

Where SOLVER_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.plus_z(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 and set chain length
chain.image_to_clipboard(p_state)
noi = 7
chain.set_length(p_state, noi)

### First image is homogeneous with a Skyrmion in the center
configuration.plus_z(p_state, idx_image=0)
configuration.skyrmion(p_state, 5.0, phase=-90.0, idx_image=0)
simulation.start(p_state, simulation.METHOD_LLG, simulation.SOLVER_VP, idx_image=0)
### Last image is homogeneous
configuration.plus_z(p_state, idx_image=noi-1)
simulation.start(p_state, simulation.METHOD_LLG, simulation.SOLVER_VP, idx_image=noi-1)

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

### GNEB calculation
simulation.start(p_state, simulation.METHOD_GNEB, simulation.SOLVER_VP)

where SOLVER_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!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].