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