Table of Contents
Fetching ...

NeuralMAG: Fast and Generalizable Micromagnetic Simulation with Deep Neural Nets

Yunqi Cai, Jiangnan Li, Dong Wang

TL;DR

This paper introduces NeuralMAG, a deep learning approach to micromagnetics simulation that follows the LLG iterative framework but accelerates demagnetizing field computation through the employment of a U-shaped neural network (Unet).

Abstract

Micromagnetics has made significant strides, particularly due to its wide-ranging applications in magnetic storage design. Numerical simulation is a cornerstone of micromagnetics research, relying on first-principle rules to compute the dynamic evolution of micromagnetic systems based on the renowned LLG equation, named after Landau, Lifshitz, and Gilbert. However, simulations are often hindered by their slow speed. Although Fast-Fourier transformation (FFT) calculations reduce the computational complexity to O(NlogN), it remains impractical for large-scale simulations. In this paper, we introduce NeuralMAG, a deep learning approach to micromagnetic simulation. Our approach follows the LLG iterative framework but accelerates demagnetizing field computation through the employment of a U-shaped neural network (Unet). The Unet architecture comprises an encoder that extracts aggregated spins at various scales and learns the local interaction at each scale, followed by a decoder that accumulates the local interactions at different scales to approximate the global convolution. This divide-and-accumulate scheme achieves a time complexity of O(N), significantly enhancing the speed and feasibility of large-scale simulations. Unlike existing neural methods, NeuralMAG concentrates on the core computation rather than an end-to-end approximation for a specific task, making it inherently generalizable. To validate the new approach, we trained a single model and evaluated it on two micromagnetics tasks with various sample sizes, shapes, and material settings.

NeuralMAG: Fast and Generalizable Micromagnetic Simulation with Deep Neural Nets

TL;DR

This paper introduces NeuralMAG, a deep learning approach to micromagnetics simulation that follows the LLG iterative framework but accelerates demagnetizing field computation through the employment of a U-shaped neural network (Unet).

Abstract

Micromagnetics has made significant strides, particularly due to its wide-ranging applications in magnetic storage design. Numerical simulation is a cornerstone of micromagnetics research, relying on first-principle rules to compute the dynamic evolution of micromagnetic systems based on the renowned LLG equation, named after Landau, Lifshitz, and Gilbert. However, simulations are often hindered by their slow speed. Although Fast-Fourier transformation (FFT) calculations reduce the computational complexity to O(NlogN), it remains impractical for large-scale simulations. In this paper, we introduce NeuralMAG, a deep learning approach to micromagnetic simulation. Our approach follows the LLG iterative framework but accelerates demagnetizing field computation through the employment of a U-shaped neural network (Unet). The Unet architecture comprises an encoder that extracts aggregated spins at various scales and learns the local interaction at each scale, followed by a decoder that accumulates the local interactions at different scales to approximate the global convolution. This divide-and-accumulate scheme achieves a time complexity of O(N), significantly enhancing the speed and feasibility of large-scale simulations. Unlike existing neural methods, NeuralMAG concentrates on the core computation rather than an end-to-end approximation for a specific task, making it inherently generalizable. To validate the new approach, we trained a single model and evaluated it on two micromagnetics tasks with various sample sizes, shapes, and material settings.

Paper Structure

This paper contains 25 sections, 20 equations, 8 figures, 6 tables, 1 algorithm.

Figures (8)

  • Figure 1: (a) Landau-Lifshitz-Gilbert (LLG) dynamics solved by the Finite Differential Method (FDM), focusing on the computational complexity caused by cell interactions. It highlights that the major issue with this framework is its large computational demand ($O(N^2)$), mainly due to the long-range cross-cell interaction. (b) The demagnetization equation (referenced in Eq. \ref{['eq:demag']}) is represented as a convolution of the magnetization vector $\overrightarrow{m}$ and the demagnetization tensor $\Omega$. By utilizing Fast Fourier Transform (FFT), this convolution is transformed into a spectral domain multiplication, significantly reducing the computational complexity to $O(N\log N)$. (c) The NeuralMAG framework utilizes a Unet model to calculate the demagnetizing field, the same role as FFT. This method accumulates local convolution outputs at varied granularity to approximate the global convolution between the magnetization vector $\overrightarrow{m}$ and the demagnetization tensor $\Omega$. The core idea of this approach is depicted on the right side, where local cross-cell interaction is computed by a convolution layer, and a downsampling layer pools the neighbouring cells to form the next layer of cells with a larger scale. This convolution & downampling operations continue untill the feature maps shrink to a set of $1 \times 1$ channel maps. Accumulating the cross-cell interactions at all levels of the hierarchy can lead to an approximation for the demagnetizing field with high accuracy, with a computational complexity $O(N)$ under mild conditions. Refer to the Discussion section for details.
  • Figure 2: (a) Training condition for the U-Net model in the NeuralMAG framework. It involve using material samples of varying sizes, capped at a maximum size of 96 to maintain training efficiency. To enhance the model's robustness, samples are randomly masked. Furthermore, symmetric augmentation techniques are applied to ensure the model adheres to physical laws, reinforcing its ability to generalize across different micromagnetic scenarios. (b) Test condition of the U-Net model. We evaluate the applicability of the model to diverse tasks, i.e., dynamics simulation and MH curve prediction in this study. We also evaluate its generalizability by testing the performance of the model with samples of different sizes, shapes, and materials.
  • Figure 3: (a)-(i) showcases basic dynamic simulations with FFT/LLG and Unet/LLG. A sample, sized at 128 and randomly shaped into a convex hull, features an FDM cell size of 3 nm, resulting in a geometric size of $384$ nm. (a) The initial random state with magnetization directions indicated by different colors. (b) The cooling process that converts a random initial state to a cooled state through 1088 FFT-based iterations, leading to more regular patterns and a specified number of vortices ($InitCore$), with vortex distribution depicted in the winding density plot and each vortex type labeled. (c) The definition of vortex types. (d)(e) The simulation outputs at various stages using FFT/LLG and Unet/LLG approaches, respectively. (f)(g) Comparison on winding densities in the converged state between FFT/LLG and Unet/LLG methods. (h) Maximal spin change through LLG iterations. (i) Absolute winding numbers through LLG iterations. (j)-(k) provide phase diagrams for the ground state in square-shaped samples with default material parameters but different sizes, demonstrating the tendency of vortex cores to coexist in larger sample sizes, as shown by both FFT/LLG and Unet/LLG simulations.
  • Figure 4: (a) An example of MH prediction, where the sample is modeled as a convex hull, randomly generated with a size of 64 and utilizing default material parameters. Notably, predictions from the Unet/LLG simulation align precisely with results from the conventional FFT/LLG method. (b) The remanence states resulting from the MH curves in (a), as determined by both FFT/LLG and Unet/LLG simulations. (c) Reversed magnetic states from the same test in (a), as observed by FFT/LLG and Unet/LLG simulations immediately after the external field $H_{ext}$ surpasses the coercivity $H_c$. (d)-(g) Variations in the remanence ($M_r$) and coercivity ($H_c$) values across different sample shapes. (h)-(i) The effects of the material's saturation magnetization ($M_s$) on the $M_r$ and $H_c$ values. (j)-(m) The effects of the uniaxial anisotropy energy density ($K_u$) on the $M_r$ and $H_c$ values. (n)-(o) The effects of the exchange stiffness ($A_x$) on the $M_r$ and $H_c$ values. Data points exhibiting significant discrepancies, defined by a coercivity difference $\Delta H_c \geq 25$ Oe or a relative remanence change $\Delta M_r/M_s \geq 0.03$, are distinctly highlighted with circles in figures (d)-(o).
  • Figure 5: A simulation test on the $\mu MAG$ standard problem $\#1$. (a) The MH curve, simulated using the Unet/LLG approach, is depicted with a black line. For comparison, the reported data for problem $\#1$, as detailed on the $\mu MAG$ website, are displayed as scattered marks. An insert picture provides a succinct overview of the standard problem $\#1$. For the Unet/LLG simulation, an FDM model of size $256 \times 256 \times 2$ is constructed, selectively masked to preserve a rectangular region of $200 \times 100 \times 2$. Each cell within the model measures $10\text{nm} \times 10\text{nm} \times 10\text{nm}$. The assumed magnetic parameters for the permalloy include a saturation magnetization ($M_s$) of $800$ emu/cc, exchange stiffness ($A_x$) of $1.3 \times 10^{-6}$ erg/cm, and uniaxial anisotropy energy density ($K_u$) of $5000$ erg/cc. (b) The magnetization configuration for problem #1 at the remanence state. The upper configuration was generated by Unet/LLG and the lower one is a reproduction of the "mo96a"-series data reported on the $\mu MAG$ website.
  • ...and 3 more figures