Skip to main content

Magnon: Magnon Bandstructures in Python

Magnon is a Python library for calculating magnon bandstructures from exchange coupling interactions. It is designed to be intuitive and easy-to-use so that you can spend less time calculating bandstructures and more time using them to do interesting science.

Install

pip install magnon

Bandstructures in under 10 lines of code

It should be extremely easy to take exchange coupling data from the literature and reproduce the magnon bandstructure. Using Magnon, the simple script below can be used to obtain the bandstructure of BCC iron in the primitive cell..

import magnon
import magnon.build

atoms, interactions = magnon.input.create_interacting_system('Iron_BCC.poscar', 'Iron_BCC_mag_moments', 'Iron_BCC_exchange', 2)

interactions = interactions.symmetrize(atoms)
primitive_atoms, primitive_interactions, _ = magnon.build.build_primitive_cell(atoms, interactions)

magnon = magnon.MagnonSpectrum(primitive_atoms,primitive_interactions,num_threads=4)

path = primitive_atoms.get_cell().bandpath(path='GNPGHN', npoints=180)

bstruct = magnon.get_band_structure(path)
bstruct.plot(emin=0, emax=0.7, filename='Iron_BCC_bands.png')
Iron_BCC_bandstructure.png

The bandstructure of BCC Iron calculated using the above example script.

Why use Magnon?

Our core development principles are:

  • Easy to use - Magnon bandstructures can be computed using less than 10 lines of Python code!

  • Scalable - For handling complex cells, symmetries, and couplings.

  • Integrated - Interfaces with tools such as ASE to accelerate scientific workflows. The MagnonSpectrum class mirrors the structure of ASE’s Phonons class.

  • Adaptable - Allows conventions for working with dimensionless or dimensionful magnetic moments, different Hamiltonian conventions, many input formats.

  • Open - Built for collaboration.

The code offers:

  • ASE-enabled reading of many widely used structure file formats

  • Ability to read complex exchange interaction data, and rigorously check symmetry requirements

  • Option to easily augment non-magnetic structure files with a magnetic moment data file

  • Rapid set-up routine by simultaneously reading structural, magnetic and coupling data

  • Powerful InteractionList class for working efficiently with exchange coupling data at scale

  • In-built symmetrisation routines for generating full exchange couplings from a minimal description

  • Unit cell standardisation to convert couplings to those of the primitive cell

  • Supports ferromagnetic, antiferromagnetic and non-collinear spin configurations

  • Adapts to different conventions for the Heisenberg Hamiltonian prefactor

  • Able to convert from exchange couplings from unit vector spin models

  • Integrated MagnonSpectrum class for easy generation of reciprocal space paths and their bandstructures. Built with the same structure as the ASE Phonons class.

Metadata

Release files for magnon 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for magnon 1.0.0
File Size Uploaded Provenance
magnon-1.0.0.tar.gz 34.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for magnon 1.0.0
File Interpreter ABI Platform
magnon-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 70.9 kB

Release files / magnon-1.0.0.tar.gz

Download URL magnon-1.0.0.tar.gz
Size 34.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2f749c4fdd68c7c36162e0f0abcb6e1765f900ef680b746c57324878d7aa85a8
BLAKE2b-256 checksum
How to use checksums
8e81eb86a9e28708859cdbbc7dcf6f4bc40ce83343cd6f8b3a8177b5678f052c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release files / magnon-1.0.0-py3-none-any.whl

Download URL magnon-1.0.0-py3-none-any.whl
Size 36.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10bf7db694e122e157440d0a7523ee69cd62138160c68894cbca3b9d2d836b9e
BLAKE2b-256 checksum
How to use checksums
3ce0185088456fefabcb8232278e3b69cde6f454d86bd7f449cb03028781cc57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Security for magnon 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page