cmtj

Simulate multilayer magnetic structures in Python and C++

https://github.com/lemurpwned/cmtj

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: nature.com
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary

Keywords

condensed-phase-simulations electronics llg llgs macrospin magnetics mtj python spintronics stochastic-differential-equations

Keywords from Contributors

diffusion interactive hdfs graph-generation mesh interpretability profiles sequences generic projection
Last synced: 6 months ago · JSON representation ·

Repository

Simulate multilayer magnetic structures in Python and C++

Basic Info
Statistics
  • Stars: 37
  • Watchers: 3
  • Forks: 5
  • Open Issues: 17
  • Releases: 0
Topics
condensed-phase-simulations electronics llg llgs macrospin magnetics mtj python spintronics stochastic-differential-equations
Created over 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Citation

README.md

CMTJ

PyPI pages-build-deployment Version License Streamlit PyPI Downloads

Table of contents

Short description

The cmtj name may be misleading -- the MTJ (Magnetic Tunnel Junctions) are not the only structures that may be simulated. The library allows for macromagnetic simulation of various multilayer spintronic structures. The package uses C++ implementation of (s)LLGS (stochastic Landau-Lifschitz-Gilbert-Slonczewski) equation with various field contributions included for instance: anisotropy, interlayer exchange coupling, demagnetisation, dipole fields etc. It is also possible to connect devices in parallel or in series to have electrically coupled arrays.

What can you simulate?

Below is a brief list of examples (it's not exhaustive! Check the docs for more).

Magnetic devices:

  • Magnetic Tunnel Junctions
    • Voltage-Driven Magnetic Tunnel Junctions
    • Spin-Torque Oscillators
    • VCMA sensors and devices
    • Magnetic Tunnel Junction Arrays
  • SOT devices
    • Current-Driven SOT
  • Advanced device coupling
  • Reservoirs (dipole coupling)
  • Electrically coupled MTJs
  • Base equations
    • Landau-Lifshitz-Gilbert-Slonczewski equation
    • Stochastic Landau-Lifshitz-Gilbert-Slonczewski equation
    • Landau-Lifshitz-Gilbert-Bloch equation
  • Domain wall motion

Experimental methods:

Some of the experimental methods available:

  • PIMM
  • Spin-Diode
  • CIMS
  • R(H), M(H)

Web GUI

Check out the streamlit hosted demo here. You can simulate:

  • PIMM spectra and Spin-Diode spectra
  • Try some optimization fitting
  • Fit multi-domain or multi-level M(H) or R(H) loops in Domain mode

Let us know if you have any issues with the demo.

Quickstart

Installation :rocket:

The recommended way is to use the pip package manager and virtualenv (or conda). Installation is as easy as doing:

  1. With virtualenv (recommended):

bash $(bash) python -m venv .my-venv $(bash) source .my-venv/bin/activate $(.my-venv) python -m pip install cmtj

  1. Straight from pip:

bash python3 -m pip install cmtj

  1. Straight from source:

bash python3 -m pip install git+https://github.com/LemurPwned/cmtj.git

  1. Clone the repository:

bash git clone https://github.com/LemurPwned/cmtj.git python3 -m pip install .

Extra dependencies

The package requires (if utils subpackage is used):

- numpy - scipy - matplotlib

Documentation and examples

Documentation: https://lemurpwned.github.io/cmtj. There are many examples available, check out the examples section in the docs

Extensions

There's a GUI version available! If you wish to conduct a subset of simulations, mainly for experimental modelling, please see the PyMag project. It uses CMTJ as a backend for fast computation.

Citing

We would appreciate citing either of the listed work if you decide to use the project or using the cite button on the right hand side panel of the repository:

cmtj: Simulation package for analysis of multilayer spintronic devices

bibtex @article{mojsiejuk_cmtj_2023, title = {cmtj: Simulation package for analysis of multilayer spintronic devices}, volume = {9}, issn = {2057-3960}, url = {https://www.nature.com/articles/s41524-023-01002-x}, doi = {10.1038/s41524-023-01002-x}, pages = {54}, number = {1}, journaltitle = {npj Comput Mater}, author = {Mojsiejuk, Jakub and Ziętek, Sławomir and Grochot, Krzysztof and Skowroński, Witold and Stobiecki, Tomasz}, date = {2023-04-06}, }

Development

Acknowledgements

Many thanks to professor Jack Sankey for his help with the development of thermal contributions, with inspiration from the macrospinmob project.

Contributions

All contributions are welcome, please leave an issue if you've encountered any trouble with setup or running the library.

Docker

In the docker directory there's a Dockerfile that can be used to build a docker image with the library installed. Dockerfile.app is used for streamlit development.

Precommit

There's a .pre-commit-config.yaml that does some basic python and cpp lints and checks. More static analysis to come in the future. This may be run with:

pre-commit run -v

or

pre-commit run -a (or --files core/* cmtj/*)

Documentation builds

Note For stub generation add __init__.py to the cmtj directory.

There are a couple of stages to building the documentation

  1. Build Doxygen documentation doxygen Doxyfile This is mostly for the C++ documentation. Future changes may couple C++ and Python docs.
  2. Build stubs The stubgen is pybind11-stubgen or mypy stubgen with the latter being preferred now. Before running the stubgen, make sure to install the package with: python3 -m pip install . avoid using -e flag as it may cause issues with the stubgen. Then to generate, for instance, Stack module stubs we can do: stubgen -m cmtj.stack -o target-stub-dir/ or python3 -c "import mypy.stubgen; mypy.stubgen.main(['-p', 'cmtj.stack', '-o', 'target-stub-dir/'])" More info here: https://mypy.readthedocs.io/en/stable/stubgen.html.
  3. Parse stubs to Markdown. This stage is done by running: python3 docs/docgen.py The deployment of the documentation is done via: bash mkdocs gh-deploy But first, worth a check: bash mkdocs serve

Owner

  • Name: Jakub
  • Login: LemurPwned
  • Kind: user
  • Location: Krakow

I was a normal guy once. Don't take Clojure kiddos.

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: cmtj
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Jakub
    family-names: Mojsiejuk
    orcid: 'https://orcid.org/0000-0001-7501-3250'
identifiers:
  - type: doi
    value: 10.1038/s41524-023-01002-x
  - type: url
    value: 'https://github.com/LemurPwned/cmtj'
repository-code: 'https://github.com/LemurPwned/cmtj'
url: 'https://lemurpwned.github.io/cmtj/'
abstract: >-
  We present CMTJ—a simulation package for large-scale
  macrospin analysis of multilayer spintronics devices.
  Apart from conventional simulations, such as
  magnetoresistance and magnetisation hysteresis loops, CMTJ
  implements a mathematical model of dynamic experimental
  techniques commonly used for spintronics devices
  characterisation, for instance: spin diode ferromagnetic
  resonance, pulse-induced microwave magnetometry, or
  harmonic Hall voltage measurements. We find that macrospin
  simulations offer a satisfactory level of agreement,
  demonstrated by a variety of examples. As a unified
  simulation package, CMTJ aims to accelerate wide-range
  parameter search in the process of optimising spintronics
  devices.
keywords:
  - spintronics
  - magnetism
  - simulation
  - llg
  - magnetic tunnel junctions
  - spin
  - macrospin
license: AGPL-3.0
version: 1.3.0
preferred-citation:
  type: article
  authors:
  - family-names: "Mojsiejuk"
    given-names: "Jakub"
    orcid: "https://orcid.org/0000-0001-7501-3250"
  - family-names: "Ziętek"
    given-names: "Sławomir"
  - family-names: "Grochot"
    given-names: "Krzysztof"
  - family-names: "Skowroński"
    given-names: "Witold"
  - family-names: "Stobiecki"
    given-names: "Tomasz"
  doi: "10.1038/s41524-023-01002-x"
  journal: "npj Computational Materials"
  month: 4
  start: 54 # First page number
  title: "cmtj: Simulation package for analysis of multilayer spintronic devices"
  issue: 1
  volume: 9
  year: 2023

GitHub Events

Total
  • Create event: 25
  • Release event: 4
  • Issues event: 13
  • Watch event: 4
  • Delete event: 14
  • Issue comment event: 32
  • Push event: 82
  • Pull request review event: 29
  • Pull request review comment event: 47
  • Pull request event: 39
Last Year
  • Create event: 25
  • Release event: 4
  • Issues event: 13
  • Watch event: 4
  • Delete event: 14
  • Issue comment event: 32
  • Push event: 82
  • Pull request review event: 29
  • Pull request review comment event: 47
  • Pull request event: 39

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 536
  • Total Committers: 4
  • Avg Commits per committer: 134.0
  • Development Distribution Score (DDS): 0.028
Past Year
  • Commits: 81
  • Committers: 1
  • Avg Commits per committer: 81.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
LemurPwned j****k@g****m 521
jm c****4@m****m 8
dependabot[bot] 4****] 5
Sourcery AI u****n 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 38
  • Total pull requests: 78
  • Average time to close issues: 5 months
  • Average time to close pull requests: 12 days
  • Total issue authors: 1
  • Total pull request authors: 3
  • Average comments per issue: 0.18
  • Average comments per pull request: 0.53
  • Merged pull requests: 64
  • Bot issues: 0
  • Bot pull requests: 8
Past Year
  • Issues: 7
  • Pull requests: 32
  • Average time to close issues: 11 days
  • Average time to close pull requests: 3 days
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.09
  • Merged pull requests: 22
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • LemurPwned (36)
Pull Request Authors
  • LemurPwned (90)
  • dependabot[bot] (5)
  • sourcery-ai[bot] (3)
Top Labels
Issue Labels
enhancement (2)
Pull Request Labels
dependencies (5) codex (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,413 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 23
  • Total maintainers: 1
pypi.org: cmtj

CMTJ - C Magnetic Tunnel Junctions.

  • Versions: 23
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 1,413 Last month
Rankings
Dependent packages count: 7.3%
Downloads: 10.8%
Stargazers count: 12.1%
Average: 13.3%
Forks count: 14.3%
Dependent repos count: 22.1%
Maintainers (1)
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • cmtj ==1.1.2
  • mkdocs ==1.2.3
  • mkdocs-autorefs ==0.2.1
  • mkdocs-jupyter ==0.17.3
  • mkdocs-material ==7.1.11
  • mkdocs-material-extensions ==1.0.1
  • mkdocstrings ==0.15.2
  • numpy ==1.22.0
  • readthedocs-sphinx-search ==0.1.0rc3
  • scipy ==1.7.0
  • sphinx ==3.4.3
  • sphinx_rtd_theme ==0.5.1
.github/workflows/codeql-analysis.yml actions
  • actions/checkout v2 composite
  • github/codeql-action/analyze v1 composite
  • github/codeql-action/autobuild v1 composite
  • github/codeql-action/init v1 composite
.github/workflows/main.yml actions
  • RalfG/python-wheels-manylinux-build v0.5.0 composite
  • actions/checkout v2 composite
  • actions/checkout master composite
  • actions/setup-python v2 composite
  • ncipollo/release-action v1 composite
  • thedoctor0/zip-release main composite
Dockerfile docker
  • ubuntu 20.04 build
setup.py pypi