Skip to content


PyPI Documentation Status

Short description

The library allows for macromagnetic simulation of multilayer spintronic structures. A name may be misleading -- the MTJ (Magnetic Tunnel Junctions) are not the only structures that may be simulated.


Installation :rocket:

Installation is as easy as doing:

python3 -m install cmtj

If you prefer to clone the repo first and then install directly from the source:

git clone
python3 -m pip install .


Please view the Examples section to get a better grip of the library. Most of the code in there is for the Python bindings but if you prefer, you can always import headers from C++. The function names, library operation will be the same, only the utils submodule will be unavailable for the C++ code.


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.


Please cite if you decide to use the project

   title={{P}yMag - a tool for designing and investigation multilayer spintronics devices},
   author={Sławomir Ziętek, Jakub Mojsiejuk, Krzysztof Grochot, Stanisław Łazarski, Witold Skowroński},


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