def calculate_energies_and_modes(self): if hasattr(self, 'im_r'): return ResonantRaman.calculate_energies_and_modes(self) # single transitions and their occupation om_Q = self.om_Q[self.skip:] om_v = om_Q ndof = len(om_Q) n_vQ = np.eye(ndof, dtype=int) l_Q = range(ndof) ind_v = list(combinations_with_replacement(l_Q, 1)) if self.combinations > 1: if not self.combinations == 2: raise NotImplementedError for c in range(2, self.combinations + 1): ind_v += list(combinations_with_replacement(l_Q, c)) nv = len(ind_v) n_vQ = np.zeros((nv, ndof), dtype=int) om_v = np.zeros((nv), dtype=float) for j, wt in enumerate(ind_v): for i in wt: n_vQ[j, i] += 1 om_v = n_vQ.dot(om_Q) self.ind_v = ind_v self.om_v = om_v self.n_vQ = n_vQ # how many of each self.d_vQ = np.where(n_vQ > 0, 1, 0) # do we have them ?
def read(self, method='standard', direction='central'): ResonantRaman.read(self, method, direction) # single transitions and their occupation om_Q = self.om_Q[self.skip:] om_v = om_Q ndof = len(om_Q) n_vQ = np.eye(ndof, dtype=int) l_Q = range(ndof) ind_v = list(combinations_with_replacement(l_Q, 1)) if self.combinations > 1: if not self.combinations == 2: raise NotImplementedError for c in range(2, self.combinations + 1): ind_v += list(combinations_with_replacement(l_Q, c)) nv = len(ind_v) n_vQ = np.zeros((nv, ndof), dtype=int) om_v = np.zeros((nv), dtype=float) for j, wt in enumerate(ind_v): for i in wt: n_vQ[j, i] += 1 om_v = n_vQ.dot(om_Q) self.ind_v = ind_v self.om_v = om_v self.n_vQ = n_vQ # how many of each self.d_vQ = np.where(n_vQ > 0, 1, 0) # do we have them ?
def __init__(self, *args, **kwargs): """ Parameters ---------- all from ResonantRaman.__init__ combinations: int Combinations to consider for multiple excitations. Default is 1, possible 2 skip: int Number of first transitions to exclude. Default 0, recommended: 5 for linear molecules, 6 for other molecules nm: int Number of intermediate m levels to consider, default 20 """ self.combinations = kwargs.pop('combinations', 1) self.skip = kwargs.pop('skip', 0) self.nm = kwargs.pop('nm', 20) approximation = kwargs.pop('approximation', 'Albrecht') ResonantRaman.__init__(self, *args, **kwargs) self.set_approximation(approximation)
def __init__(self, *args, **kwargs): self.set_approximation(kwargs.pop('approximation', 'Profeta')) self.nonresonant = kwargs.pop('nonresonant', True) ResonantRaman.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): self._approx = 'PlaczekAlpha' ResonantRaman.__init__(self, *args, **kwargs)
from ase.vibrations.resonant_raman import ResonantRaman from gpaw.cluster import Cluster from gpaw import GPAW, FermiDirac from gpaw.lrtddft import LrTDDFT h = 0.25 atoms = Cluster('relaxed.traj') atoms.minimal_box(3.5, h=h) # relax the molecule calc = GPAW(h=h, occupations=FermiDirac(width=0.1), eigensolver='cg', symmetry={'point_group': False}, nbands=10, convergence={ 'eigenstates': 1.e-5, 'bands': 4 }) atoms.calc = calc # use only the 4 converged states for linear response calculation rr = ResonantRaman(atoms, LrTDDFT, exkwargs={'jend': 3}) rr.run()
c = 5.0 H2 = Atoms([ Atom('H', (a / 2, a / 2, (c - R) / 2)), Atom('H', (a / 2, a / 2, (c + R) / 2)) ], cell=(a, a, c)) calc = GPAW(xc=xc, nbands=3, spinpol=False, eigensolver='rmm-diis', txt=txt) H2.set_calculator(calc) H2.get_potential_energy() gsname = exname = 'rraman' rr = ResonantRaman(H2, KSSingles, gsname=gsname, exname=exname, exkwargs={ 'eps': 0.0, 'jend': 1 }) rr.run() # check size kss = KSSingles('rraman-d0.010.eq.ex.gz') assert (len(kss) == 1) rr = ResonantRaman( H2, KSSingles, gsname=gsname, exname=exname, verbose=True,
c = 5.0 H2 = Atoms([ Atom('H', (a / 2, a / 2, (c - R) / 2)), Atom('H', (a / 2, a / 2, (c + R) / 2)) ], cell=(a, a, c)) calc = GPAW(xc=xc, nbands=3, spinpol=False, eigensolver='rmm-diis', txt=txt) H2.set_calculator(calc) H2.get_potential_energy() gsname = exname = 'rraman' exkwargs = {'eps': 0.0, 'jend': 1} pz = ResonantRaman(H2, KSSingles, gsname=gsname, exname=exname, exkwargs=exkwargs, overlap=lambda x, y: Overlap(x).pseudo(y)) pz.run() # check size kss = KSSingles('rraman-d0.010.eq.ex.gz') assert (len(kss) == 1) om = 5 # Does Albrecht A work at all ? # ----------------------------- al = Albrecht(H2, KSSingles,