Code Monkey home page Code Monkey logo

spinwave's Introduction

spinwave

Collinear spinwave calculations

Calculates linear spinwave theory Hamiltonians

This is the collinear only version of the work in J. Phys.: Condens. Matter 27 (2015) 166002.

For 2D materials only, this code can also calculate the magnetization vs. temperature curves.

If you use this code, please cite: https://arxiv.org/abs/2205.00300 and https://iopscience.iop.org/article/10.1088/0953-8984/27/16/166002/meta

Here is an example given for the ferromagnetic CrI3 using magnetic coupling parameters in 2D Mater. 4 (2017) 035002.

import matplotlib.pyplot as plt

sw = Spinw()
# POSCAR should be in the "directory as below"
# If OUTCAR is also in the same directory, magnetic moments are read from OUTCAR.
# If not, then each atomic magnetic moment must be supplied in "spins".
sw.read_structure(directory="./", spins=[3,3,0,0,0,0,0,0])
  
# define magnetic interactions
# This example uses 2D CrI3 structure. 
# Reference values are taken from 2D Mater. 4 (2017) 035002:
#   * isotropic exchange J is defined as 2.2 meV
#   * anisotropic exchange lambda is defined as 0.09 meV
# Negative sign of J denotes that interactions are ferromagnetic.
# In XXZ hamiltonian, lambda is the anisotropic exchange in z-direction
# Hence it is the 3rd element of the np.diag([0,0,-0.09]) vector below.
# For lambda, the convention is to use negative sign for the favored 
# anisotropy direction and use zero for the unfavorable directions.
# rmax = 4.5 A means only first nearest neighbors for this example

sw.add_coupling(('Cr1', 'Cr2'), -2.2, rmax=4.5)
sw.add_coupling(('Cr1', 'Cr2'), np.diag([0,0,-0.09]), rmax=4.5)
    
# plot magnon band structure
# compare to 2D Mater. 4 (2017) 035002
ax = plt.figure().gca()
sw.get_band_structure(ax, [0.0,0.0,0.0], [0.333333, 0.3333333, 0.0], num_k=100, normalize = True)
# normalize tag normalizes the energy axis in the band structure to JS units. 
figname = './band_line.pdf'
plt.xlabel('k*l')
plt.savefig(figname, format='pdf')

# plot magnetization curve 
sw.magnetization(kgrid=[20,20,1], tmin = 1, tmax = 100, dt = 1)

CrI3 magnon dispersion curve:

band

CrI3 magnetization curve:

magnet

spinwave's People

Contributors

kayahans avatar

Watchers

James Cloos avatar  avatar

Forkers

zhiwei-lu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.