How to set up a uniform antiferromagnetic initial magnetization (i.e. two sublattices / two layers with opposite magnetization) in MuMax3 so that the initial state is uniformly ±m rather than a checkerboard pattern?
How to compute the interlayer exchange parameter (what I call ext_InterExchange) from the material parameters in my code so that the resulting coupling strength corresponds to a physically meaningful interlayer exchange energy (J/m²) or to an effective interlayer exchange field.
Below are the relevant parameters and snippets from my script:
nx := 90
ny := 50
nz := 2
cs := 1e-9
SetGridSize(nx, ny, nz)
SetCellSize(cs, cs, cs)
// Material
Msat = 3.76e5;
Ku1 = 1.16e5;
anisU = vector(0, 1, 0)
Aex = 6.59e-12 ; // intralayer exchange positive
// Periodic BC in plane to suppress edge demag artifacts (optional)
SetPBC(1, 1, 0)
// Initialize layer 0 = +y, layer 1 = -y (uniform layers)
for j := 0; j < ny; j++ {
for i := 0; i < nx; i++ {
m.SetCell(i, j, 0, vector(0, 1, 0)) // layer z=0
m.SetCell(i, j, 1, vector(0, -1, 0)) // layer z=1
}
}
// Interlayer AFM coupling (choose physically reasonable J_inter, negative for AFM)
// Example: J_inter = -1e-3 J/m^2 (moderate)
//J_inter := -1e-3
//ext_InterExchange(0, 1, J_inter) // call BEFORE relax()
RKKY := -1e-3 // 1mJ/m2
scale := (RKKY * cs) / (2 * Aex.Average())
ext_scaleExchange(0, 1, scale)
// Relax to ground state
alpha = 0.5
relax()
// Save relaxed state and reduce damping for dynamics
saveas(m, "afm_relaxed.ovf")
please i will be glad if anyone can tell me about my code if the setup in correct and how to calculate the Interlayer AFM coupling