STT MTJ switching

24 views
Skip to first unread message

Anuj Kumar

unread,
Aug 16, 2025, 1:45:03 PMAug 16
to mumax2
Hi All, 

I am currently learning MuMax and would like to start with a simple STT-MTJ switching example. My goal is to obtain the M–H and M–V characteristics of the MTJ. Could you please let me know if this code is correct?

Thanks and regards,


// Geometry
SetGridsize(64,64,1)
SetCellsize(2e-9,2e-9,1.5e-9)

// Material parameter
Msat  = 1.1e6
Aex   = 15e-12
alpha = 0.02
Ku1   = 5e5 // PMA

// STT parameter
Pol = 0.6
SlonczewskiPolarizer = vector(0,0,1)

// M–H loop

tableadd(B_ext)   // store applied field
tableadd(mz)      // store mz

Hmin := -0.5 // Tesla
Hmax :=  0.5 // Tesla
nsteps := 50

for i:=0; i<nsteps; i++ {
    H := Hmin + (Hmax-Hmin)*float64(i)/float64(nsteps-1)
    B_ext = vector(0,0,H)
    m = uniform(0,0,1)   // reset to +z before each field step
    relax()
    tablesave()
}

//  STT switching
jmin := 1e10   // A/m^2
jmax := 1e12   // A/m^2
nstepsJ := 20
pulseDuration := 100e-9

for i:=0; i<nstepsJ; i++ {
    m = uniform(0,0,1)   // reset to +z before each run
    B_ext = vector(0,0,0) // no external field
   
    j = jmin + (jmax-jmin)*float64(i)/float64(nstepsJ-1)
    run(pulseDuration)   // apply pulse
    tablesave()
}
save(m)

Josh Lauzier

unread,
Aug 22, 2025, 3:38:17 AMAug 22
to mumax2
Hi,

If you're doing Slonczewski STT, you should define all the relevant terms (including lambda, epsilonprime, etc). You can find an example for Slonczewski STT on the examples page. (To see what each term means in more detail, you can look to the mumax tutorial page or the mumax paper "the design and verification of mumax3").

You have some syntax issues, with commands or terms that are not defined in mumax. For instance: "SlonczewskiPolarizer" is not a command in mumax. Presumably this is supposed to be the fixedlayer? You need to match the syntax of mumax, so this should be fixedlayer= vector(0,0,1) . The same thing applies to "j" and "mz". You need to follow mumax syntax, or it will error. To get mz, it would be m.Comp(2) . J is a vector quantity, so needs to be set as a vector as J=vector(0,0,j), similar to how you set B_ext. "float64" is also not a valid command in mumax. However, golang types numbers implicitly, so if you want them to be floats, instead of doing  i:=0, do  i:=0.0 (similarly for nsteps,nstepsJ). For a full list of commands, you can check the API.

As a side note, this seems like a strange choice for the fixed layer. The Slonczewski torque terms go like m cross m_p cross m and m cross m_p, where m_p is the fixed layer magnetization. Last, note that running for 100ns is quite a long time, and your simulation could take quite a bit (although it is a small simulation, so it is probably doable). And may not even be necessary. In the example script, the flipping finishes on the order of 1ns.

Best,
Josh L.
Reply all
Reply to author
Forward
0 new messages