A 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.
Installation is as easy as doing:
A recommended way is to use the pip
package manager and virtualenv (or conda).
- With
virtualenv
$(bash) python -m venv .my-venv
$(bash) source .my-venv/bin/activate
$(.my-venv) python -m pip install cmtj
- Straight from
pip
:
python3 -m pip install cmtj
- Straight from source:
python3 -m pip install https://github.com/LemurPwned/cmtj.git
- Clone the repository:
git clone https://github.com/LemurPwned/cmtj.git
python3 -m pip install .
The package requires (if utils
subpackage is used):
- numpy
- scipy
- matplotlib
Documentation: https://lemurpwned.github.io/cmtj
Read more in do the docs here.
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.
We would appreciate citing either of the listed work if you decide to use the project:
@article{PhysRevB.106.024403,
title = {Numerical model of harmonic Hall voltage detection for spintronic devices},
author = {Zi\ifmmode \mbox{\k{e}}\else \k{e}\fi{}tek, S\l{}awomir and Mojsiejuk, Jakub and Grochot, Krzysztof and \L{}azarski, Stanis\l{}aw and Skowro\ifmmode \acute{n}\else \'{n}\fi{}ski, Witold and Stobiecki, Tomasz},
journal = {Phys. Rev. B},
volume = {106},
issue = {2},
pages = {024403},
numpages = {9},
year = {2022},
month = {Jul},
publisher = {American Physical Society},
doi = {10.1103/PhysRevB.106.024403},
url = {https://link.aps.org/doi/10.1103/PhysRevB.106.024403}
}
@article{mojsiejuk_comprehensive_2022,
title = {A comprehensive simulation package for analysis of multilayer spintronic devices},
url = {http://arxiv.org/abs/2207.11606},
number = {{arXiv}:2207.11606},
publisher = {{arXiv}},
author = {Mojsiejuk, Jakub and Ziętek, Sławomir and Grochot, Krzysztof and Skowroński, Witold and Stobiecki, Tomasz},
urldate = {2022-07-26},
date = {2022-07-23},
langid = {english},
eprinttype = {arxiv},
eprint = {2207.11606 [cond-mat]},
keywords = {Condensed Matter - Materials Science},
}
All contributions are welcome, please leave an issue if you've encountered any trouble with setup or running the library.
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/*)
There are couple of stages to building the documentation
- Build Doxygen documentation
This is mostly for the C++ documentation. Furture changes may couple C++ and Python docs.
doxygen Doxyfile
- Build stubs
The stubgen is
pybind11-stubgen
ormypy stubgen
with the latter being preferred now. E.g. to generateStack
module stubs we can go:More info here: https://mypy.readthedocs.io/en/stable/stubgen.html.stubgen -m cmtj.stack -o target-stub-dir/
- Parse stubs to Markdown.
This stage is done by running:
python3 docs/docgen.py
The deployment of the documentation is done via:
mkdocs gh-deploy