Chap.8 计算小白硬学VASP —— 材料性质计算—>能带计算
¡Hola a todos!
本章介绍如何计算能带结构,VASP计算流程代码如下:
1 2 3 4 5 6 7 8 9 10 11 from mp_api.client import MPResterapi_key = 'your key' with MPRester(api_key) as mpr: structure = mpr.get_structure_by_material_id('mp-924129' ) primtive_structure = structure.get_primitive_structure() primtive_structure.to(filename='ZrNiSn_primitive.cif' )
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 from pymatgen.io.vasp.sets import MPRelaxSetfrom pymatgen.io.vasp.inputs import Kpointsfrom pymatgen.core.structure import Structureimport osprimtive_cell = './ZrNiSn_primitive.cif' incar = { "ENCUT" :400 , "EDIFF" :1E-4 , "EDIFG" :-0.05 , "ISPIN" :1 , "LORBIT" :12 , } struct = Structure.from_file(primtive_cell) primtive_relax = MPRelaxSet(struct, user_incar_settings=incar, user_potcar_functional='PBE_54' ) primtive_relax.write_input('./ZrNiSn_primitive/relax' )
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 from pymatgen.io.vasp.sets import MPStaticSetimport osrelax_dir = './ZrNiSn_primitive/relax' static_incar = { "EDIFF" :1E-6 , "ISMEAR" :0 , "LORBIT" :12 , } primtive_static = MPStaticSet.from_prev_calc(prev_calc_dir=relax_dir,user_incar_settings=static_incar, user_potcar_functional='PBE_54' ) prim_static.write_input('./ZrNiSn_primitive/static' )
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 from pymatgen.io.vasp.sets import MPNonSCFSetfrom pymatgen.symmetry.bandstructure import HighSymmKpathfrom pymatgen.core.structure import Structurefrom pymatgen.io.vasp.inputs import Kpointsimport osstatic_dir = './ZrNiSn_primitive/static' structure = Structure.from_file(os.path.join(static_dir, 'POSCAR' )) kpath = HighSymmKpath(structure=structure,path_type='hinuma' ) kpoints = Kpoints.automatic_linemode(divisions=10 ,ibz=kpath) band_incar = { "EDIFF" :1E-6 , "ISMEAR" :0 , "LORBIT" :12 , "NBANDS" :64 , } band = MPNonSCFSet.from_prev_calc(prev_calc_dir=static_dir,user_incar_settings=band_incar,user_kpoints_settings=kpoints,user_potcar_functional='PBE_54' ) band.write_input('./ZrNiSn_primitive/band' )
INCAR中有几点设置需要注意:
ISPIN
开关需要根据自己的体系来决定是否考虑自旋;
LORBIT
建议全程设置为12,方便后面分析轨道投影能带/态密度。
能带计算中这里我们采用HighSymmKpath
方法自动针对结构生成高对称路径,需要注意的是,这里的结构必须是primtive_cell
。
¡Muchas gracias!