本文整理汇总了Python中vasp.Vasp.get_fermi_level方法的典型用法代码示例。如果您正苦于以下问题:Python Vasp.get_fermi_level方法的具体用法?Python Vasp.get_fermi_level怎么用?Python Vasp.get_fermi_level使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vasp.Vasp
的用法示例。
在下文中一共展示了Vasp.get_fermi_level方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Vasp
# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import get_fermi_level [as 别名]
from vasp import Vasp
import matplotlib.pyplot as plt
calc = Vasp('surfaces/Al-Na-nodip')
atoms = calc.get_atoms()
x, y, z, lp = calc.get_local_potential()
nx, ny, nz = lp.shape
axy_1 = [np.average(lp[:, :, z]) for z in range(nz)]
# setup the x-axis in realspace
uc = atoms.get_cell()
xaxis_1 = np.linspace(0, uc[2][2], nz)
e1 = atoms.get_potential_energy()
calc = Vasp('surfaces/Al-Na-dip-step2')
atoms = calc.get_atoms()
x, y, z, lp = calc.get_local_potential()
nx, ny, nz = lp.shape
axy_2 = [np.average(lp[:, :, z]) for z in range(nz)]
# setup the x-axis in realspace
uc = atoms.get_cell()
xaxis_2 = np.linspace(0, uc[2][2], nz)
ef2 = calc.get_fermi_level()
e2 = atoms.get_potential_energy()
print 'The difference in energy is {0} eV.'.format(e2-e1)
plt.plot(xaxis_1, axy_1, label='no dipole correction')
plt.plot(xaxis_2, axy_2, label='dipole correction')
plt.plot([min(xaxis_2), max(xaxis_2)], [ef2, ef2], 'k:', label='Fermi level')
plt.xlabel('z ($\AA$)')
plt.ylabel('xy-averaged electrostatic potential')
plt.legend(loc='best')
plt.savefig('images/dip-vs-nodip-esp.png')
示例2: Atoms
# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import get_fermi_level [as 别名]
a = 3.9 # approximate lattice constant
b = a / 2.
bulk = Atoms([Atom('Pd', (0.0, 0.0, 0.0))],
cell=[(0, b, b),
(b, 0, b),
(b, b, 0)])
RWIGS = [1.0, 1.1, 1.25, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0 ]
ED, WD, N = [], [], []
for rwigs in RWIGS:
calc = Vasp('bulk/pd-ados')
calc.clone('bulk/pd-ados-rwigs-{0}'.format(rwigs))
calc.set(rwigs={'Pd': rwigs})
if calc.potential_energy is None:
continue
# now get results
ados = VaspDos(efermi=calc.get_fermi_level())
energies = ados.energy
dos = ados.site_dos(0, 'd')
#we will select energies in the range of -10, 5
ind = (energies < 5) & (energies > -10)
energies = energies[ind]
dos = dos[ind]
Nstates = np.trapz(dos, energies)
occupied = energies <= 0.0
N_occupied_states = np.trapz(dos[occupied], energies[occupied])
ed = np.trapz(energies * dos, energies) / np.trapz(dos, energies)
wd2 = np.trapz(energies**2 * dos, energies) / np.trapz(dos, energies)
N.append(N_occupied_states)
ED.append(ed)
WD.append(wd2**0.5)
plt.plot(RWIGS, N, 'bo', label='N. occupied states')
示例3: Vasp
# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import get_fermi_level [as 别名]
from vasp import Vasp
calc = Vasp('bulk/tio2/step3')
print calc.get_fermi_level()
calc.abort()
n, bands, p = calc.get_bandstructure(kpts_path=[('$\Gamma$', [0.0, 0.0, 0.0]),
('X', [0.5, 0.5, 0.0]),
('X', [0.5, 0.5, 0.0]),
('M', [0.0, 0.5, 0.5]),
('M', [0.0, 0.5, 0.5]),
('$\Gamma$', [0.0, 0.0, 0.0])])
p.savefig('images/tio2-bandstructure-dos.png')