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


Python Vasp.get_vibrational_modes方法代码示例

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


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

示例1: Vasp

# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import get_vibrational_modes [as 别名]
# <<h2o-vib-vis>>
from vasp import Vasp
import numpy as np
calc = Vasp('molecules/h2o_vib')
energies, modes = calc.get_vibrational_modes(mode=0, massweighted=True,
                                             show=True)
开发者ID:beeruyue,项目名称:dft-book,代码行数:8,代码来源:script-52.py

示例2: Vasp

# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import get_vibrational_modes [as 别名]
from vasp import Vasp
calc = Vasp('surfaces/Pt-slab-O-fcc')
calc.clone('surfaces/Pt-slab-O-fcc-vib')
calc.set(ibrion=5,     # finite differences with selective dynamics
         nfree=2,      # central differences (default)
         potim=0.015,  # default as well
         ediff=1e-8,
         nsw=1)
atoms = calc.get_atoms()
f, v = calc.get_vibrational_modes(0)
print 'Elapsed time = {0} seconds'.format(calc.get_elapsed_time())
allfreq = calc.get_vibrational_modes()[0]
from ase.units import meV
c = 3e10  # cm/s
h = 4.135667516e-15  # eV*s
print 'vibrational energy = {0} eV'.format(f)
print 'vibrational energy = {0} meV'.format(f/meV)
print 'vibrational freq   = {0} 1/s'.format(f/h)
print 'vibrational freq   = {0} cm^{{-1}}'.format(f/(h*c))
print
print 'All energies = ', allfreq
开发者ID:beeruyue,项目名称:dft-book,代码行数:23,代码来源:script-202.py

示例3: Vasp

# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import get_vibrational_modes [as 别名]
from vasp import Vasp
from ase.constraints import FixAtoms
# clone calculation so we do not overwrite previous results
calc = Vasp('surfaces/Pt-slab-O-bridge-xy-constrained')
calc.clone('surfaces/Pt-slab-O-bridge-vib')
calc.set(ibrion=5,  # finite differences with selective dynamics
         nfree=2,   # central differences (default)
         potim=0.015,  # default as well
         ediff=1e-8,
         nsw=1)
atoms = calc.get_atoms()
del atoms.constraints
constraint = FixAtoms(mask=[atom.symbol != 'O' for atom in atoms])
atoms.set_constraint([constraint])
f, v = calc.get_vibrational_modes(2)
print(calc.get_vibrational_modes()[0])
from ase.units import meV
c = 3e10  # cm/s
h = 4.135667516e-15  # eV*s
print('vibrational energy = {0} eV'.format(f))
print('vibrational energy = {0} meV'.format(f/meV))
print('vibrational freq   = {0} 1/s'.format(f/h))
print('vibrational freq   = {0} cm^(-1)'.format(f/(h*c)))
开发者ID:beeruyue,项目名称:dft-book,代码行数:25,代码来源:script-204.py

示例4: Atoms

# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import get_vibrational_modes [as 别名]
# <<water-vib>>
# adapted from http://cms.mpi.univie.ac.at/wiki/index.php/H2O_vibration
from ase import Atoms, Atom
from vasp import Vasp
import ase.units
atoms = Atoms([Atom('H', [0.5960812,  -0.7677068,   0.0000000]),
               Atom('O', [0.0000000,   0.0000000,   0.0000000]),
               Atom('H', [0.5960812,   0.7677068,   0.0000000])],
               cell=(8, 8, 8))
atoms.center()
calc = Vasp('molecules/h2o_vib',
            xc='PBE',
            encut=400,
            ismear=0,     # Gaussian smearing
            ibrion=6,     # finite differences with symmetry
            nfree=2,      # central differences (default)
            potim=0.015,  # default as well
            ediff=1e-8,   # for vibrations you need precise energies
            nsw=1,        # Set to 1 for vibrational calculation
            atoms=atoms)
print('Forces')
print('======')
print(atoms.get_forces())
print('')
calc.stop_if(calc.potential_energy is None)
# vibrational energies are in eV
energies, modes = calc.get_vibrational_modes()
print('energies\n========')
for i, e in enumerate(energies):
    print('{0:02d}: {1} eV'.format(i, e))
开发者ID:beeruyue,项目名称:dft-book,代码行数:32,代码来源:script-51.py


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