Skip to content

kit-matan/pyMagCalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyMagCalc

pyMagCalc (python for Magnon Calculations) calculates spin-wave excitations based on the linear spin-wave theory. The program is written in Python using SymPy. It was used to calculate spin-wave excitations in the kagome lattice antiferromagnet KFe3(OH)6(SO4)2, the non-reciprocal magnons in α-Cu2V2O7, and spin-waves excitations in Zn-doped Cu2V2O7.

Requirement:

  • Python3
    • SymPy
    • NumPy (1.x)
    • SciPy
    • Matplotlib
    • lmfit
    • tqdm

File Description:

  • magcalc.py: calculate the spin-wave dispersion and scattering intensity
  • disp_---.py: calculate and plot the spin-wave dispersion
  • EQmap_---.py: calculate and plot the intensity map as a function of energy and momentum
  • HKmap_---.py: calculate and plot the intensity map as a function of momenta
  • lmfit_---.py: fit the dispersion
  • spin_model.py: contains the information about the spin model used to calculate spin-waves by magcalc.py
  • data (folder): contain the neutron scattering data for KFe3(OH)6(SO4)2, α-Cu2V2O7, and Zn-doped Cu2V2O7

How to run the program:

In a terminal, run the following commands

$ export PYTHONPATH=<Path to magcalc.py>
$ cd <Path to Python files>
$ mkdir pckFiles

and then run, for example,

$ python3 disp_KFe3J.py

to calculate and plot spin-wave dispersion. You must first run disp_---.py to generate and store a matrix in a .pck file. The folder pckFiles contains auxiliary files used to store matrices and calculated intensity.

One has to edit spin_model.py for a different system.

Issues:

  • The code uses SymPy for symbolic manipulation and can be slow for a large system. We use multiprocessing for sympy.subs. It takes about a few minutes (on MacBook Pro M1 Pro) to generate a matrix for α-Cu2V2O7 with 16 spins in a magnetic unit cell.