Skip to main content

CMTJ - C Magnetic Tunnel Junctions.

Project description

CMTJ

PyPI pages-build-deployment Version License Streamlit 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.

Web GUI

Check out the streamlit hosted demo here. You can simulate PIMM spectra and Spin-Diode spectra there. 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) 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 git+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

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

@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. 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:
    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.5.4-cp312-cp312-win_amd64.whl (271.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

cmtj-1.5.4-cp312-cp312-macosx_10_9_universal2.whl (642.9 kB view details)

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

cmtj-1.5.4-cp311-cp311-win_amd64.whl (269.1 kB view details)

Uploaded CPython 3.11 Windows x86-64

cmtj-1.5.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

cmtj-1.5.4-cp311-cp311-macosx_10_9_universal2.whl (636.1 kB view details)

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

cmtj-1.5.4-cp310-cp310-win_amd64.whl (268.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

cmtj-1.5.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

cmtj-1.5.4-cp310-cp310-macosx_10_9_universal2.whl (634.2 kB view details)

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

cmtj-1.5.4-cp39-cp39-win_amd64.whl (262.6 kB view details)

Uploaded CPython 3.9 Windows x86-64

cmtj-1.5.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

cmtj-1.5.4-cp39-cp39-macosx_10_9_universal2.whl (634.4 kB view details)

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

cmtj-1.5.4-cp38-cp38-win_amd64.whl (270.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

cmtj-1.5.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

cmtj-1.5.4-cp38-cp38-macosx_11_0_universal2.whl (634.3 kB view details)

Uploaded CPython 3.8 macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file cmtj-1.5.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cmtj-1.5.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 271.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for cmtj-1.5.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 523f99011467729695fe7a4e5e1d19b5b90626630ebbfefd61dc8bb3e330e7ed
MD5 91815e0e5b52ac3aea76a67f11453f4c
BLAKE2b-256 06fc04368cdb045b6b7d6455d733c5f0062fc36fc3d65d74c53829110a142a58

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cmtj-1.5.4-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b11b5b2f82a01590685fb182735003cec991e08a55b3f82d825f57f807ad6f4a
MD5 ce465a040ea65878d435b54870884717
BLAKE2b-256 5a72ae15893619f54e19a4b905a9b5c208aa9dcb8a189953a92544d2886d2b17

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: cmtj-1.5.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 269.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for cmtj-1.5.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b50c0289c1a7192c9630e9524a350f6f19b1e3315323d5644bcc98daf8780705
MD5 5c79d57e882c193913987b63d204db92
BLAKE2b-256 98d8c1161a8569ff8c3c94726f9ef46dc1a967b0cb5f2377d9bd68b819ced826

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cmtj-1.5.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f3bd70da29b32696f2c608d2d210d9cdd667550a3b8723a24bc9bd6ee063b2f4
MD5 9b66cdfa67db8e95a97f91645a9cb1b3
BLAKE2b-256 b4c3cabd65bd2bd73d6d3e3d14499fc882aaaad75b1b7e560bb77d794062d913

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cmtj-1.5.4-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a895659c0f54f6c64c06ea76ee9ed3f37c1b4cab6b1d5c7c0e5d7b47facf0879
MD5 9e8c99a67d42ad06b835b204a7bb907a
BLAKE2b-256 a10108e016e02815f9d3eccb8e678d505055b7865660732adb2aeed7f4c3c545

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: cmtj-1.5.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 268.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for cmtj-1.5.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 19303a74552a0330b87c423922b75dfd436b506f133bd90623510e5edabf350e
MD5 c90a7a76ee1f62b9632807b5c676b1a5
BLAKE2b-256 635702bc46fbb82d2950311a613c7bbdffb7b9eff45952406fb2ec366bc77a9f

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cmtj-1.5.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0209b3ea2d76ca509cf060a95739c31e56cd81664c93d76954c22d3ac34b59cc
MD5 8a081911d34c272aa9c9ce534faf9bc0
BLAKE2b-256 f78ebf07d029cde8311253f1c1ff9a945cbaa492b83b4423e7158638cda9ffcf

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cmtj-1.5.4-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 30602da76cc8484d96b4250dfb1c6db8de64709b86fa70a671fe0ead21d9159e
MD5 dcdf2a7493394e4e6a0403727af7f33a
BLAKE2b-256 ab4b1c1c0c5c4e101c6b5d07991c5055d989d18a8f592d323cfd5a8eaf821dc6

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: cmtj-1.5.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 262.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.13

File hashes

Hashes for cmtj-1.5.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 f036764939dd97210ba498b595fffb4a90b210eba71d9c7e3ecb62d1aa7a2198
MD5 3d36c3ae32000e30dadcc54721cc3350
BLAKE2b-256 72e570bd16d61c56e0d8c7c2bfe62bbfffccb8af200a01203568cfef2f7d26c0

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cmtj-1.5.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6e16b944cdfab1af3206b93f1c55f7c3e1497bc16b7cfdbeadbe24f55c9e3fa
MD5 fa96a1822bac22dedb0814e58341a877
BLAKE2b-256 c0615ef30eced17caaaf9ea7469d7198134a9e35756384a82e9045eff1bc9e33

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for cmtj-1.5.4-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e518a09d6e79f05e000f2e49320d3b0259c212d144bdb62dbfe79560f1409ec8
MD5 9537d5cbb3b6356c987c285cc38cef4d
BLAKE2b-256 e3f6498fceef7dd79c77a0a2571d52fb15a83ba1e0673b7d718859639b741d96

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: cmtj-1.5.4-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 270.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for cmtj-1.5.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b0637b0f9b9732baeba1d7550ca699a737503f0a1318cbd42716915ad9ea7e8a
MD5 7d1f72f56dda69a09737f3eb51e374b4
BLAKE2b-256 70ed9c4fc44de9e289e0663131cadc283e33d979b7400beaea6c6b1f2d221bdc

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cmtj-1.5.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2c7ca75e130d3022dff861f4f98b74683696c31ffac70adafb456f9bce5542e8
MD5 9f1aaf79817aaefccb5783950d74243e
BLAKE2b-256 e216368c34ac092b6c95f691ac556a114dbf25ae40d96edaba410899ac4d3a27

See more details on using hashes here.

File details

Details for the file cmtj-1.5.4-cp38-cp38-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for cmtj-1.5.4-cp38-cp38-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 8f99c67f3455f58d02dc2e2e337e2cb6e4bf9c1607869c96079cf6c8587a9bfb
MD5 e5d570c49dfc49cf21ed983c78802cd8
BLAKE2b-256 bfa00b54db3c3cd7422aa690a99d9d8d64064eb05783eb30285a753820171ae0

See more details on using hashes here.

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