Tutorial 1
Tutorial 1
DYNAMAT GROUP
MUMAX3-WORKSHOP
SESSION 1
Dr. Jonathan Leliaert,
Dr. Jeroen Mulkers
THE DYNAMAT TEAM
Research group of the department of solid-state sciences at Ghent University
Workshop instructors
Dr. Jonathan Leliaert Dr. Jeroen Mulkers Prof. Dr. Bartel Drs. Pieter Gypens
Van Waeyenberge
https://www.dynamat.ugent.be 2
WORKSHOP SCHEDULE
Homework
3
SESSION 1: GENERAL INTRODUCTION
4
MICROMAGNETISM
In ferromagnets, neighboring magnetic moments have the tendency to align
Continuum
approx.
Quasi-uniform state
Néel Skyrmion
5
MICROMAGNETISM
Crystal anisotropy
Dzyaloshinskii-Moriya
Exchange Zeeman Magneto-elasticity
Higher-order exchange
…
6
MICROMAGNETISM
Two main objectives
7
MICROMAGNETISM Time integration
dynamics
𝛾 1 𝛿𝐸
𝒎̇ = − 𝒎×𝑯 +𝛼𝒎 × 𝒎×𝑯 with 𝑯 =−
1+𝛼 𝜇 𝑀 𝛿𝒎
precession damping
8
MICROMAGNETISM Time integration
dynamics
LLG adaptation 1
Spin transfer torques (Zhang-Li[1], Slonczewski[2,3] )
𝛾
𝒎̇ = − 𝒎×𝑯 +𝛼𝒎 × 𝒎×𝑯 +𝜏
1+𝛼
LLG adaptation 2
Additional random effective field term which scales with the temperature[4]
𝑯 → 𝑯 +𝑯 𝑯 (𝒓, 𝑡) = 0
2𝑘 𝑇𝛼
𝑯 (𝒓, 𝑡), 𝑯 (𝒓 , 𝑡′) = 𝛿 𝒓 − 𝒓 𝛿(𝑡 − 𝑡 )
𝑀𝛾
[1] Physical Review Letters 93(12), 127204 (2004). [3] Physical Review B 70(17), 172405 (2004).
9
[2] Journal of Magnetism and Magnetic Materials 159(1-2), L1–L7 (1996). [4] Journal of Applied Physics 112(2), (2012).
MICROMAGNETISM
Energy minimization
statics
𝒎̇ = −𝒎 × 𝒎 × 𝑯
10
WHAT IS MUMAX3?
• Free finite-difference based micromagnetic simulation package
• GPU-accelerated nvidia GPU required
• Developed at DyNaMat (Ugent) by Arne Vansteenkiste
• Latest official release mumax3.10 (Aug 13, 2020)
• Active community groups.google.com/forum/#!forum/mumax2
• Documented API mumax.github.io
• Open source (GPLv3) github.com/mumax/3
• Mainly written in Go
• CUDA C kernels for heavy lifting
• Scripting language + Web GUI
• Well tested (unit tests + NIST standard problems)
11
SCRIPTING LANGUAGE
Mumax3’s scripting language is a subset of golang
// saturation magnetization
Msat = 5e6
if 1+8 == 9 {
print(“Of course 1+8=9”)
}
12
DISCRETIZATION
setgridsize(256,64,1)
setcellsize(1e-9,1e-9,1e-9)
13
DISCRETIZATION
The cuda fft library (used for the computation of the demag field) is
highly optimized for grid size dimensions with small prime factors.
14
SHAPES
• A shape can be considered as a function 𝑓: ℝ → 𝑡𝑟𝑢𝑒, 𝑓𝑎𝑙𝑠𝑒 where
𝑡𝑟𝑢𝑒 if (𝑥, 𝑦, 𝑧) in shape
𝑓 𝑥, 𝑦, 𝑧 =
𝑓𝑎𝑙𝑠𝑒 otherwise
15
SHAPES
Shapes Shape methods // Rotated cheese example
Cell(j,k,l) d := 200e-9
Circle(diameter) Transl(dx,dy,dz) sq := square(d)
Cone(diameter,height) Scale(sx,sy,sz)
Cuboid(Lx,Ly,Lz) RotX(angle) h := 50e-9
Cylinder(diameter,height) RotY(angle) hole := cylinder(h, h)
Ellipse(a,b) RotZ(angle) hole1 := hole.transl(100e-9, 0, 0)
Ellipsoid(a,b,c) Repeat(dx,dy,dz) hole2 := hole.transl(0, -50e-9, 0)
ImageShape(filename)
Layer(i) Add(shape) cheese := sq.sub(hole1).sub(hole2)
Layers(i1,i2) Sub(shape) cheese = cheese.rotz(pi/6)
Rect(Lx,Ly) Inverse()
Square(L) Intersect(shape)
Xrange(xmin,xmax) Xor(shape)
Yrange(ymin,ymax)
Zrange(zmin,zmax)
rotated cheese
16
GEOMETRY
Optionally a magnet Shape other than the full simulation box can be specified
ring := circle(100e-9).sub(circle(50e-9))
setgeom(ring)
save(geom)
17
REGIONS
• 256 regions in total (index 0→ 255)
• Each cell is assigned to a single region (default region id is 0)
• Each region has its own set of material parameters
• Two ways to set the region id in cells:
1. Set region id of a single cell
2. Set region id of all cells in a shape
SetGridSize(32,32,1)
SetCellSize(1,1,1)
Save(regions)
18
MATERIAL PARAMETERS
‒ Material parameters are assigned to the 256 regions.
‒ Material parameters can be functions of time
‒ There are vector and scalar material parameters
‒ Material parameters are predefined, they can not be created
19
MATERIAL PARAMETERS: EXCITATIONS
‒ An excitation is a regional material parameter
‒ Additionally, one can add an arbitrary number of time- and space-dependent
vector fields of the form :
𝑔 𝑥 ,𝑦 ,𝑧 ∗𝑓 𝑡
B_ext = vector(0,0,1)
B_ext.Add(LoadFile("antenna.ovf"), sin(2*pi*f*t))
B_ext.removeExtraTerms()
20
INITIAL MAGNETIZATION
Different ways to set the magnetization:
m = config
m.LoadFile(filename)
m.SetRegion(regionId, config)
m.SetInShape(shape, config)
m.SetCell(j,k,l, vector)
21
INITIAL MAGNETIZATION
Config Config methods m = uniform(1,1,0) m=Vortex(1,-1).Add(0.1,randomMag())
22
OUTPUT
3 output media:
tableadd(E_total)
tableaddvar(myVar,”myVar”,”unit”)
tablesave() // write single line
tableautosave(1e-12) // write periodically
save(Edens_total)
saveas(Edens_total,”edens.ovf”)
autosave(Edens_total, 1e-10) // write perdiodically
23
RUN/RELAX/MINIMIZE
• Solving the LLG equation (time integration) // WARNING: ADVANCED SETTINGS
// In most cases, these settings can be ignored
run(timeperiod)
steps(100) // Set the solver:
// 1:Euler, 2:Heun, 3:Bogaki-Shampine, 4: Runge-Kutta(RK45),
runWhile(condition)
// 5:Dormand-Prince(the default), 6:Fehlberg, -1:Backward Euler
SetSolver(5)
// set timestep
fixdt = 0 // if 0 (default): use adaptive timestep
• Minimizing the energy
// Advanced settings for adaptive timestep (default values are given)
relax() // LLG without precession Headroom = 0.8 // headroom dt correction
Minimize() // steepest descent[1] MaxDt = 0 // if 0, no maximal timestep
MinDt = 0 // if 0, no minimal timestep
MaxErr = 1e-5 // maximum allowed error/step
25
DEMAGNETIZATION FIELD TERM
Regional Material Parameters
Demagnetization energy density
Msat Saturation magnetization (A/m)
Other functionalities
EnableDemag Enables/disables demag (default=true)
26
EXCHANGE FIELD TERM
27
ANISOTROPY FIELD TERM
[1] "The design and verification of mumax3", AIP Advances 4, 107133 (2014). 28
DZYALOSHINSKII-MORIYA FIELD TERM
Note:
Other functionalities
Only single DMI type allowed at once Ext_InterDind Sets Dind coupling between two regions
29
EXTERNAL FIELD TERM
Output Quantities
B_ext Externally applied field(T)
30
THERMAL FIELD TERM
Output Quantities
𝑯 (𝒓, 𝑡), 𝑯 (𝒓 , 𝑡′)
B_therm Thermal field (T)
2𝑘 𝑇𝛼 Edens_therm Thermal energy density (J/m3)
= 𝛿 𝒓 − 𝒓 𝛿(𝑡 − 𝑡 )
𝑀𝛾 E_therm Thermal energy (J)
Other functionalities
ThermSeed Sets random seed for thermal noise
31
CUSTOM FIELD TERMS
Output Quantities
B_custom User-defined field (T)
Other functionalities
AddEdensTerm Add a custom energy density term
32
ZHANG-LI STT
Regional Material Parameters
Zhang-Li spin-transfer torque
Pol Electrical current polarization
1 + 𝜉𝛼 xi Non-adiabaticity of spin-transfer-torque
𝝉= 𝒎× 𝒎× 𝒖⋅∇ 𝐦
1+𝛼 alpha Damping parameter
𝜉−𝛼 Msat Saturation magnetization (A/m)
+ 𝒎× 𝒖⋅∇ 𝒎
1+𝛼 Excitation
J Electrical current density (A/m2)
with
𝜇 𝑃 Output Quantities
𝒖= 𝒋
2𝑒𝛾 𝑀 (1 + 𝜉 ) STTorque Spin-transfer torque/γ0 (T)
Other functionalities
DisableZhangLiTorque Disable Zhang-Li torque (default=false)
33
SLONCZEWSKI STT
Regional Material Parameters
Slonczewski spin-transfer torque Pol Electrical current polarization
Other functionalities
DisableSlonczewskiTorque Disables Slonczewski torque (default=false)
FixedLayerPosition Position of the fixed layer: FIXEDLAYER_TOP,
FIXEDLAYER_BOTTOM (default=FIXEDLAYER_TOP) 34
mumax.ugent.be