當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。