This repository contains a Python implementation of the following paper:
Yang, B., Patel, T., Cheng, M. et al. "Macroscopic tunneling probe of Moiré spin textures in twisted CrI3". Nat Commun 15, 4982 (2024).
If you use this code in your research, please cite the above paper and the DOI of this repository.
The code simulates spins in one Moiré superlattice with the periodic boundary condition in double bilayer CrI3. The top two layers and bottom two layers are untwisted, while the second and the third layers are twisted by angle
The spins on each layer are governed by a generalized Heisenberg model with single-ion anisotropy and exchange anisotropy:
Spins in adjacent layers are coupled by the interlayer exchange coupling that is obtained from Figs. 2 and 3 of Nano Lett. 18, 7658 (2018).
Only the coupling between the second and the third layer
The Zeeman term in the simulation is given by
Temperature is also measured in meV, and 1 meV corresponds to 11.604 Kelvin.
The main code is LLG.py, which demonstrates how to run three types of simulations.
-
$\theta$ : tilting angle in degree -
$J_0$ : inplane exchange coupling (meV) -
$K_0$ : exchange anisotropy (meV) -
$K_1$ : single-ion anisotropy (meV)
Other parameters can be modified in the source code. Note: fitting_harmonics = 3 is recommended to avoid overfitting for Fig. 3 data. With fitting_harmonics > 3, the fitting results critically depend on the initial condition for the least square fitting of MINPACK (i.e., scipy curve_fit).
The total energy is minimized by the semi-implicit method combined with backtracking line search [see Chap. 3 of Exl, L. (2014). "Tensor grid methods for micromagnetic simulations" ].
The code can also implement Monte Carlo simulations by the Metropolis-Hastings algorithm.
Real-time dynamics governed by the Landau–Lifshitz–Gilbert equation can be simulated as well.
scipy
numpy
matplotlib