CUDA-METRO · Reference
Configuration
Every run is defined by three files — a JSON config, a material parameter file, and a script that binds them. This page covers the first two.
Config file
Copy a template from /configs — test_config.json for a
single run, tc_config.json for a temperature sweep.
| Key | Type | Meaning |
|---|---|---|
Single_Mat_Flag | int | 1 for a single material, 0 otherwise. |
DMI_Flag | int | 1 to run in DMI mode. Mutually exclusive with TC_Flag. |
TC_Flag | int | 1 to run in critical-temperature mode. Mutually exclusive with DMI_Flag. |
Static_T_Flag | int | 1 if the simulation runs at a single temperature. |
FM_Flag | int | 1 to start from a ferromagnetic state, 0 for a randomised (diamagnetic) start. |
Input_flag | int | 1 to resume from a saved .npy state. |
Input_File | string | Filename of that starting state, when Input_flag is 1. |
Temps | array | Temperatures to sweep. Critical-temperature mode only. |
Material | string | Material name, without the .csv extension. |
Multiple_Materials | string | Filename holding several materials, without .csv. |
SIZE | int | Lattice edge length. The supercell is SIZE2. |
Blocks | int | How much to parallelise — the spins proposed per step. The core tuning knob. |
Threads | int | Fixed at 2. Do not change. |
B | double | External magnetic field. Quote the value. |
stability_runs | int | Phase 1 batch count. |
stability_wrap | int | Phase 1 batch size. |
calculation_runs | int | Phase 2 batch count. |
calculation_wrap | int | Phase 2 batch size. |
Prefix | string | String prepended to the output folder name. |
Animation_Flags, Box and Cmpl_Flag remain in
the template for backwards compatibility and are no longer read.
Monte Carlo phases
The total number of raw MC steps is:
Blocks × (stability_runs × stability_wrap
+ calculation_runs × calculation_wrap)
The split into two phases exists for critical-temperature work. Phase 1 lets the lattice settle; Phase 2 is the data-collection window from which statistical properties are drawn. For a raw simulation where you want the state evolution from start to finish, keep one phase and zero the other.
Blocks governs VRAM use as well as parallelisation. If a run crashes
or reports an out-of-memory error, lower it first.
Material parameters
Material files live in /inputs as CSV, and hold one vector of
24 entries describing the interactions and crystal configuration:
[name, spin,
J1, J2, J3, J4,
K1x, K1y, K1z, K2x, K2y, K2z,
K3x, K3y, K3z, K4x, K4y, K4z,
Ax, Ay, Az,
Tc, structure, DMI]
J are isotropic exchange parameters and K the
anisotropic ones, subscripted by neighbour shell — J1 is the first
nearest neighbour, J2 the second, and so on to the fourth.
A is single-ion anisotropy, Tc the experimental Curie
temperature for reference, and DMI the
Dzyaloshinskii–Moriya parameter.
Interactions stop at the fourth shell: in 2D materials the interaction energy is expected to have died away past that.
Spin Hamiltonian
Each atom is a 3D spin vector on a periodic lattice. The energy of atom i sums over four neighbour shells — {j}, {k}, {l}, {m} — each contributing an isotropic exchange term and three anisotropic ones:
- Exchange runs over the four neighbour shells.
Jₙis the isotropic term for shell n;Kₙˣ,Kₙʸ,Kₙᶻare anisotropic and apply component-wise. Shells stop at four because in 2D materials the interaction energy is expected to have died away past that. - Self is single-ion anisotropy, per axis on squared
components, from the
Ax, Ay, Azinputs. - Zeeman couples the applied field to the z component only.
- DMI is first-shell only and appears just in the
dm1anddm2kernels; it is absent fromdm0.
Everything except B is material-specific and comes from the input
file.
Three details differ from the general expression quoted in the repository README, and the form above follows
montecarlo.py. Single-ion anisotropy is applied
per axis on squared components using the separate
Ax, Ay, Az inputs, not as a single scalar
A s_i·s_i — which for unit spins would be a
constant. The field enters as B sᶻ, coupling
to the z component alone rather than as a vector dot product. And there
is no biquadratic term in the kernels, so the
λ(s_i·s_j)2 term from the README is omitted here.
The DMI term is present only in the dm1 and dm2
kernels, which take the neighbour-vector array.