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


Python Vibrations.get_frequencies方法代码示例

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


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

示例1: __init__

# 需要导入模块: from ase.vibrations import Vibrations [as 别名]
# 或者: from ase.vibrations.Vibrations import get_frequencies [as 别名]
    def __init__(self, atoms, vibname, minfreq=None, maxfreq=None):
        """Input is a atoms object and the corresponding vibrations. 
        With minfreq and maxfreq frequencies can    
        be excluded from the calculation"""

        self.atoms = atoms
        # V = a * v is the combined atom and xyz-index
        self.mm05_V = np.repeat(1.0 / np.sqrt(atoms.get_masses()), 3)
        self.minfreq = minfreq
        self.maxfreq = maxfreq
        self.shape = (len(self.atoms), 3)

        vib = Vibrations(atoms, name=vibname)
        self.energies = np.real(vib.get_energies(method="frederiksen"))  # [eV]
        self.frequencies = np.real(vib.get_frequencies(method="frederiksen"))  # [cm^-1]
        self.modes = vib.modes
        self.H = vib.H
开发者ID:jboes,项目名称:ase,代码行数:19,代码来源:franck_condon.py

示例2: calculate

# 需要导入模块: from ase.vibrations import Vibrations [as 别名]
# 或者: from ase.vibrations.Vibrations import get_frequencies [as 别名]
def calculate(element, ref_data, p):
    values_dict = {}
    values_dict[p['xc']] = {}
    for XY, data in ref_data[p['xc']].items():
        X = XY.split('-')[0]
        Y = XY.split('-')[1]
        if (X == Y and X == element) or (X != Y and (X == element or Y == element)):
            # compound contains the requested element
            re_ref = data['re']
            we_ref = data['we']
            m0_ref = data.get('m0', 0.0)
            #
            compound = Atoms(X+Y,
                             [
                (0,       0,     0.5  ),
                (0,       0,     0.5+re_ref/a),
                ],
                             pbc=0)
            compound.set_cell([a, b, c], scale_atoms=1)
            compound.center()

            # calculation on the reference geometry
            calc = Calculator(**p)
            compound.set_calculator(calc)
            e_compound = compound.get_potential_energy()
            finegd = calc.density.finegd
            dip = finegd.calculate_dipole_moment(calc.density.rhot_g)*calc.a0
            vib = Vibrations(compound)
            vib.run()
            vib_compound = vib.get_frequencies(method='frederiksen').real[-1]
            world.barrier()
            vib_pckl = glob('vib.*.pckl')
            if rank == 0:
                for file in vib_pckl: remove(file)

            # calculation on the relaxed geometry
            qn = QuasiNewton(compound)
            #qn.attach(PickleTrajectory('compound.traj', 'w', compound).write)
            qn.run(fmax=0.05)
            e_compound_r = compound.get_potential_energy()
            dist_compound_r = compound.get_distance(0,1)
            dip_r = finegd.calculate_dipole_moment(calc.density.rhot_g)*calc.a0
            vib = Vibrations(compound)
            vib.run()
            vib_compound_r = vib.get_frequencies(method='frederiksen').real[-1]
            world.barrier()
            vib_pckl = glob('vib.*.pckl')
            if rank == 0:
                for file in vib_pckl: remove(file)

            del compound
            e = e_compound
            we = vib_compound
            m0 = dip
            e_r = e_compound_r
            we_r = vib_compound_r
            re_r = dist_compound_r
            m0_r = dip_r
            #
            values_dict[p['xc']][XY] = {'re': re_r, 'we': (we_r, we), 'm0': (m0_r, m0)}
    #
    return values_dict
开发者ID:eojons,项目名称:gpaw-scme,代码行数:64,代码来源:XY.py

示例3: len

# 需要导入模块: from ase.vibrations import Vibrations [as 别名]
# 或者: from ase.vibrations.Vibrations import get_frequencies [as 别名]
               maxiter=777,
               convergence={'lshift': 0.0},
               basis=basis,
               basispar='spherical',
               direct='noio',
               raw='set int:txs:limxmem 134217728\nmemory total 8000 Mb noverify\n',
               label=label)
 atoms.set_calculator(calc)
 t = time.time()
 if len(atoms) > 1:
     # need a copy of atoms for calculation of vibrations
     vibatoms = atoms.copy()
     vibatoms.set_calculator(calc)
     vib = Vibrations(vibatoms, name=label + '_fixed')
     vib.run()
     f = vib.get_frequencies()[-1].real
     # clean nwchem restart
     if os.path.exists(name + '_' + code + '.db'):
         os.remove(name + '_' + code + '.db')
     atoms.get_potential_energy()
     c.write(atoms, name=name, relaxed=False, basis=basis,
             frequency=f,
             time=time.time()-t)
 else:
     atoms.get_potential_energy()
     c.write(atoms, name=name, relaxed=False, basis=basis,
             time=time.time()-t)
 if len(atoms) > 1:
     opt = BFGS(atoms,
                logfile=name + '_' + code + '.log',
                trajectory=name + '_' + code + '.traj')
开发者ID:svn2github,项目名称:computational-materials-repository,代码行数:33,代码来源:dftpu_nwchem.py

示例4: Atoms

# 需要导入模块: from ase.vibrations import Vibrations [as 别名]
# 或者: from ase.vibrations.Vibrations import get_frequencies [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

示例5: Atoms

# 需要导入模块: from ase.vibrations import Vibrations [as 别名]
# 或者: from ase.vibrations.Vibrations import get_frequencies [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


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