Z-mag¶
Z-mag is an open-source finite-element library for micromagnetics, developed
at IBM Research, Zurich. It integrates the time-dependent
Landau–Lifshitz–Gilbert equation on MPI-parallel unstructured meshes using
DOLFINx / FEniCSx, and represents the magnetization direction through a
two-chart stereographic atlas so the unit-norm constraint
\(|\mathbf{m}|=1\) is satisfied exactly by construction—no renormalization,
penalty term, or saddle-point system is required. Two solver variants are
provided: demag, with a self-consistent demagnetizing field computed via a
hybrid FEM–BEM operator-split scheme, and nodemag, without magnetostatics.
Both share the same adaptive implicit BDF time integrator with thermodynamic
acceptance gates.
The Z in the name reflects the project’s origin at the IBM Zurich Research Laboratory. For the logo we chose the Eiger, Mönch, and Jungfrau— three iconic summits of the Swiss Alps—because our solver also spends its life climbing brutal energy gradients, balancing on unstable magnetization states, and remaining firmly convinced that convergence is just over the next ridge.
Figure 1 Eiger, Mönch, and Jungfrau. Photo © Adventure Peaks¶
A full description of the design rationale, solver architecture, repository, license, and contributors is in About Z-mag.
Recommended reading order¶
About Z-mag — about
Z-mag: design, repository, license, contributorsInstallation — dependencies, BEM build, and quick checks
Getting started — annotated minimal driver
Magnetization dynamics → Micromagnetic energy → Magnetostatics → Stereographic formulation
Solver algorithms — timestep control, thermodynamic gates, outer split
Benchmarks — precession–damping, µMAG Standard Problem 3, checkpoint chain
Configuration reference and API (Dynamic solver factory, Shared base module, Demag dynamic solver, Nodemag dynamic solver)
Note
Z-mag is under active development. API and defaults may change between
releases. Please cite the paper [Brach et al., 2026] and the repository
revision you use; see About Z-mag.
Contents¶
Getting started¶
Getting started
Theory¶
Theory
- Magnetization dynamics
- Micromagnetic energy
- Magnetostatics
- Stereographic formulation
- Solver algorithms
- Notation
- Energy functionals
- Structure of one timestep
- Acceptance phases
- Nonlinear solve (phase A)
- Algebraic validity (phase B)
- Atlas guard (phase C)
- Residual gate (phase D)
- Thermodynamic gate (phase E)
- Atlas closure (phase F)
- Rejection and recovery
- Phase outcomes summary
- Timestep control
- Continuation ramps
- Physical steady-state stopping
- Configuration parameters
- Diagnostics
- Benchmarks