简体   繁体   English

如何绘制能带结构?

[英]How to plot band structure?

I'm running a Vasp calculation with pyiron.我正在用 pyiron 运行 Vasp 计算。 I can easily plot the total density of states by accessing the ElectronicStructure and Dos objects, eg我可以通过访问ElectronicStructureDos对象轻松绘制状态的总密度,例如

from pyiron.project import Project 
pr = Project('tmp')
pr.remove_jobs(recursive=True)
vasp = pr.create_job(pr.job_type.Vasp, 'vasp')
vasp.structure = pr.create_ase_bulk('Al')
vasp.run()
dos = vasp.get_electronic_structure().get_dos()
dos.plot_total_dos()

Is there a similarly convenient way of plotting the band structure hiding somewhere?有没有类似的方便的方法来绘制隐藏在某处的能带结构?

Although there isn't a direct plot function, the band structure can be plot using the eigenvalue matrix虽然没有直接的绘图函数,但可以使用特征值矩阵绘制能带结构

import matplotlib.pylab as plt
plt.plot(vasp.get_electronic_structure().eigenvalue_matrix);

Or to plot it manually you could use:或者手动绘制它,您可以使用:

# The trace is system dependent, in this example we use:
trace = np.array([[0, 0, 0], # Gamma
        [1, 0, 0], # X
        [1, 1, 0], # M
        [0, 0, 0], # Gamma
        [0, 0, 1], # Z
        [1, 0, 1], # R
        [1, 1, 1], # A
        [0, 0, 1]]) # Z
label_ticks = ['$\Gamma$', 'X', 'M', '$\Gamma$', 'Z', 'R', 'A', 'Z']

energy = ham['output/electronic_structure/eig_matrix']
E_f = ham_chg['output/electronic_structure/efermi']

energy -= E_f
n_kpoints = len(energy) 
n_trace = int(n_kpoints / (len(trace)-1))
normal_ticks = [i*n_trace for i in range(len(trace))] 

plt.axhline(y=0, ls='--', color='k')
plt.plot(energy, 'r-')

plt.xlim(normal_ticks[0], normal_ticks[-1])
plt.xticks(normal_ticks, label_ticks)
plt.grid(axis='x')
plt.ylabel("Energy - $E_F$ [eV]")

plt.ylim(-1, 1);

This requires two VASP calculation, first you calculate the charge density:这需要两个VASP计算,首先你计算电荷密度:

ham_1.write_charge_density = True 

And after this job is executed you use the charge density to calculate the band structure by restarting from the previous job:执行此作业后,您可以通过从上一个作业重新开始,使用电荷密度来计算能带结构:

ham_2 = ham.restart_from_charge_density(job_name="job_band", icharg=11)

But to my knowledge we currently have no automated functionality for this.但据我所知,我们目前没有这方面的自动化功能。

If you are using VASP to calculate the band structure, a friendly tool named VASPKIT will help you plot it easily!如果您使用 VASP 计算能带结构,一个名为 VASPKIT 的友好工具将帮助您轻松绘制它! Here's a link !这是一个链接 After your installation is complete, open vaspkit in your folder, then type: 21安装完成后,在你的文件夹中打开vaspkit,然后输入:21

211) Band-Structure                                              
212) Projected Band-Structure of Only-One-Selected Atom          
213) Projected Band-Structure of Each Element                    
214) Projected Band-Structure of Selected Atoms                  
215) Projected Band-Structure by Element-Weights                 
216) The Sum of Projected Band for Selected Atoms and Orbitals   

Then you can follow the prompts to automatically draw the energy band diagram.然后就可以按照提示自动绘制能带图了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM