Discrepancy when using PBC

46 views
Skip to first unread message

Huan Kiat Koh

unread,
Jan 5, 2026, 3:29:32 AMJan 5
to mum...@googlegroups.com
I am running hysteresis loops on thin films, and I noticed differences in the generated loops depending on whether I use PBC or not. For example, if I run a 300x300nm thin film with no PBC, versus a 100x100nm thin film with PBC(1,1,0), I expect the same results as the dimensions are the same, but I get 2 different loops. Does anyone know why this is the case? Thank you so much. 

Антон Луценко

unread,
Jan 5, 2026, 3:58:21 AMJan 5
to mumax2
Naturally, you would have different loops. 
300x300nm thin film with no PBC is not big enough to fight off demag field (in my experience). You would have non-uniformities in magnetization on the edges.
100x100nm thin film with PBC(1,1,0) has forced periodicity constraint (which is really important in case of e.g. magnetic textures) but not enough PBC extent to simulate infinite film (it has to be larger than a few microns, so e.g. PBC(10,10,0), though I would go with even larger, maybe PBC(100,100,0) ).
What is the material you are simulating? Is it supposed to have some magnetic texture?

Huan Kiat Koh

unread,
Jan 5, 2026, 4:30:37 AMJan 5
to mum...@googlegroups.com
Thank you for your reply. Correct me if I am wrong, but wouldn't PBC(1,1,0) result in an overall dimension of 300x300nm (1 repetition on each side), which is the same as my no-PBC case? Are you saying that in using PBC, it forces the magnetic texture to be the same for each 100x100nm region, but in the no PBC case, the magnetic texture is free to relax in the entire 300x300nm space? Or am I missing something? I am simulating a permalloy thin film. 

--
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 visit https://groups.google.com/d/msgid/mumax2/c21f1d88-3d11-4f31-be9e-70ee2c8022d5n%40googlegroups.com.

Антон Луценко

unread,
Jan 5, 2026, 2:25:38 PMJan 5
to mumax2
One can say that PBC creates a grid of virtual copies (virtual since they are not real, they are not independently simulated in memory; and copies since every one of them has the same magnetization as the simulated area, but shifted into a grid). However, technically there are no copies at all. PBC makes two(three) things: 
1) demag field is computed not from a single cell, but from a grid of virtual copies of a cell. the field is calculated using a pre-computed kernel, so the "grid of virtual copies" only "exists" during the calculation of the kernel. That is why it takes longer time to compute demag kernel for PBC(10, 10, 0) than (1,1,0) but the same time to compute demag field during every timestep. Demag kernel must be accurate enough, and the relevant value is L × PBC (how far do you assume two spins should be until they stop interacting via their dipolar magnetic field). That is why it is ofthen worth to invest some time into computing the demag kernel with large PBC, if you do multiple simulations with the same grid.
2) Internally, demag field is always computed using FFT, which always assumes infinite periodicity. To combat this for limited samples, the arrays are padded with zeros to 2x of every dimension every single timestep before FFT and cropped after. PBC in a dimension removes the need to pad the array in that dimension. That is why the computation becomes faster with each non-zero PBC.
3) PBC also is accounted in the exchange field calculation at the edges.

In short, PBC(1,1,0) does NOT result in an overall dimension of 300x300nm, it simulates infinitely periodic film with period of 100×100nm, with magnetic field extending 300 nm from each spin.

Huan Kiat Koh

unread,
Jan 11, 2026, 7:27:05 PMJan 11
to mum...@googlegroups.com
Thank you. I've had some time to think about it and also look at other literature. 

According to this paper (https://eprints.soton.ac.uk/143929/2/Fang_09.pdf), the authors showed that using PBC gave the same results as simulating the full structure. This seems to be different from what you have described? 

Felipe Garcia

unread,
Jan 13, 2026, 7:30:55 AMJan 13
to mum...@googlegroups.com
Hi Huan Kiat Koh,

300x300nm thin film with no PBC, versus a 100x100nm thin film with PBC(1,1,0)  are NOT the same system so there is no reason to have the same hysteresis. Why should they?

The real simulated sample in 300x300 nm in the first case and 100x100 nm in the second.
One has borders with respect to exchange and the other has not due to PBC.
The maximum size of magnetic structures is 300 nm in one case and 100 nm in other. This is pretty drastic distinction.

The meaning for the dipolar field has been explained by Anton already so I will not discuss it.

For the exchange PBC considers that the borders are attached as usual in PBC conditions. That means that in one case nucleation of structures will start in the borders, while in the other case that mechanism is not possible. It is not only that the repetition.
As simple as this. Try to introduce a DW with PBC and without PBC in the same system. With PBC more domain walls will appear.

So if you have hysteresis loops of in-plane structures, one will be more like the typical nucleation from the border and the other (PCB case) will have a character more like a thin film.

The difference will disappear when you have a repetition of motives where the borders have a lesser role. For example a repetition of antidots. This is the type of systems that was aimed for in the article that you sent. They mention this specifically "improves modelling accuracy of small and large repetitive systems". If your system is a rectangle of 300x300nm then you are not simulating it if you are using 100x100 nm and PBC (1 1 0).


Regards,
Felipe

Reply all
Reply to author
Forward
0 new messages