当前位置: 首页>>代码示例>>Python>>正文


Python Vasp.get_pseudopotentials方法代码示例

本文整理汇总了Python中vasp.Vasp.get_pseudopotentials方法的典型用法代码示例。如果您正苦于以下问题:Python Vasp.get_pseudopotentials方法的具体用法?Python Vasp.get_pseudopotentials怎么用?Python Vasp.get_pseudopotentials使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vasp.Vasp的用法示例。


在下文中一共展示了Vasp.get_pseudopotentials方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1:

# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import get_pseudopotentials [as 别名]
# now convert arrays back to unitcell shape
x = np.reshape(real[:, 0], (n0, n1, n2))
y = np.reshape(real[:, 1], (n0, n1, n2))
z = np.reshape(real[:, 2], (n0, n1, n2))
nelements = n0 * n1 * n2
voxel_volume = atoms.get_volume() / nelements
total_electron_charge = -cd.sum() * voxel_volume
electron_density_center = np.array([(cd * x).sum(),
                                    (cd * y).sum(),
                                    (cd * z).sum()])
electron_density_center *= voxel_volume
electron_density_center /= total_electron_charge
electron_dipole_moment = -electron_density_center * total_electron_charge
# now the ion charge center. We only need the Zval listed in the potcar
from vasp.POTCAR import get_ZVAL
LOP = calc.get_pseudopotentials()
ppp = os.environ['VASP_PP_PATH']
zval = {}
for sym, ppath, hash in LOP:
    fullpath = os.path.join(ppp, ppath)
    z = get_ZVAL(fullpath)
    zval[sym] = z
    ion_charge_center = np.array([0.0, 0.0, 0.0])
    total_ion_charge = 0.0
for atom in atoms:
    Z = zval[atom.symbol]
    total_ion_charge += Z
    pos = atom.position
    ion_charge_center += Z * pos
ion_charge_center /= total_ion_charge
ion_dipole_moment = ion_charge_center * total_ion_charge
开发者ID:beeruyue,项目名称:dft-book,代码行数:33,代码来源:script-32.py


注:本文中的vasp.Vasp.get_pseudopotentials方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。