Content area
We present NeuralMag, a flexible and high-performance open-source Python library for micromagnetic simulations. NeuralMag leverages modern machine learning frameworks, such as PyTorch and JAX, to perform efficient tensor operations on various parallel hardware, including CPUs, GPUs, and TPUs. The library implements a novel nodal finite-difference discretization scheme that provides improved accuracy over traditional finite-difference methods without increasing computational complexity. NeuralMag is particularly well-suited for solving inverse problems, especially those with time-dependent objectives, thanks to its automatic differentiation capabilities. Performance benchmarks show that NeuralMag is competitive with state-of-the-art simulation codes while offering enhanced flexibility through its Python interface and integration with high-level computational backends.
Details
1 University of Vienna, Faculty of Physics, Vienna, Austria (GRID:grid.10420.37) (ISNI:0000 0001 2286 1424)
2 University of Vienna, Faculty of Physics, Vienna, Austria (GRID:grid.10420.37) (ISNI:0000 0001 2286 1424); University of Vienna, Vienna Doctoral School of Physics, Vienna, Austria (GRID:grid.10420.37) (ISNI:0000 0001 2286 1424)
3 Max Planck Institute for the Structure and Dynamics of Matter, Hamburg, Germany (GRID:grid.469852.4) (ISNI:0000 0004 1796 3508); Center for Free-Electron Laser Science, Hamburg, Germany (GRID:grid.466493.a) (ISNI:0000 0004 0390 1787)
4 TU Wien, Institute of Applied Physics, Vienna, Austria (GRID:grid.5329.d) (ISNI:0000 0004 1937 0669)
5 University for Continuing Education Krems, Department for Integrated Sensor Systems, Krems, Austria (GRID:grid.15462.34) (ISNI:0000 0001 2108 5830)
6 Max Planck Institute for the Structure and Dynamics of Matter, Hamburg, Germany (GRID:grid.469852.4) (ISNI:0000 0004 1796 3508); Center for Free-Electron Laser Science, Hamburg, Germany (GRID:grid.466493.a) (ISNI:0000 0004 0390 1787); University of Southampton, Southampton, UK (GRID:grid.5491.9) (ISNI:0000 0004 1936 9297)