A program specifically designed to simplify the computation of magnetic interaction matrix and simulate spin textures under various environmental conditions.
Please proceed to acquire and install the appropriate version of Julia (version 1.9 or higher) for your specific platform by visiting this location.
And add the package by:
julia> import Pkg
julia> Pkg.add(url="https://github.com/A-LOST-WAPITI/Sym4state.jl")
The main functions are pre_process
, post_process
and Sym4state.MC.mcmc
.
The pre_process
function facilitates the streamlined computation of interacting matrices within a specified cutoff radius. To illustrate its usage, let's consider an example where we aim to evaluate all the interactions within a cutoff radius of 5 Å for a monolayer of
using Sym4state
Sym4state.pre_process(
"./POSCAR",
[24],
5.0;
incar_path="./INCAR",
potcar_path="./POTCAR",
kpoints_path="./KPOINTS"
)
Note that you should replace "POSCAR"
, "POTCAR"
, "INCAR"
, and "KPOINTS"
with the actual filenames corresponding to your system's specific input files.
Upon invoking the pre_process
function, it will automate the creation of magnetic configurations with the minimal number of energies required for interaction determination. These configurations will be saved in separate directories. Once all the DFT calculations have converged, you can employ the post_process
function to obtain the interacting matrix. This process can be accomplished using the following Julia code snippet:
pair_mat, coeff_array = Sym4state.post_process("./cal.jld2")
The variable pair_mat
contains the indices of atom pairs, while coeff_array
holds the interacting matrix. With this information, you can establish a Monte Carlo simulation to further analyze the system by:
using Unitful, UnitfulAtomic, CUDA
mcconfig = Sym4state.MC.MCConfig{Float32}(
lattice_size=[128, 128],
magmom_vector=[3.5, 3.5],
pair_mat=pair_mat,
interact_coeff_array=coeff_array,
temperature=collect(150:-2:0),
magnetic_field=zeros(3),
equilibration_step_num=100_000,
measuring_step_num=100_000
)
(
states_over_env,
norm_mean_mag_over_env,
susceptibility_over_env,
specific_heat_over_env
) = Sym4state.MC.mcmc(
mcconfig,
backend=CUDABackend()
)
After the Monte Carlo simulation, one can illustrate the ultimate magnetic configuration simpily by:
using CairoMakie
fig = Sym4state.MC.plot(
states_over_env[:, :, :, :, end],
Float32[1 -1/2; 0 sqrt(3)/2],
Float32[1/3 2/3; 2/3 1/3],
1:24,
1:24
)
It is important to note that the 2D cell matrix, the fractional coordinates of the magnetic atoms, and the desired plotting range of cells along the x- and y-axes must be supplied as inputs to this function.