Package: cmtj
CMTJShort descriptionA 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.DemoCheck out thestreamlit hosted demo here.QuickstartInstallation :rocket:Installation is as easy as doing:
A recommended way is to use thepippackage manager and virtualenv (or conda).Withvirtualenv(recommended):$(bash)python-mvenv.my-venv$(bash)source.my-venv/bin/activate$(.my-venv)python-mpipinstallcmtjStraight frompip:python3-mpipinstallcmtjStraight from source:python3-mpipinstallhttps://github.com/LemurPwned/cmtj.gitClone the repository:gitclonehttps://github.com/LemurPwned/cmtj.git
python3-mpipinstall.Extra dependenciesThe package requires (ifutilssubpackage is used):- numpy
- scipy
- matplotlibSubpackagesgraph TD;
cmtj --> models
cmtj --> utils
models --> domain_dynamics
models --> drivers
models --> ensemble
models --> general_sb
models --> oersted
utils --> optimization
utils --> parallel
utils --> plotting
utils --> procedures
utils --> resistance
utils --> solvers
utils --> linear
utils --> energy
utils --> filtersRead the docsDocumentation:https://lemurpwned.github.io/cmtjExtensionsThere's a GUI version available! If you wish to conduct a subset of simulations, mainly for experimental modelling, please see thePyMagproject. It uses CMTJ as a backend for fast computation.CitingWe 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@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},}DevelopmentAcknowledgementsMany thanks to professor Jack Sankey for his help with the development of thermal contributions, with inspiration from themacrospinmob project.ContributionsAll contributions are welcome, please leave an issue if you've encountered any trouble with setup or running the library.DockerIn thedockerdirectory there's aDockerfilethat can be used to build a docker image with the library installed.Dockerfile.appis used for streamlit development.PrecommitThere's a.pre-commit-config.yamlthat 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 -vorpre-commit run -a (or --files core/* cmtj/*)Documentation buildsThere are couple of stages to building the documentationBuild Doxygen documentationdoxygen DoxyfileThis is mostly for the C++ documentation. Furture changes may couple C++ and Python docs.Build stubs
The stubgen ispybind11-stubgenormypy stubgenwith the latter being preferred now.
E.g. to generateStackmodule stubs we can go:stubgen -m cmtj.stack -o target-stub-dir/More info here:https://mypy.readthedocs.io/en/stable/stubgen.html.Parse stubs to Markdown.
This stage is done by running:python3 docs/docgen.pyThe deployment of the documentation is done via:mkdocsgh-deployBut first, worth a check:mkdocsserve