一个分析麋鹿输出的小软件包
elkAnalyzer的Python项目详细描述
欢迎来到elkAnalyzer
此软件包对于打印Elk DFT输出文件非常有用。这仍然是一个测试版,是根据麻省理工学院的许可证(免费和公开提供)发行的。 如果您遇到任何问题,请提交问题。类似地,如果您发现未包含的有用功能,请提交功能请求问题。在
Elk代码可以在:http://elk.sourceforge.net/
绘制ELK状态密度的代码是从materials automated project(session 1)中稍加修改后提取的 由约翰霍普金斯大学的泰勒麦克奎因教授创建:https://github.com/materialsautomated/materialsautomated.github.io。 Materials Automated是一系列9个录音的讲座,引导用户编写Python代码进行数据分析。它的代码是分布式的 在Github上使用MIT许可证。在
elkAnalyzer中目前有三个子模块:
- 能带对于可视化能带结构计算和轨道对能带结构的贡献非常有用。在
- DOS对于可视化状态密度数据非常有用。在
- 特殊点可用于使用Elk基计算特殊点的坐标(与C.Bradley和A.P.Cracknell's(第3章)“固体对称性的数学理论:点群和空间群的表示理论”:https://www.maa.org/publications/maa-reviews/the-mathematical-theory-of-symmetry-in-solids-representation-theory-for-point-groups-and-space)
标注栏绘图示例
importelkAnalyzer.bandsasbndsimportnumpyasnpimportmatplotlib.pyplotaspltf='C:\\Users\\epogue1\\Documents\\postdoc\\Calculations\\Elk\\onMARCC\\f1\\'plt.figure(1,figsize=(3,2))x,y=bnds.readBandsFile(f)mn=np.amin(y)mx=np.amax(y)xs=bnds.getSpecialPoints(path)lbl=['Z','$\Gamma$','B','D','E','A','$\Gamma$','Y','C']plt.ylabel('Energy (eV)',fontsize=10)plt.title('$compound$, SG-14, no SOC',fontsize=10)plt.xlabel('k',fontsize=10)plt.plot(x,y,color='C0')plt.ylim(-2,2)plt.xlim(min(x),max(x))plt.xticks(xs,lbl,fontsize=8)plt.yticks(fontsize=8)forkinxs:plt.axvline(x=k,color='k')plt.tight_layout(pad=0)plt.figure(2,figsize=(3,2))path='C:\\Users\\epogue1\\Documents\\postdoc\\Calculations\\Elk\\onMARCC\\compound\\'x,y=bnds.readBandsFile(path)mn=np.amin(y)mx=np.amax(y)xs=bnds.getSpecialPoints(path)lbl=['Z','$\Gamma$','B','D','E','A','$\Gamma$','Y','C']plt.ylabel('Energy (eV)',fontsize=10)plt.title('$compound$, no SOC',fontsize=10)plt.xlabel('k',fontsize=10)plt.plot(x,y,color='C0')plt.ylim(-2,2)plt.xlim(min(x),max(x))plt.xticks(xs,lbl,fontsize=8)plt.yticks(fontsize=8)forkinxs:plt.axvline(x=k,color='k')plt.tight_layout(pad=0)
两个useL相互之间的离散关系
^{pr2}$只需绘制分散关系,突出显示CB和VB。你可以人为地调整Eg以解释与涂改有关的错误。在
importelkAnalyzer.bandsasbndsimportmatplotlib.pyplotaspltplt.figure()path='C:\\Users\\epogue1\\Documents\\postdoc\\Calculations\\Elk\\onMARCC\\compound\\'lbl=['Z','$\Gamma$','B','D','E','A','$\Gamma$','Y','C']x,energy=bnds.plotDispersion(path,lbl,title='',energyRange=[-3,3],figsize=(3,2),xyLblSize=10,numSize=8)Egvect,gap,idxVBmax,idxCBmin,vb,cb=bnds.calcEg(energy,-0.05)plt.plot(x,vb,x,cb,color='C1')
用颜色绘制轨道贡献
importelkAnalyzer.bandsasbndsimportmatplotlib.pyplotaspltpath='C:\\Users\\epogue1\\Documents\\postdoc\\Calculations\\Elk\\onMARCC\\compound\\'x,energy,totSp,sSp,pSp,dSp,fSp,uniqueAt,norm=bnds.importSpeciesContributions(path)fig,a=plt.subplots()#Ba-s contributionsfig,a=plt.subplots()bnds.plotWeightsColor(x,energy,sSp[0],title='$compound$ Ba-s')bnds.plotFinish(path,['Z','$\Gamma$','B','D','E','A','$\Gamma$','Y','C'],energyRange=[-1.5,1.5])bnds.removeLegend()
以线的宽度与其重量相对应的物种贡献
importelkAnalyzer.bandsasbndsimportmatplotlib.pyplotaspltpath='C:\\Users\\epogue1\\Documents\\postdoc\\Calculations\\Elk\\onMARCC\\compound\\'x,energy,totSp,sSp,pSp,dSp,fSp,uniqueAt,norm=bnds.importSpeciesContributions(path)fig,a=plt.subplots()bnds.plotWeightsWidth(x,energy,sSp[0],lbl='Ba-s',color='C1')bnds.plotWeightsWidth(x,energy,pSp[1],lbl='O-p',color='C0')bnds.plotFinish(path,['Z','$\Gamma$','B','D','E','A','$\Gamma$','Y','C'],energyRange=[-1,1])
DOS绘图
路径末尾的斜杠是必需的。在
绘制每个物种所有原子的PDO总和图
importmatplotlib.pyplotaspltimportelkAnalyzer.DOSasDOSpath='C:\\Users\\username\\Documents\\Calculations\\Elk\\onMARCC\\myCompound\\.'# - lms runs over all the input blocks within the file (how many and order depends on dosmsum and dossum settings)plt.figure()pdos=DOS.load_pdos(path)sdos_np=DOS.sum_atoms_np(pdos)forsinsdos_np:forlmsinrange(0,len(sdos_np[s])):cols=sdos_np[s][lms].swapaxes(0,1)# index by col,rowplt.plot(cols[0],cols[1],label=str(s)+"-"+str(lms))plt.legend()plt.xlabel(r'Energy (eV)')plt.ylabel('DOS ($eV^{-1}$)')
绘制所有原子的PDO和每个物种的lms
importmatplotlib.pyplotaspltimportelkAnalyzer.DOSasDOSplt.figure()path='C:\\Users\\username\\Documents\\Calculations\\Elk\\onMARCC\\myCompound\\.'pdos=DOS.load_pdos(path)qdos_np=DOS.sum_atoms_lms_np(pdos)forsinqdos_np:cols=qdos_np[s].swapaxes(0,1)# index by col,rowplt.plot(cols[0],cols[1],label='Species '+str(s))plt.legend()plt.xlabel('Energy (eV)')plt.ylabel('DOS ($eV^{-1}$)')
用lms对所有原子和物种求和绘制PDOS
importmatplotlib.pyplotaspltimportelkAnalyzer.DOSasDOSplt.figure()path='C:\\Users\\username\\Documents\\Calculations\\Elk\\onMARCC\\myCompound\\.'pdos=DOS.load_pdos(path)rdos_np=DOS.sum_species_atoms_np(pdos)forlmsinrange(0,len(rdos_np)):cols=rdos_np[lms].swapaxes(0,1)# index by col,rowplt.plot(cols[0],cols[1],label=str(lms))plt.legend()plt.xlabel('Energy (eV)')plt.ylabel('DOS ($eV^{-1}$)')
特殊点确定
此模块依赖于信息输出一个文件,该文件列出相互的晶格向量和麋鹿包含空间组号的文件。 “标准”互易空间的基础是用C.Bradley和a.P.Cracknell的(第3章)“实体对称的数学理论:点群和空间群的表示理论”:https://www.maa.org/publications/maa-reviews/the-mathematical-theory-of-symmetry-in-solids-representation-theory-for-point-groups-and-space)。 然后使用elk计算中使用的倒数格向量来表示该标准基。路径末尾的斜杠是必需的。在
这可以通过以下方式调用:
importelkAnalyzer.specialPointsascspd=csp.calcStandard('C:\\Users\\username\\Documents\\Calculations\\Elk\\myCompound\\')print(d)
当你打电话的时候csp.calc标准(路径),您将有一些额外的项目作为健全性检查读出。你首先得到角度,α,β和γ。接下来,你从麋鹿那里得到a,b和c。之后是奇数角度输出(作为gamma处理)。下一步,在“标准”基础上得到空间向量的倒数。print(d)使程序导出一个列表,其中包含Elk基中特殊点(标记在第4列)的坐标。在
- 项目
标签: