def test_2d_mesh(self): kmesh = kpt.Kmesh([2, 2]) self.assertTrue( np.array_equal( kmesh.get(), np.array([[-0.25, -0.25], [-0.25, 0.25], [0.25, -0.25], [0.25, 0.25]])))
def test_cartesian(self): kmesh = kpt.Kmesh([2, 2, 1], unitcell=[[4, 0, 0], [0, 2, 0], [0, 0, 1]]) cart = kmesh.get_cartesian() self.assertTrue( np.array_equal( kmesh.get_cartesian(), np.array([[-1, -0.5, 0], [-1, 0.5, 0], [1, -0.5, 0], [1, 0.5, 0]])))
import os import time import sys import numpy as np sys.path.insert(0, os.path.abspath('D:\\Project\\tbtool')) import tbtool.io as io from tbtool.calculator import base from tbtool.kpoints import monkhorst_pack import tbtool.kpoints as kp from tbtool.calculator import berry, algo, dos, band ham = io.read_hwr("./crsite3_2684.HWR") #ham = io.read_hwr("./theta_90_n_2.0.HWR") kpt = kp.Kmesh([20, 20, 1]) #calc = berry.AnomalousHallConductivity(ham, kmesh=kpt) kpt = kp.Kpath([[0, 0, 0], [0.5, 0, 0], [1 / 3, 1 / 3, 0], [0, 0, 0]]) bandcalc = band.Band(hamiltonian=ham, kpath=kpt) res = bandcalc.calculate(100) import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt plt.plot(np.arange(90), res) plt.show() #e, f = calc.calculate()
ham.magmom = [1, 1, 0.01] #ham.t2_soc_xy = -0.005 ##### Band kpt = kp.Kpath([[0, 0, 0], [0.5, 0, 0], [1 / 3, 1 / 3, 0], [0, 0, 0]]) bandcalc = band.Band(hamiltonian=ham, kpath=kpt) res = bandcalc.calculate(100) import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt plt.plot(np.arange(90), res) plt.show() ## kmesh = kp.Kmesh([41, 41, 1]) berrycalc = berry.ChernNumber(ham, kmesh=kmesh) print(berrycalc.calculate()) # #xarr = np.arange(-0.02, 0.0120001, 0.001) #yarr = np.arange(0.06, 0.10001, 0.001) # #paramset = [] #paramval = [] # #for x in xarr: # for y in yarr: # ham.aniso = x # ham.t3_a = y # ham.t3_b = y # berrycalc = berry.ChernNumber(ham, kmesh=kmesh)
import os import time import sys import numpy as np sys.path.insert(0, os.path.abspath('D:\\Project\\tbtool')) import tbtool.io as io from tbtool.calculator import base from tbtool.kpoints import monkhorst_pack import tbtool.kpoints as kp from tbtool.calculator import berry, algo, dos, band #ham = io.read_hwr("./crsite3_2684.HWR") ham = io.read_hwr("./theta_90_n_2.0.HWR") kpt = kp.Kmesh([41,41, 1]) calc = berry.AnomalousHallConductivity(ham, kmesh=kpt) c = calc.calculate_only_filled_bands(n=1) print(c) #kpt = kp.Kpath([[0,0,0],[0.5,0,0],[1/3,1/3,0], [0,0,0]]) #bandcalc = band.Band(hamiltonian=ham, kpath=kpt) #res = bandcalc.calculate(100) #import matplotlib #matplotlib.use('TkAgg') #import matplotlib.pyplot as plt #plt.plot(np.arange(90), res) #plt.show() #e, f = calc.calculate()
import time import sys import numpy as np sys.path.insert(0, os.path.abspath('D:\\Project\\tbtool')) import tbtool.io as io from tbtool.calculator import base from tbtool.kpoints import monkhorst_pack import tbtool.kpoints as kp from tbtool.calculator import berry, algo, dos, band #ham = io.read_hwr("./symGra.scfout") ham = io.read_openmx_hamiltonian("./symGra.scfout", version=3.8) kpt = kp.Kmesh([42, 42, 1], gamma_center=False) chemcalc=dos.Fermi(hamiltonian=ham, kmesh=kpt, method='2d') c = chemcalc.calculate(n=4.0) print(c) # #cdos=dos.Cdos(hamiltonian=ham, kmesh=kpt) #n=50 #res = cdos.calculate(erange=np.linspace(-1,1,n)) #s = np.zeros([n, 2]) #s[:,0] = np.linspace(-1,1,50) #s[:, 1] = res #print(s) #calc = base.Eigenvalues(hamiltonian=ham, kpts=kpt.get()) #res = calc.calculate()
import tbtool.io as io from tbtool.calculator import base from tbtool.kpoints import monkhorst_pack import tbtool.kpoints as kp from tbtool.calculator import berry, algo, dos, band import ham_custom ham = io.read_hwr("./CrI3.HWR") #ham.t2 = 0.1 kpt = kp.Kpath([[0, 0, 0], [1 / 3, 1 / 3, 0], [0.5, 0, 0], [0, 0, 0]]) #print(a.get(3)) #ham = io.read_openmx_hamiltonian("./symGra.scfout", 3.8) ##print(kpt.get(30).shape) bandcalc = band.Band(hamiltonian=ham, kpath=kpt) res = bandcalc.calculate(30) import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt plt.plot(np.arange(90), res) plt.show() kmesh = kp.Kmesh([70, 70, 1]) berrycalc = berry.ChernNumber(ham, kmesh=kmesh) print(berrycalc.calculate()) #print(res)
ham.t2 = 0.013 ham.t5_a = 0.021 ham.t5_b = -0.007 ham.t1_soc = 0.022 ham.t3_soc = 0.012 ham.aniso = -0.01 ham.t2_soc_z = -0.01 ham.t2_soc_xy = 0.005 #ham.t2 = 0.1 kpt = kp.Kpath([[0, 0, 0], [1 / 3, 1 / 3, 0], [0.5, 0, 0], [0, 0, 0]]) #print(a.get(3)) #ham = io.read_openmx_hamiltonian("./symGra.scfout", 3.8) ##print(kpt.get(30).shape) bandcalc = band.Band(hamiltonian=ham, kpath=kpt) res = bandcalc.calculate(30) import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt plt.plot(np.arange(90), res) plt.show() kmesh = kp.Kmesh([31, 31, 1]) berrycalc = berry.ChernNumber(ham, kmesh=kmesh) print(berrycalc.calculate()) #print(res)