Simulating a magnet

Physics has always been about modeling real systems with mathematics. More recently with the development of high-speed processing and graphics card-accelerating computing, we can now afford to build more complex models such as 3D mesh geometries with order 106 pixels and perform tens of thousands of operations based on a mathematical model on each pixel in an afternoon. In particular, micromagnetic simulation programs have enabled researchers around the world to play with material parameters and watch as the lowest energy magnetic state emerges in their chosen geometry, as solved via the Landau-Lifshitz-Gilbert (LLG) equation. Apart from being a fascinating tool in and of itself, its also resulted in an evolution of the research field, as experimentalists can now invest in a computer with modest RAM and a decent graphics card in order to easily model their novel material as well as the expected magnetic spin textures and domains emergent in such a magnet under conditions matching their experiment.

While several tools exist that solve the LLG equation, I’ll discuss MuMax3 here, as its the one I have most experience with. This is partially because it’s written in Go, which is a Google-built programming language syntactically similar to C, and so its basically human-readable for humans that have programmed in some language before. Also, the authors published a comprehensive paper in AIP Advances which goes into all of the details regarding how the solver works (finite difference method) and a breakdown of how they treat each term within the LLG equation.

So I thought it would be useful to just dive into some code. First, I wanted to use material parameters of a benchmark material used since around 2010, which was around the time of the first experimental observations of a chiral spin texture called a magnetic skyrmion. Yoshinori Tokura just published a review in 2020 which summarizes the relevant background and lists the materials in which skyrmions emerge as well as some of their characteristics. You’ll find the micromagnetic parameters in the code below:

<br>// MUMAX 3<br>// Date Created: Mon 01/16/2021<br>// Last Modified: Wed 01/16/2021<br>// // // // // // // // // // // // // // //<br>// Author: Fehmi Sami Yasin<br>// Email: fehmiyasin@gmail.com<br>// https://orcid.org/0000-0001-9382-7565<br>// // // // // // // // // // // // // // //<br>// Defining a thin plate magnet mesh<br>Nx := 128; //pix<br>Ny := 128; //pix<br>Nz := 20; //pix<br><br>sizeX := 768.0e-9; // m<br>sizeY := 768.0e-9; // m<br>sizeZ := 120.0e-9; // m<br><br>SetMesh(Nx, Ny, Nz, sizeX/Nx, sizeY/Ny, sizeZ/Nz, 10, 10, 0);<br>EdgeSmooth = 8;<br>a := Cuboid(sizeX, sizeY, sizeZ).RotZ(0*pi/180).Transl(0, 0, 0);<br>SetGeom(a);<br>alpha = 0.3; //damping constant<br><br>// // // // // // // // // //<br>// material parameters from the scientific literature<br>exccons:=8.78e-12; //Birch, et al., Nat. Comm 4.35e-13 Turgut, S. Jin, et al.<br>Aex=exccons; // J/m<br>DD:=1.58e-3; //Birch, et al. Nat. Comm. 4*pi*exccons/(70e-9)<br>Dbulk = DD; // J/m^2<br>Msat = 384e3 // A/m //Birch, et al. Nat. Comm 104.9e3; Turgut, S. Jin, et al.<br>Ku1 = 0.0; //Birch, et al. Nat. Comm. 0.5e5; // Turgut, S. Jin, et al.// J/m^3<br>AnisU = vector(1, 1, 1)<br>save(Dbulk);</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>EnableDemag = true;<br>OutputFormat = OVF1_TEXT;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>TableAdd(B_ext);<br>TableAdd(E_total);<br>TableAdd(E_exch);<br>TableAdd(E_anis);<br>TableAdd(E_Zeeman);<br>TableAdd(E_demag);<br>TableAdd(ext_topologicalcharge);</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>// // // // // // // // // //<br>// Changing the temperature, an integral part of measuring the phase diagram<br>T_max := 280 //K<br>T_min := 100 //K<br>T_step := 30 //K</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Bmax := 500.0e-3 //T<br>Bmin := 0.0e-3 //T<br>Bstep := 50.0e-3 //T<br>MinimizerStop = 1.0e-6</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>for T:=T_max; T&gt;=T_min; T-=T_step{<br>    Temp.set(T)<br>    m = RandomMag();<br>    // // // // // // // // // //<br>    // Relaxation to initial state<br>    Relax()<br>    save(m)<br>    // // // // // // // // // //<br>    // Applying an external magnetic field perpendicular to the axis normal to the thin plate<br>    for B:=Bmin; B&lt;=Bmax; B+=Bstep{<br>        B_ext = vector(0, 0, B) //T<br>        Autosave(m, 10e-9)<br>        Run(20e-9)<br>        Relax()<br>        TableSave()<br>        Save(m)<br>    }<br>}<br>

From the top, this .mx3 file sets a 128 \textrm{pix} \times 128 \textrm{pix} \times 20 \textrm{pix} mesh, with a 6 nm pixel size. Once the mesh is set, I initiate a cuboid geometry and initiate the material parameters for FeGe, which I found in the scientific literature. FeGe is a cubic B20 chiral crystal structure, and so there is a bulk Dzyaloshinskii–Moriya interaction (DMI), which leads to the stabilization of chiral skyrmions. We initialize demagnetization, which allows for magnetic stray fields generated from magnetic domains (regions of the magnet with many spins polarized in one direction, resulting in a net magnetic field emerging from the spins), and set the save format to .ovf file, which is vector file format allowing for 3D visualization of the spin textures. Next we print several output values we’d like to save in a table, and begin a conditional loop to change the temperature (T) and applied magnetic field (B_{ext,z}), which will allow us to visualize the magnetic phase at each point in TB_{ext,z} phase diagram.

So let’s examine the results from T=220 K. As we increase the externally applied magnetic field normal to the thin plate from B_{z}=0 mT to B_{z}=500 mT, the helical domains (Figure 1a), made up of magnetic moments oscillating in space from out of plane to in plane in a helical structure, begin to give way to a saturated domain surrounding several magnetic skyrmions (Figure 1b-c), which have vortex-like in-plane magnetic domain walls surrounding a core magnetization which is anti-aligned to the direction of the external magnetic field, as shown in Figure 2.

The cross sectional view of a magnetic skyrmion’s core oriented opposite to the external magnetic field, which is in the +z direction here.

The stability of these chiral spin textures over a range of B_{z} values is sometimes referred to as topological stability. Essentially, it refers to the phenomena of a magnetic skyrmion resisting annihilation amid changes to the energy landscape, in this case due to the external input of energy via a magnetic field. This energy is the Zeeman energy term in the LLG equation, which you can read about in the link above. Perhaps later I’ll discuss this further. As you can see, MuMax3 is a very powerful tool for studying magnetic domains within materials of any composition, property or geometry imaginable, given that you can communicate with the computer in an appropriate manner.

I think I’ll sign off here, and end with a link to Muview, which I used to view the .ovf file generated by MuMax3, although you could open .ovf files with other software, and I frequently use python when I want to work with the 3D arrays and not just extract a pretty image with an easy to use GUI.

Published by Fehmi Yasin

I'm a postdoctoral research fellow at the Center for Emergent Matter Science at RIKEN in Japan. I love learning new natural and programming languages, and using them to explore the world and solve problems I find interesting.

Leave a comment

Design a site like this with WordPress.com
Get started