Skip to main content

CMTJ - C Magnetic Tunnel Junctions.

Project description

CMTJ

PyPI pages-build-deployment Version License Streamlit Downloads

Short description

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.

Demo

Check out the streamlit hosted demo here.

Quickstart

Installation :rocket:

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

  1. With virtualenv (recommended):
$(bash) python -m venv .my-venv
$(bash) source .my-venv/bin/activate
$(.my-venv) python -m pip install cmtj
  1. Straight from pip:
python3 -m pip install cmtj
  1. Straight from source:
python3 -m pip install https://github.com/LemurPwned/cmtj.git
  1. Clone the repository:
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

Read the docs

Documentation: https://lemurpwned.github.io/cmtj

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

@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

There are couple of stages to building the documentation

  1. Build Doxygen documentation
    doxygen Doxyfile
    
    This is mostly for the C++ documentation. Furture changes may couple C++ and Python docs.
  2. Build stubs The stubgen is pybind11-stubgen or mypy stubgen with the latter being preferred now. E.g. to generate Stack module stubs we can go:
    stubgen -m 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:
    mkdocs gh-deploy
    
    But first, worth a check:
    mkdocs serve
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

cmtj-1.4.0-cp311-cp311-win_amd64.whl (223.0 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

cmtj-1.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

cmtj-1.4.0-cp311-cp311-macosx_10_9_universal2.whl (607.9 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

cmtj-1.4.0-cp310-cp310-win_amd64.whl (221.7 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

cmtj-1.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

cmtj-1.4.0-cp310-cp310-macosx_11_0_x86_64.whl (324.0 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ x86-64

cmtj-1.4.0-cp39-cp39-win_amd64.whl (223.2 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

cmtj-1.4.0-cp39-cp39-macosx_11_0_x86_64.whl (324.1 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ x86-64

cmtj-1.4.0-cp38-cp38-win_amd64.whl (223.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

cmtj-1.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

cmtj-1.4.0-cp38-cp38-macosx_11_0_x86_64.whl (324.0 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ x86-64

cmtj-1.4.0-cp37-cp37m-win_amd64.whl (221.7 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

cmtj-1.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

cmtj-1.4.0-cp37-cp37m-macosx_11_0_x86_64.whl (318.7 kB view hashes)

Uploaded CPython 3.7m macOS 11.0+ x86-64

cmtj-1.4.0-cp36-cp36m-win_amd64.whl (221.6 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

cmtj-1.4.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

cmtj-1.4.0-cp36-cp36m-macosx_10_14_x86_64.whl (318.4 kB view hashes)

Uploaded CPython 3.6m macOS 10.14+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page