{"id":13764615,"url":"https://github.com/spirit-code/spirit","last_synced_at":"2025-04-05T06:04:09.177Z","repository":{"id":37743096,"uuid":"69043835","full_name":"spirit-code/spirit","owner":"spirit-code","description":"Atomistic Spin Simulation Framework","archived":false,"fork":false,"pushed_at":"2025-03-12T10:53:08.000Z","size":35854,"stargazers_count":123,"open_issues_count":139,"forks_count":54,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-29T05:05:04.914Z","etag":null,"topics":["c-plus-plus","cmake","cross-platform","cuda-backend","forschungszentrum-juelich","framework","magnetism","optimization","physics","physics-simulation","python","scientific","scientific-computing","simulation","spin-dynamics","visualisation"],"latest_commit_sha":null,"homepage":"http://spirit-code.github.io","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spirit-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-23T16:51:17.000Z","updated_at":"2025-03-25T08:10:03.000Z","dependencies_parsed_at":"2024-01-07T18:03:22.828Z","dependency_job_id":"8c0f350a-3e81-4269-9b9a-86f33a3b4af3","html_url":"https://github.com/spirit-code/spirit","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirit-code%2Fspirit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirit-code%2Fspirit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirit-code%2Fspirit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirit-code%2Fspirit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spirit-code","download_url":"https://codeload.github.com/spirit-code/spirit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294516,"owners_count":20915340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","cmake","cross-platform","cuda-backend","forschungszentrum-juelich","framework","magnetism","optimization","physics","physics-simulation","python","scientific","scientific-computing","simulation","spin-dynamics","visualisation"],"created_at":"2024-08-03T16:00:23.953Z","updated_at":"2025-04-05T06:04:09.158Z","avatar_url":"https://github.com/spirit-code.png","language":"C++","readme":"SPIRIT\n=============================\n**SPIN SIMULATION FRAMEWORK**\u003cbr /\u003e\n\n\n![Logo](https://imgur.com/iWc1kuE.png \"Spirit Logo\")\n\n\n\u0026nbsp;\n\n\n**Core Library:**\n\n| Branch   | Build Status | Python Package Coverage | Core Library Coverage |\n| :------- | :----------: | :---------------------: | :-------------------: |\n| master:  | ![CI](https://github.com/spirit-code/spirit/workflows/CI/badge.svg?branch=master) | [![Coverage Status](https://coveralls.io/repos/github/spirit-code/spirit/badge.svg?branch=master)](https://coveralls.io/github/spirit-code/spirit?branch=master) | [![Coverage Status](https://codecov.io/gh/spirit-code/spirit/branch/master/graph/badge.svg)](https://codecov.io/gh/spirit-code/spirit/branch/master) |\n| develop: | ![CI](https://github.com/spirit-code/spirit/workflows/CI/badge.svg?branch=develop) | [![Coverage Status](https://coveralls.io/repos/github/spirit-code/spirit/badge.svg?branch=develop)](https://coveralls.io/github/spirit-code/spirit?branch=develop) | [![Coverage Status](https://codecov.io/gh/spirit-code/spirit/branch/develop/graph/badge.svg)](https://codecov.io/gh/spirit-code/spirit/branch/develop) |\n\n**[Python package](https://pypi.org/project/spirit/):** [![PyPI version](https://badge.fury.io/py/spirit.svg)](https://badge.fury.io/py/spirit)\n\n\n\u0026nbsp;\n\n\nThe code is released under [MIT License](LICENSE.txt).\u003cbr /\u003e\nIf you intend to *present and/or publish* scientific results or visualisations for which you used Spirit,\nplease cite [`G. P. Müller et al., Phys. Rev. B 99, 224414 (2019)`](https://link.aps.org/doi/10.1103/PhysRevB.99.224414) and read the [docs/REFERENCE.md](docs/REFERENCE.md).\n\n**This is an open project and contributions and collaborations are always welcome!!**\nSee [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md) on how to contribute or write an email to m.sallermann@fz-juelich.de\u003cbr /\u003e\nFor contributions and affiliations, see [docs/CONTRIBUTORS.md](docs/CONTRIBUTORS.md).\n\nPlease note that a version of the *Spirit Web interface* is hosted by the Research Centre Jülich at\nhttp://juspin.de\n\n\n\u0026nbsp;\n\n\u003c!--\n![nur ein Beispiel](https://commons.wikimedia.org/wiki/File:Example_de.jpg \"Beispielbild\")\n--\u003e\n\n![Skyrmions](http://imgur.com/JgPj8t5.jpg \"Skyrmions on a 2D grid\")\n\n\u0026nbsp;\n\n\n\nContents\n--------\n\n1. [Introduction](#Introduction)\n2. [Getting started with the Desktop User Interface](#Desktop)\n3. [Getting started with the Python Package](#Python)\n\n---------------------------------------------\n\n\n\n\u0026nbsp;\n\n\n\nIntroduction \u003ca name=\"Introduction\"\u003e\u003c/a\u003e\n---------------------------------------------\n\n#### A modern framework for magnetism science on clusters, desktops \u0026 laptops and even your Phone\n\n**Spirit** is a **platform-independent** framework for spin dynamics, written in C++14.\nIt combines the traditional cluster work, using using the command-line, with modern\nvisualisation capabilites in order to maximize scientists' productivity.\n\n\u003e \"It is unworthy of excellent men to lose hours like slaves in\n\u003e  the labour of calculation which could safely be relegated to\n\u003e  anyone else if machines were used.\"\n\u003e - Gottfried Wilhelm Leibniz\n\n*Our goal is to build such machines*. The core library of the *Spirit* framework provides an\n**easy to use API**, which can be used from almost any programming language,\nand includes ready-to-use python bindings.\nA **powerful desktop user interface** is available, providing real-time visualisation and\ncontrol of parameters.\n\n### *Physics Features*\n\n- Atomistic Spin Lattice Heisenberg Model including also DMI and dipole-dipole\n- **Spin Dynamics simulations** obeying the\n  [Landau-Lifschitz-Gilbert equation](https://en.wikipedia.org/wiki/Landau%E2%80%93Lifshitz%E2%80%93Gilbert_equation)\n- Direct **Energy minimisation** with different solvers\n- **Minimum Energy Path calculations** for transitions between different\n  spin configurations, using the GNEB method\n\n### *Highlights of the Framework*\n\n- Cross-platform: everything can be built and run on Linux, OSX and Windows\n- Standalone core library with C API which can be used from almost any programming language\n- **Python package** making complex simulation workflows easy\n- Desktop UI with powerful, live **3D visualisations** and direct control of most system parameters\n- Modular backends including **parallelisation on GPU** (CUDA) and **CPU** (OpenMP)\n\n### *Documentation*\n\nMore details may be found at [spirit-docs.readthedocs.io](http://spirit-docs.readthedocs.io)\nor in the [Reference section](docs/README.md) including\n\n- [Unix/OSX build instructions](docs/Build_Unix_OSX.md)\n- [Windows build instructions](docs/Build_Windows.md)\n- [Input File Reference](core/docs/Input.md)\n\nThere is also a [Wiki](https://iffwiki.fz-juelich.de/index.php/Spirit \"Click me...\"),\nhosted by the Research Centre Jülich.\n\n---------------------------------------------\n\n\n\n\u0026nbsp;\n\n\n\nGetting started with the Desktop Interface \u003ca name=\"Desktop\"\u003e\u003c/a\u003e\n---------------------------------------------\n\nSee the build instructions for [Unix/OSX](docs/Build_Unix_OSX.md) or\n[Windows](docs/Build_Windows.md) on how to get the desktop user interface.\n\n![Desktop UI with Isosurfaces in a thin layer](http://imgur.com/QUcN4aG.jpg \"Isosurfaces in a thin layer\")\n\nThe user interface provides a powerful OpenGL visualisation window\nusing the [VFRendering](https://github.com/FlorianRhiem/VFRendering) library.\nIt provides functionality to\n\n- Control Calculations\n- Locally insert Configurations (homogeneous, skyrmions, spin spiral, ... )\n- Generate homogeneous Transition Paths\n- Change parameters of the Hamiltonian\n- Change parameters of the Method and Solver\n- Configure the Visualization (arrows, isosurfaces, lighting, ...)\n\nSee the [UI-QT Reference](docs/UI-Qt.md) for the key bindings of the various features.\n\n*Unfortunately, distribution of binaries for the Desktop UI is not possible due\nto the restrictive license on QT-Charts.*\n\n---------------------------------------------\n\n\n\n\u0026nbsp;\n\n\n\nGetting started with the Python Package \u003ca name=\"Python\"\u003e\u003c/a\u003e\n---------------------------------------------\n\nTo install the *Spirit python package*, either build and install from source\n([Unix/OSX](docs/Build_Unix_OSX.md), [Windows](docs/Build_Windows.md)) or\nsimply use\n\n    pip install spirit\n\nWith this package you have access to powerful Python APIs to run and control\ndynamics simulations or optimizations.\nThis is especially useful for work on clusters, where you can now script your\nworkflow, never having to re-compile when testing, debugging or adding features.\n\nThe most simple example of a **spin dynamics simulation** would be\n``` python\nfrom spirit import state, simulation\nwith state.State(\"input/input.cfg\") as p_state:\n    simulation.start(p_state, simulation.METHOD_LLG, simulation.SOLVER_SIB)\n```\nWhere `SOLVER_SIB` denotes the semi-implicit method B and the starting configuration\nwill be random.\n\nTo add some meaningful content, we can change the **initial configuration** by\ninserting a Skyrmion into a homogeneous background:\n``` python\ndef skyrmion_on_homogeneous(p_state):\n    from spirit import configuration\n    configuration.plus_z(p_state)\n    configuration.skyrmion(p_state, 5.0, phase=-90.0)\n```\n\nIf we want to calculate a **minimum energy path** for a transition, we need to generate\na sensible initial guess for the path and use the **GNEB method**. Let us consider\nthe collapse of a skyrmion to the homogeneous state:\n``` python\nfrom spirit import state, chain, configuration, transition, simulation\n\n### Copy the system and set chain length\nchain.image_to_clipboard(p_state)\nnoi = 7\nchain.set_length(p_state, noi)\n\n### First image is homogeneous with a Skyrmion in the center\nconfiguration.plus_z(p_state, idx_image=0)\nconfiguration.skyrmion(p_state, 5.0, phase=-90.0, idx_image=0)\nsimulation.start(p_state, simulation.METHOD_LLG, simulation.SOLVER_VP, idx_image=0)\n### Last image is homogeneous\nconfiguration.plus_z(p_state, idx_image=noi-1)\nsimulation.start(p_state, simulation.METHOD_LLG, simulation.SOLVER_VP, idx_image=noi-1)\n\n### Create transition of images between first and last\ntransition.homogeneous(p_state, 0, noi-1)\n\n### GNEB calculation\nsimulation.start(p_state, simulation.METHOD_GNEB, simulation.SOLVER_VP)\n```\nwhere `SOLVER_VP` denotes a direct minimization with the velocity projection algorithm.\n\nYou may also use *Spirit* order to **extract quantitative data**, such as the energy.\n``` python\ndef evaluate(p_state):\n    from spirit import system, quantities\n    M = quantities.get_magnetization(p_state)\n    E = system.get_energy(p_state)\n    return M, E\n```\n\nObviously you may easily create significantly more complex workflows and use Python\nto e.g. pre- or post-process data or to distribute your work on a cluster and much more!","funding_links":[],"categories":["Electromagnetism"],"sub_categories":["Sound"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspirit-code%2Fspirit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspirit-code%2Fspirit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspirit-code%2Fspirit/lists"}