Skip to content

Skyrmion lattice

In this example, we demostrate how to get a skyrmion lattice using MicroMagnetic.jl. We use the parameters given in PRL 108 017206 (2012), which is dimensionless.

julia
using MicroMagnetic
using CairoMakie

function m0_fun(i, j, k, dx, dy, dz)
    i0, j0, r = 166, 96, 25
    i1 = i % i0
    j1 = j % j0

    if ((i1 - r)^2 + (j1 - r)^2 < r^2)
        return (0.05, 0.01, -1)
    elseif ((i1 - i0 / 2.0 - r)^2 + (j1 - j0 / 2.0 - r)^2 < r^2)
        return (0.05, 0.01, -1)
    end

    return (0, 0, 1)
end

function relax_system()
    mesh = CubicMesh(; nx=166 * 2, ny=96 * 3, nz=1, pbc="xy")
    sim = Sim(mesh; driver="SD", name="skx_latttice")
    set_mu_s(sim, 1.0)

    #Set the exchange, dmi and zeeman
    add_exch(sim, 1.0; name="exch")
    add_zeeman(sim, (0, 0, 3.75e-3))
    add_dmi(sim, 0.09; name="dmi")

    init_m0(sim, m0_fun)
    relax(sim; max_steps=2000, stopping_dmdt=1e-5)

    save_vtk(sim, "skx_latttice.vts")

    return sim
end
relax_system (generic function with 1 method)

Recall the function relax_system to obtain the skyrmion lattice.

julia
sim = relax_system();
MicroMagnetic.AtomisticSim{Float64}(6.92382606469185e-310, CubicMesh(1.0e-9, 1.0e-9, 1.0e-9, 332, 288, 1, 95616, 6, 12, 8, 6, Int32[332 1 … 95614 95615; 2 3 … 95616 95285; … ; -1 -1 … -1 -1; -1 -1 … -1 -1], Matrix{Int32}(undef, 1, 0), Matrix{Int32}(undef, 1, 0), Matrix{Int32}(undef, 1, 0), true, true, false), MicroMagnetic.EnergyMinimization{Float64}([0.0008544237321115443, -0.0006465835772464746, 0.0007962123699969982, 0.000842727081031553, -0.0005812301676363353, 0.0008367677401957757, 0.0007961547679724945, -0.0005166792299548123, 0.0008560470921019419, 0.0007619168317750192  …  0.0005466792508878875, 0.0009113915639449165, -0.0007830035828572901, 0.000605489994826597, 0.0009291712897022227, -0.0007580524327124492, 0.000668010950993603, 0.0009233044077207965, -0.000719095709622428, 0.0007194009315158453], [4.489657841744437e-8, 4.98333549324426e-8, 4.3890315424187134e-8, 3.8836023130226904e-8, 3.922006482641684e-8, 3.435303760362796e-8, 2.8107960093944083e-8, 2.4264645617250963e-8, 2.361705392263599e-8, 1.849262129122695e-8  …  1.98686337963489e-8, 2.5394186342721417e-8, 3.0349121398060736e-8, 3.891502657004349e-8, 3.66769281778143e-8, 4.32523623204945e-8, 4.695672167301102e-8, 5.2578840150446054e-8, 4.449321590809812e-8, 5.4946276967941385e-8], [-8.212652679097476e-9, 9.676201964556863e-9, 9.401738301165477e-10, -6.285916035828544e-9, 6.6736769948676896e-9, 2.8118284110992035e-9, -2.6484136895401646e-9, -3.083032523344476e-9, 6.743500503875388e-9, 2.614527425077456e-9  …  -4.453002425482427e-9, 1.348150132394662e-10, -2.023530319410548e-9, 1.2523499225527786e-8, -9.596405912555759e-9, 1.7087258330183578e-9, 5.5907386346738e-10, 1.31054819677867e-8, -1.713651025306216e-8, 1.4201585511528776e-8], [1.8271270250962019e-9, 2.0970059445663167e-9, 3.018134414963296e-9, 1.0273845304775681e-9, 2.3478683276222113e-9, 1.9790841608512554e-9, 8.098296182465808e-9, 4.0963869819473326e-10, 2.6536775547852526e-9, 2.6586508975980884e-9  …  2.6119949065628945e-9, 1.3786973757283284e-10, 2.2165707460042356e-9, 4.030897054027214e-9, 3.1013463138258536e-9, 6.881127544407289e-11, 3.2754604821460676e-11, 3.478426380093309e-9, 9.926288495580473e-9, 5.091881214713647e-9], 0.17875556213433, 1.0, 1.0e-10, 231), MicroMagnetic.DataSaver("skx_latttice_sd.txt", true, 0.0, 231, Any[SaverItem("step", "<unitless>", MicroMagnetic.var"#125#127"()), SaverItem("E_total", "<J>", MicroMagnetic.var"#129#130"()), SaverItem(("m_x", "m_y", "m_z"), ("<unitless>", "<unitless>", "<unitless>"), MicroMagnetic.average_m), SaverItem("E_exch", "<J>", MicroMagnetic.var"#187#188"{Int64}(1)), SaverItem(("zeeman_Hx", "zeeman_Hy", "zeeman_Hz"), ("<A/m>", "<A/m>", "<A/m>"), MicroMagnetic.var"#51#53"{Int64}(2)), SaverItem("E_zeeman", "<J>", MicroMagnetic.var"#52#54"{Int64}(2)), SaverItem("E_dmi", "J", MicroMagnetic.var"#196#197"{Int64}(3))]), [-0.4083554741333955, 0.44341061307547563, 0.7978927465250707, -0.4440495658671273, 0.461967808483244, 0.7677276385401304, -0.48054592879907604, 0.4781290272371656, 0.7351654532334034, -0.5175912200408505  …  0.9085864786213259, -0.295187321261293, 0.34562258390294553, 0.890735356243836, -0.3262534492747412, 0.3678765132486563, 0.8707614815989195, -0.35867756011746005, 0.38889028778348855, 0.8485957529565306], [-0.4082027527632379, 0.44329504528764135, 0.7980350966341913, -0.443898936114482, 0.4618639232594684, 0.7678772368730585, -0.4804036242464896, 0.4780366804290505, 0.7353184956025598, -0.517455035827664  …  0.9086842259835709, -0.2950244134854539, 0.34548262765193394, 0.8908436167129892, -0.32608736455759857, 0.367741018232472, 0.8708809184872663, -0.35851252513075277, 0.38876175714887296, 0.8487243754617232], [-1.6367629044723893, 1.7771905170690823, 3.197399717654689, -1.7797355755990385, 1.8514674640171465, 3.076375665273985, -1.925895166077729, 1.916130747102982, 2.945751425119551, -2.0742404034055157  …  3.6415164914285474, -1.1833720393030025, 1.3854806523285923, 3.5699041759945036, -1.3078659196601627, 1.4746399100239649, 3.489765533966642, -1.437783116747115, 1.5588129035004035, 3.4008296702175023], [-2.0052893613223706, -2.0051526047526376, -2.005004446932875, -2.00484752064945, -2.0046848181820796, -2.0045195329119436, -2.004354907777938, -2.0041940394852107, -2.004039733353988, -2.0038943630800996  …  -2.0058439108654844, -2.0058474297943207, -2.0058447434987636, -2.0058338946632954, -2.0058130058988173, -2.00578035773039, -2.00573450418681, -2.0056743422522914, -2.0055992330677714, -2.005509034051832], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0  …  1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], Bool[0, 0, 0, 0, 0, 0, 0, 0, 0, 0  …  0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 95616, "skx_latttice", "SD", Any[MicroMagnetic.HeisenbergExchange{Float64}([1.0, 1.0, 1.0, 1.0, 1.0, 1.0], Float64[], Float64[], Float64[], [-1.6324451201477364, 1.772443705694631, 3.186847681538388, -1.7747325096432702, 1.846239152253842, 3.066055020393843, -1.9201788745060995, 1.910431182091071, 2.93574106618326, -2.0677579924018987  …  3.630899299217077, -1.1810767398352884, 1.38263479128091, 3.5591943908153567, -1.305093398765892, 1.4713867637490143, 3.4790139262479847, -1.434491922035831, 1.5551372487731503, 3.3900838105378233], [-1.9976504502991095, -1.9974337179905588, -1.9972110774515905, -1.9969853060412883, -1.9967594062148264, -1.9965364032125734, -1.9963192916922559, -1.996110826765802, -1.9959134813117732, -1.9957292704691338  …  -1.9992031816327214, -1.9991291002578695, -1.999042490226237, -1.9989426947253395, -1.998829203422488, -1.9987016786696434, -1.9985600340768364, -1.9984044859182988, -1.9982355880921245, -1.9980542793056597], "exch"), MicroMagnetic.Zeeman{Float64}((0, 0, 0.00375), [0.0, 0.0, 0.00375, 0.0, 0.0, 0.00375, 0.0, 0.0, 0.00375, 0.0  …  0.00375, 0.0, 0.0, 0.00375, 0.0, 0.0, 0.00375, 0.0, 0.0, 0.00375], [-0.002992097799469015, -0.002878978644525489, -0.0027568704496252626, -0.002626272688563518, -0.0024879202784585286, -0.0023427703261311226, -0.0021919956852191184, -0.0020369582165251357, -0.0018791741707808278, -0.0017202803750195773  …  -0.003665523755358872, -0.0036371257665618463, -0.0036035162042496313, -0.0035642164356350942, -0.0035187243839307726, -0.0034665455659940313, -0.003407199294829972, -0.003340257585914385, -0.0032653555559959482, -0.0031822340735869893], "zeeman"), MicroMagnetic.HeisenbergDMI{Float64}([-0.09 0.09 … 0.0 0.0; 0.0 0.0 … 0.0 0.0; 0.0 0.0 … -0.09 0.09], [-0.004937901671945813, 0.005207131167290394, 0.006226789336659211, -0.005594713247258881, 0.005645456396250054, 0.005975383582607345, -0.006290396968052683, 0.0060649429430872925, 0.005645461333785247, -0.007018213919666207  …  0.006479605487924169, -0.0029528271470690703, 0.0034042497320165704, 0.0065237948972172895, -0.003430286370064331, 0.0037925642958574896, 0.006525599569704065, -0.003955728879753664, 0.004190489890959326, 0.00647725294793821], [-0.004646813223792105, -0.004839908117553162, -0.005036499031659447, -0.005235941919598081, -0.005437491688794909, -0.005640359373239241, -0.0058436204004627835, -0.006046254502883578, -0.006247077871433854, -0.006444812235946217  …  -0.0029752054774042735, -0.0030812037698894255, -0.003198737068276892, -0.0033269835023206793, -0.0034650780923985106, -0.003612133494752658, -0.003767270815143657, -0.003929598748077992, -0.004098289419650901, -0.004272520672585361], "dmi")], true)

After obtain the skyrmion, we use the following script to plot the skyrmion

julia
fig = plot_m(sim)
┌ Warning: `arrows` are deprecated in favor of `arrows2d` and `arrows3d`.
└ @ Makie ~/.julia/packages/Makie/aJUtI/src/basic_recipes/arrows.jl:166