from hotbit.parametrization import KSAllElectron, SlaterKosterTable atom = KSAllElectron( 'C', xc='PBE', confinement={ 'mode': 'Woods-Saxon', 'r0': 8., 'a': 4., 'W': 0.75 }, ) atom.run() atom.plot_Rnl() table = SlaterKosterTable(atom, atom) table.run(R1=1, R2=10, N=3, ntheta=50, nr=10) table.plot()
from hotbit.parametrization import SlaterKosterTable from hotbit.parametrization import KSAllElectron from util import plot_table from hotbit import Element from pickle import load import pylab as pl from box.data import data e1=KSAllElectron('C',confinement={'mode':'quadratic','r0':5.04}) e1.run() e2=KSAllElectron('H',confinement={'mode':'quadratic','r0':5.04}) e2.run() sk=SlaterKosterTable(e1,e2) sk.run(1,15,20,ntheta=50,nr=25) sk.write() plot_table('C_H.par',screen=True)
#sk.write() #compare_tables('Au_Au.par','Au_Au_NR.par',s1='Au',s2='Au',screen=False) lst=[('C','C',1.85*1.46,1.85*1.46),\ ('C','H',1.85*1.46,1.85*0.705),\ ('Na','C',1.85*2.9,1.85*1.46),\ ('O','H',1.85*1.38,1.85*0.705),\ ('Mg','O',1.85*1.41/0.529177,1.85*1.38),\ ('Na','O',1.85*2.9,1.85*1.38),\ ('H','H',1.85*0.705,1.85*0.705)] for s1,s2,r01,r02 in lst: e1=KSAllElectron(s1,nodegpts=500,confinement={'mode':'quadratic','r0':r01}) e1.run() if s1==s2: e2=e1 else: e2=KSAllElectron(s2,confinement={'mode':'quadratic','r0':r02}) e2.run() sk=SlaterKosterTable(e1,e2) sk.run(1E-3,12,10) #,ntheta=20,nr=20) sk.write() file='%s_%s.par' %(s1,s2) #compare_tables( param+'/'+file,file,s1,s2,screen=False) plot_table(file,s1=s1,s2=s2,screen=True,der=0) plot_table(file,s1=s1,s2=s2,screen=True,der=1)
from hotbit.parametrization import KSAllElectron, SlaterKosterTable atom=KSAllElectron('C',convergence={'density':1E-1,'energies':1E-1},txt='/dev/null') atom.run() table=SlaterKosterTable(atom,atom,txt='/dev/null') table.run(R1=1,R2=10,N=3,ntheta=50,nr=10,wflimit=1E-7)
x=[] t=[] tlist=[10,20,40,60,100,200,300,400,500,501] #rlist=[10,20,40,50,100,200] for ntheta in tlist: if ntheta!=501: nr=10000/ntheta else: nr=200 #for nr in rlist: #x.append(ntheta*nr) #t.append(ntheta) sk=SlaterKosterTable(e1,e2) sk.run(4,4,1,ntheta=ntheta,nr=nr) r,table=sk.get_table() y.append([table[0][0,5],table[0][0,6],table[0][0,8],table[1][0,8],table[0][0,9]]) y=np.array(y) #t=np.array(t) for i in range(5): #pl.scatter(x,y[:,i]-y[-1,i],s=t) pl.plot(tlist,abs(y[:,i]-y[-1,i])) pl.axhline() pl.show() # convergence as a number of grid points with fixed ntheta/nr if True: y=[]
from hotbit.parametrization import KSAllElectron, SlaterKosterTable atom = KSAllElectron('C', convergence={ 'density': 1E-1, 'energies': 1E-1 }, txt='/dev/null') atom.run() table = SlaterKosterTable(atom, atom, txt='/dev/null') table.run(R1=1, R2=10, N=3, ntheta=50, nr=10, wflimit=1E-7)