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


Python Vibrations.write_mode方法代码示例

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


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

示例1: Vibrations

# 需要导入模块: from ase.vibrations import Vibrations [as 别名]
# 或者: from ase.vibrations.Vibrations import write_mode [as 别名]
# name of output file for free energies
output_name = 'out.energy'

### At 300K and 101325 Pa
### change for your operating conditions
T = 300     # K
P = 101325  # Pa

#########################################################################################################
#####                                     END                                                       #####
#########################################################################################################

energy = atoms.get_potential_energy()                 # caclulate the energy, to be used to determine G
vibrateatoms = [atom.index for atom in atoms if atom.symbol in ['H','N']]   # calculate the vibrational modes for all N and H atoms
# Calculate vibrations
vib = Vibrations(atoms,indices=vibrateatoms,delta=0.03)    # define a vibration calculation
vib.run()                                                  # run the vibration calculation
vib.summary(method='standard')                             # summarize the calculated results

for mode in range(len(vibrateatoms)*3):                    # Make trajectory files to visualize the modes.
    vib.write_mode(mode)

vibenergies=vib.get_energies()
vibenergies=[vib for vib in vibenergies if not isinstance(vib,complex)]  # only take the real modes
gibbs = HarmonicThermo(vib_energies = vibenergies, electronicenergy = energy)

freeenergy = gibbs.get_gibbs_energy(T,P)

f=open(output_name,'w')
f.write('Potential energy: '+str(energy)+'\n'+'Free energy: '+str(freeenergy)+'\n')
f.close
开发者ID:chemeng444,项目名称:chemeng444.github.io,代码行数:33,代码来源:vib_to_ads_free_energy.py

示例2: Atoms

# 需要导入模块: from ase.vibrations import Vibrations [as 别名]
# 或者: from ase.vibrations.Vibrations import write_mode [as 别名]
from ase import *
from ase.vibrations import Vibrations

n2 = Atoms('N2',
           positions=[(0, 0, 0), (0, 0, 1.1)],
           calculator=EMT())
QuasiNewton(n2).run(fmax=0.01)
vib = Vibrations(n2)
vib.run()
print vib.get_frequencies()
vib.summary()
print vib.get_mode(-1)
vib.write_mode(-1, nimages=20)
开发者ID:freephys,项目名称:python_ase,代码行数:15,代码来源:vib.py

示例3: molecule

# 需要导入模块: from ase.vibrations import Vibrations [as 别名]
# 或者: from ase.vibrations.Vibrations import write_mode [as 别名]
#!/usr/bin/env python
from ase import Atom, Atoms
from ase.structure import molecule
from ase.calculators.cp2k import CP2K
from ase.optimize import BFGS
from ase.vibrations import Vibrations
from multiprocessing import Pool
import os

atoms = molecule('CO')
atoms.center(vacuum=2.0)


calc = CP2K(label = 'molecules/co/vib',
      xc='PBE')
atoms.set_calculator(calc)
gopt = BFGS(atoms, logfile=None)
gopt.run(fmax=1e-2)
e = atoms.get_potential_energy()
pos = atoms.get_positions()
d = ((pos[0] - pos[1])**2).sum()**0.5
print('{0:1.4f}  {1:1.4f} '.format( e, d))

vib = Vibrations(n2)
vib.run()
vib.summary()
vib.write_mode(-1)

开发者ID:superstar54,项目名称:catacp2k,代码行数:29,代码来源:smol-co-vib.py

示例4: Atoms

# 需要导入模块: from ase.vibrations import Vibrations [as 别名]
# 或者: from ase.vibrations.Vibrations import write_mode [as 别名]
from ase import Atoms
from ase.calculators.emt import EMT
from ase.optimize import QuasiNewton
from ase.vibrations import Vibrations
from ase.thermochemistry import IdealGasThermo

n2 = Atoms('N2',
           positions=[(0, 0, 0), (0, 0, 1.1)],
           calculator=EMT())
QuasiNewton(n2).run(fmax=0.01)
vib = Vibrations(n2)
vib.run()
print(vib.get_frequencies())
vib.summary()
print(vib.get_mode(-1))
vib.write_mode(n=None, nimages=20)
vib_energies = vib.get_energies()

thermo = IdealGasThermo(vib_energies=vib_energies, geometry='linear',
                        atoms=n2, symmetrynumber=2, spin=0)
thermo.get_gibbs_energy(temperature=298.15, pressure=2 * 101325.)
开发者ID:PHOTOX,项目名称:fuase,代码行数:23,代码来源:vib.py

示例5: molecule

# 需要导入模块: from ase.vibrations import Vibrations [as 别名]
# 或者: from ase.vibrations.Vibrations import write_mode [as 别名]
CH3 = molecule('CH3')
add_adsorbate(slab, CH3, 3.0, 'ontop')

constraint = FixAtoms(mask=[a.symbol == 'Al' for a in slab])
slab.set_constraint(constraint)

slab.set_calculator(EMT())

dyn = QuasiNewton(slab, trajectory='relax.traj')
dyn.run(fmax=0.01)

vib = Vibrations(slab, indices=[8, 9, 10, 11])
vib.run()
vib.summary()
vib.write_mode()

print('\n >> Anharmonics <<\n')

AM = AnharmonicModes(
    vibrations_object=vib,
    pre_names='an_mode_',
    settings={
        'use_forces': True,
        # 'plot_mode': True,
        'temperature': 298.15,
        # 'rot_nsamples': 15,
        # 'max_step_iterations': 1,
        # 'min_step_iterations': 1,
        'plot_mode_each_iteration': True,
        # 'rot_nsamples': 9,
开发者ID:keldLundgaard,项目名称:ase-anharmonics,代码行数:32,代码来源:rotate_mol_on_surface.py


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