Skip to main content

Simulate experimental measurements for magnetic materials

Project description


Samuel Holt1,2, James Loudon3, Thomas Hicken4, David Cortés Ortuño5, Martin Lang1, Marijan Beg6,1, and Hans Fangohr1,7,8

1 Faculty of Engineering and Physical Sciences, University of Southampton, Southampton SO17 1BJ, UK
2 Department of Physics, University of Warwick, Coventry CV4 7AL, UK
3 Department of Materials Science and Metallurgy, University of Cambridge, Cambridge, CB3 0FS, United Kingdom
4 Department of Physics, Durham University, Durham, DH1 3LE, United Kingdom
5 Paleomagnetic Laboratory Fort Hoofddijk, Utrecht University, Utrecht, 3584 CD, Netherlands
6 Department of Earth Science and Engineering, Imperial College London, London SW7 2AZ, UK
7 Max Planck Institute for the Structure and Dynamics of Matter, Luruper Chaussee 149, 22761 Hamburg, Germany
8 Center for Free-Electron Laser Science, Luruper Chaussee 149, 22761 Hamburg, Germany

Description Badge
Tests Build status
Linting status
Releases PyPI version
Anaconda-Server Badge
Coverage codecov
Documentation Documentation
YouTube YouTube
Binder Binder
Platforms Platforms
Downloads Downloads
License License


mag2exp is a Python package, integrated with Jupyter, providing:

  • simulations of experimental techniques perfomed on magnetisation textures,
  • the ability to perform "virtual" experiments,
  • the functionality to compare of real experimental results agaist simulated experiments.

It is available on Windows, MacOS, and Linux. It requires Python 3.8+.


APIs and tutorials are available in the documentation. To access the documentation, use the badge in the table above.

Installation, testing, and upgrade

We recommend installation using conda package manager. Instructions can be found in the documentation.


This package can be used in the cloud via Binder. To access Binder, use the badge in the table above.


YouTube video tutorials are available on the Ubermag channel.


If you require support, have questions, want to report a bug, or want to suggest an improvement, please raise an issue in ubermag/help repository.


All contributions are welcome, however small they are. If you would like to contribute, please fork the repository and create a pull request. If you are not sure how to contribute, please contact us by raising an issue in ubermag/help repository, and we are going to help you get started and assist you on the way.



Licensed under the BSD 3-Clause "New" or "Revised" License. For details, please refer to the LICENSE file.

How to cite

  1. M. Beg, M. Lang, and H. Fangohr. Ubermag: Towards more effective micromagnetic workflows. IEEE Transactions on Magnetics 58, 7300205 (2022).

  2. M. Beg, R. A. Pepper, and H. Fangohr. User interfaces for computational science: A domain specific language for OOMMF embedded in Python. AIP Advances 7, 56025 (2017).

  3. Samuel Holt, James Loudon, Thomas Hicken, David Cortés Ortuño, Martin Lang, Marijan Beg, and Hans Fangohr. mag2exp: Simulate experimental measurements for magnetic materials DOI: 10.5281/zenodo.3539461 (2022).


  • OpenDreamKit – Horizon 2020 European Research Infrastructure project (676541)

  • EPSRC Programme Grant on Skyrmionics (EP/N032128/1)

Project details

Download files

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

Source Distribution

mag2exp-0.61.0.tar.gz (24.1 kB view hashes)

Uploaded Source

Built Distribution

mag2exp-0.61.0-py3-none-any.whl (27.8 kB view hashes)

Uploaded Python 3

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