RKKY in mumax3

1,935 views
Skip to first unread message

PRADEEP KUMAR ROUT

unread,
Sep 2, 2020, 9:41:10 AM9/2/20
to mumax2
Dear All,

Is it possible to couple two randomly magnetized ferromagnetic layers via a spacer layer mediated by interlayer RKKY interaction and then minimizing the energy(intralayer exchange, RKKY and Anisotropy etc.) to end up with an synthetic antiferromagnet system in mumax3?

Also is it possible to view the magnetisation distribution of both the layer graphically in "XZ-plane" to confirm the AFM coupling between them?

The steps I am referring to will be the replication of the example mentioned in ubermag for which the link is attached here:

Thanks a lot 

Best wishes

Joshua Lauzier

unread,
Sep 2, 2020, 7:36:15 PM9/2/20
to mumax2
Hello Pradeep,

Yes, it is possible to simulate RKKY interactions in mumax3. There are two methods to do so:

One is to neglect the spacer layer in the geometry, and simply rescale the exchange energy between the layers to account for it. You can find an example on the Examples page under RKKY. Mumax uses nearest neighbor exchange so this only works if the layers are neighbors (hence neglecting the spacer in the explicit geometry). This will not work if you want to consider the spacer layer explicitly.

Another is to add a custom field/energy term to capture the RKKY interaction. This is the more general approach, and you can include an explicit spacer in the geometry. Details on how to do so are given in the mumax api.

I would recommend the first option, unless for some reason it is insufficient for your problem. Adding custom fields/energies is a tricky thing unless you're fairly comfortable with micromagnetics/mumax.

To your other point: Yes, you can view the magnetization distribution. This can be done with mumax-convert program, inside the mumax GUI, or in any number of post processing software. mumax outputs an easily plottable table of values for quantities like magnetization.

Best,
Josh L.

PRADEEP KUMAR ROUT

unread,
Sep 3, 2020, 12:42:46 PM9/3/20
to mumax2
Dear Josh L.,

Hope you are doing good during the COVID pandemic.

Thanks a lot for your detailed information. I really appreciate your help.

As per your information, I tried to simulate RKKY induced synthetic AFM for both inplane and perpendicular magnetic anisotropy(PMA) system. I attach here the script as well as the result and also putting some of my further doubts.
 
The Script for in plane: (For out of plane it is the same but the anisU = vector(0, 0, 1))
setgridsize(64, 16, 2)
c := 1e-9
setcellsize(c, c, c)

defRegion(1, layer(0))
defRegion(2, layer(1))
save(regions)

Msat.setregion(1, 8e6)
Msat.setregion(2, 8e6)

Aex.setregion(1, 1e-12)
Aex.setregion(2, 1e-12)

RKKY := -1e-4 // 1mJ/m2
scale := (RKKY*c)/(2*Aex.Average())
ext_scaleExchange(1, 2, scale)

K1 := 1e5
K2 := 1e5

TableAdd(m.Region(1))
TableADD(m.region(2))

Ku1.setregion(1, K1)
Ku1.setregion(2, K2)
anisU = vector(1, 0, 0)

m.setregion(1, RandomMagSeed(2))
m.setregion(2, RandomMagSeed(2))
saveas(m, "m_initial")

relax()

saveas(m, "m_final")

Do you think the script is correct (I am an absolute beginner in mumax) ? I think the inplane system relaxes to a synthetic AFM state (see the picture attached) but there is some edge effect. Do you know how to deal with the edge effect here ? Again, for the out of plane case (anisU = vector(0, 0, 1), it is still behaving like an inplane anisotropy system (after the relaxing) irrespective of changing the anisotropy strength a lot. I don't understand why. Is this method of rescaling the exchange energy to account for RKKY, hold for perpendicular magnetic anisotropy case too or not ?

Thanks a lot for your kind help. 

Best wishes
Pradeep

Inplane.png
OutPlane.png

Joshua Lauzier

unread,
Sep 3, 2020, 7:24:25 PM9/3/20
to mumax2
In general, that looks pretty close to me. To answer your questions:

1) The edge effect comes from the demag field. Mumax natively has demag field enabled. There are a couple ways to deal with it:

a) just make your system bigger (this will take longer, but otherwise should be fine assuming your GPU has sufficient memory) via set gridsize. For your gridsize of (64, 16, 2), and cell size 1nm, you're simulating a device that is only 64nm x 16 nm in-plane dimensions, and 2 nm thick. For such a small device, the edge effects are fairly large since so much of the system is effectively close to an edge.


b) You can set boundary conditions, using setPBC(A,B,C) command. The way mumax sets boundary conditions is that it copies the system A times in the x-direction, B times in the y-direction etc. This can give you effectively a much larger system (although be careful, as it *literally* copies the system. So if you have say, a domain wall in the center, that DW feature gets propagated to each copy). Also take care, as exchange does apply (this matters a lot if you set PBC in the z-direction, as your top layer would see a copy of the bottom layer and exchange couple to it). 

c) Disable the demag field entirely if you do not care about it. I believe this is NoDemagSpins or EnableDemag commands.

2) As for why it stays in plane, I would guess that your demag field/shape anisotropy is overwhelming the magnetocrystalline anisotropy. Especially for such a large Ms (which should be units of A/m). That is a factor of 10 larger than typical Permalloy for the Ms, possibly a factor of 10 error?

using the rescaling of exchange doesn't affect the anisotropy in any way, it only impacts the exchange

PRADEEP KUMAR ROUT

unread,
Sep 7, 2020, 4:42:34 AM9/7/20
to mumax2
Dear Josh L.,

Thanks a lot for the amazingly explanatory information about the PBC and edge effect due to the Demag Spins. It was really helpful. This time I tried not only with coupling two cells in the z-direction but coupling two regions with multiple cells in each region. I used the "layers" command to define the region. It works fine for the inplane anisotropy system (picture attached). For the out of plane system, I could see the AFM coupling between the two regions but there is formation of domain-wall(picture attached) in each region which I was not expecting. Sorry to bother you again but could you let me know what is the reason behind this and how to get rid of this? I thank you a lot for your help. 

The script for out of plane system:
SetGridSize(128, 64, 16)
c := 2e-9
SetCellSize(c, c, c)


DefRegion(1, layers(0, 8))
DefRegion(2, layers(8, 17))
save(regions)

Msat.SetRegion(1, 5e5)
Msat.SetRegion(2, 5e5)

Aex.SetRegion(1, 1e-11)
Aex.SetRegion(2, 1e-11)

RKKY := -5e-3 // 1mJ/m2
scale := (RKKY*c)/(2*Aex.Average())
ext_ScaleExchange(1, 2, scale)

K1 := 1e6 
K2 := 1e6


Ku1.SetRegion(1, K1)
Ku1.SetRegion(2, K2)
anisU = vector(0, 0, 1)

NoDemagSpins.SetRegion(1, 1)
NoDemagSpins.SetRegion(2, 1)


m.SetRegion(1, RandomMagSeed(3))
m.SetRegion(2, RandomMagSeed(3))
saveas(m, "m_initial")

relax()

saveas(m, "m_final")
Outplane.png
Inplane.png

rafael.del...@gmail.com

unread,
Sep 7, 2020, 5:11:27 AM9/7/20
to mumax2
You may use

SetPBC(10,10,0)

After SetCellsize(c, c, c) 

PRADEEP KUMAR ROUT

unread,
Sep 7, 2020, 5:18:05 AM9/7/20
to mumax2
Hi Rafael,

Aha, yes yes I understood and hope it should work now. Thanks for the input, highly appreciated.

Best wishes
Pradeep

Joshua Lauzier

unread,
Sep 7, 2020, 6:29:18 PM9/7/20
to mumax2
Hi Pradeep,

The domain wall does seem a bit strange. I don't get it for using RandomMagSeed(3), but i do for RandomMagSeed(2). It seems likely it's just an artifact of the relax method for that specific configuration. Sometimes you need to nudge the system. How to do so is a bit of an art, but here are some suggestions-

You can use the run() command, instead of relax. This is much slower, but you can apply a finite temperature (temperature is disabled for relax) using 'Temp=100', which can help avoid these metastable states. If you do use run(), make sure to set an alpha (doesn't necessarily have to be reasonable, you can set a fairly large one like 0.05, just to damp the dynamics). You can also start with run(), then switch to relax() to get to the full ground state, or even minimize() at the end. Run() is a lot slower than relax, so there is a trade off, but if you plan on keeping this small system size it's not terribly long.

You would do this by replacing relax() with say 

alpha=0.05
temp=100
run(1e-9)
relax()

Where 1e-9 tells run how long to go for. i chose 1ns arbitrarily, you can reduce this. you just need a little bit, to help relax out a bit initially. If you only use run instead of relax(), you need to run for sufficiently long that you're reasonably confident you're in equilibrium.


Instead of temperature, you can also add some random noise to the magnetization itself.

Often applying a very small external field can help by breaking symmetry.

Changing the system size can also do the trick. I wasn't noticing walls for SetGridSize(128, 128, 16), for instance. I'm not sure if in this case is because the energy penalty was higher for this system, or the state was simply not stable with some extra spins.

Which one is best is often preference. For the script you posted, run() is a pretty easy one though, without too much longer simulation time.

Best,
Josh L.

PRADEEP KUMAR ROUT

unread,
Sep 15, 2020, 6:35:49 AM9/15/20
to mumax2
Hi Josh,

Thanks a lot again for your help and extremely useful suggestions. I will try to proceed as suggested by you and then will let you know if it works or not. 
Meanwhile, I watched the mumax3 workshop and got to know about the custom field term which can be incorporated in mumax3 to account for the RKKY even with a spacer layer. I will also try to use that technique and see if it improves the result.

I really appreciate your help and assistance and day by day I am learning the mumax3 from you and other people. I hope I will be able to run some realistic simulations for my work very soon. Thanks a lot for helping to learn mumax3.

Best wishes
Pradeep

PRADEEP KUMAR ROUT

unread,
May 14, 2021, 4:39:06 AM5/14/21
to mumax2
Dear Josh L. and  Rafael,

Hope you are doing well. I understood your explanation about PBC but just came up with one doubt. Does PBC behaves like a virtual repetition to get rid of the edge effect from the Demag-field at the boundary or it actually means to extend the size of the system by copying it. For example, if I use a grid size of (64, 32, 3) with cell size (1e-9, 1e-9, 1e-9) and PBC(10, 10, 0) then, what would be my actual size of the simulation geometry??? Is it (64nm x 32nm x 3nm) or (640nm x 320nm x 3nm) ?? If it is (64nm x 32nm x 3nm), then should I understand that the use of PBC here is just to extend the boundary so that we get rid of the edge effect? If it is not  (64nm x 32nm x 3nm), then is there any way possible to get rid of the edge effects without using PBC (If I want to simulate actually the (64nm x 32nm x  3nm) geometry)

On Friday, September 4, 2020 at 1:24:25 AM UTC+2 jpla...@rams.colostate.edu wrote:

Felipe Garcia

unread,
May 14, 2021, 5:26:08 AM5/14/21
to mumax2
Dear Pradeep,

With PBC you only simulate 64nm x 32nm x 3nm. PBC for exchange only removes the boundary as usual in PBC. With PBC(10, 10, 0) for the dipolar field it takes into account 10 copies of the system in each direction to calculate the dipolar field. The aim is to simulate an array of such structures.  In any case, the system remains the same, 64nm x 32nm x 3nm.

Best regards,
Felipe

--
You received this message because you are subscribed to the Google Groups "mumax2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mumax2+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mumax2/ede79f31-8c99-421a-be17-b855dc3355f6n%40googlegroups.com.

PRADEEP KUMAR ROUT

unread,
May 14, 2021, 5:51:41 AM5/14/21
to mum...@googlegroups.com
Dear Felipe,

Thanks a lot for the clarifications. Got it.

Best regards
Pradeep

You received this message because you are subscribed to a topic in the Google Groups "mumax2" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mumax2/MDys4CYogAE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mumax2+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mumax2/CAE-O8Rnf1J7NnC1qFuQx%2B48jznvP4t9k00Nq9Un7xx2gTh2xAg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages