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


Python Vasp.get_ados方法代码示例

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


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

示例1: Atoms

# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import get_ados [as 别名]
b = a / 2.
bulk = Atoms([Atom('Pd', (0.0, 0.0, 0.0))],
             cell=[(0, b, b),
                   (b, 0, b),
                   (b, b, 0)])
calc = Vasp('bulk/pd-ados',
            encut=300,
            xc='PBE',
            lreal=False,
            rwigs={'Pd': 1.5},  # wigner-seitz radii for ados
            kpts=[8, 8, 8],
            atoms=bulk)
# this runs the calculation
calc.wait(abort=True)
# now get results
energies, ados = calc.get_ados(0, 'd')
# we will select energies in the range of -10, 5
ind = (energies < 5) & (energies > -10)
energies = energies[ind]
dos = ados[ind]
Nstates = np.trapz(dos, energies)
occupied = energies <= 0.0
N_occupied_states = np.trapz(dos[occupied], energies[occupied])
# first moment
ed = np.trapz(energies * dos, energies) / Nstates
# second moment
wd2 = np.trapz(energies**2 * dos, energies) / Nstates
print 'Total # states = {0:1.2f}'.format(Nstates)
print 'number of occupied states = {0:1.2f}'.format(N_occupied_states)
print 'd-band center = {0:1.2f} eV'.format(ed)
print 'd-band width  = {0:1.2f} eV'.format(np.sqrt(wd2))
开发者ID:beeruyue,项目名称:dft-book,代码行数:33,代码来源:script-152.py

示例2: Vasp

# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import get_ados [as 别名]
from vasp import Vasp
from ase.dft.dos import DOS
import matplotlib.pyplot as plt
# get the geometry from another calculation
calc = Vasp('molecules/simple-co')
atoms = calc.get_atoms()
calc = Vasp('molecules/co-ados',
            encut=300,
            xc='PBE',
            rwigs={'C': 1.0, 'O': 1.0},     # these are the cutoff radii for projected states
            atoms=atoms)
calc.stop_if(calc.potential_energy is None)
# now get results
dos = DOS(calc)
plt.plot(dos.get_energies(), dos.get_dos() + 10)
energies, c_s = calc.get_ados(0, 's')
_, c_p = calc.get_ados(0, 'p')
_, o_s = calc.get_ados(1, 's')
_, o_p = calc.get_ados(1, 'p')
_, c_d = calc.get_ados(0, 'd')
_, o_d = calc.get_ados(1, 'd')
plt.plot(energies, c_s + 6, energies, o_s + 5)
plt.plot(energies, c_p + 4, energies, o_p + 3)
plt.plot(energies, c_d, energies, o_d + 2)
plt.xlabel('Energy - $E_f$ (eV)')
plt.ylabel('DOS')
plt.legend(['DOS',
            'C$_s$', 'O$_s$',
            'C$_p$', 'O$_p$',
            'C$_d$', 'O$_d$'],
           ncol=2, loc='best')
开发者ID:beeruyue,项目名称:dft-book,代码行数:33,代码来源:script-35.py


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