def vibCalc(self): from espresso.vibespresso import vibespresso spinpol = any([x > 0 for x in self.magmomsinit()]) dipole = True if self.kind() == 'surface' else False return vibespresso( pw=self.pw # planewave cutoff , dw=self.pw * self.dwratio() # density cutoff , xc=self.xc, kpts=self.kpt(), spinpol=spinpol, convergence={ 'energy': self.econv(), 'mixing': self.mixing(), 'nmix': self.nmix(), 'maxsteps': self.maxstep(), 'diag': 'david' }, nbands=self.nbands(), sigma=self.sigma(), dipole={'status': dipole}, outdirprefix='vibdir', output={'removesave': True}, psppath=psppath)
def makeQEvibcalc(p): from espresso.vibespresso import vibespresso pspDict = { 'sherlock': { 'gbrv15pbe': '/home/vossj/suncat/psp/gbrv1.5pbe' }, 'suncat': { 'gbrv15pbe': '/nfs/slac/g/suncatfs/sw/external/esp-psp/gbrv1.5pbe' } } pspPath = pspDict[getCluster()][p['psp']] return vibespresso(pw=p['pw'], dw=p['pw'] * p['dwrat'], xc=p['xc'], kpts=kpt, spinpol=spinpol, convergence={ 'energy': p['econv'], 'mixing': p['mixing'], 'nmix': p['nmix'], 'maxsteps': p['maxstep'], 'diag': 'david' }, nbands=p['nbands'], sigma=p['sigma'], dipole={'status': p['kind'] == 'surface'}, outdir='calcdir', startingwfc='atomic+random', psppath=pspPath, output={'removesave': True})
def makeQEvibcalc(params): from espresso.vibespresso import vibespresso return vibespresso(pw=p['pw'], dw=p['pw'] * p['dwrat'], xc=p['xc'], kpts=kpt, spinpol=spinpol, convergence={ 'energy': p['econv'], 'mixing': p['mixing'], 'nmix': p['nmix'], 'maxsteps': p['maxstep'], 'diag': 'david' }, nbands=p['nbands'], sigma=p['sigma'], dipole={'status': p['kind'] == 'surface'}, outdir='calcdir', startingwfc='atomic+random', psppath=pspPath, output={'removesave': True})
def vibCalc(self): from espresso.vibespresso import vibespresso return vibespresso( pw=self.pw(), dw=self.pw() * self.dwrat(), xc=self.xc(), kpts=self.kpt(), spinpol=self.spinpol(), convergence={ 'energy': self.econv(), 'mixing': self.mixing(), 'nmix': self.nmix(), 'maxsteps': self.maxstep(), 'diag': 'david' }, nbands=self.nbands(), sigma=self.sigma(), dipole={'status': self.dipole()}, outdir='calcdir' # output directory , startingwfc='atomic+random' #alternatively, 'file' for restart , psppath=self.psppath(), output={'removesave': True})
dyn.run(fmax=0.05) energy = atoms.get_potential_energy() calc.stop() # Calculate vibrations calcvib = vibespresso( pw=500, # plane-wave cutoff dw=5000, # density cutoff xc='BEEF-vdW', # exchange-correlation functional kpts='gamma', # k-point sampling nbands=-10, # 10 extra bands besides the bands needed to hold # the valence electrons sigma=0.1, psppath='/home/vossj/suncat/psp/gbrv1.5pbe', # pseudopotential convergence={ 'energy': 1e-5, 'mixing': 0.1, 'nmix': 10, 'mix': 4, 'maxsteps': 500, 'diag': 'david' }, # convergence parameters outdirprefix='calcdirv') # output directory for Quantum Espresso files atoms.set_calculator(calcvib) vib = Vibrations(atoms, indices=vibrateatoms, delta=0.03) vib.run() vib.summary(method='standard')
else: print "Wrong number of metal atoms! Check your input trajectory!" exit() params = {'pw':500, 'dw':5000, 'kpts':kpts, 'nbands':-20, 'xc':'BEEF-vdW', 'psppath':'/home/vossj/suncat/psp/gbrv1.5pbe', 'convergence':{'energy':1e-5, 'mixing':0.1, 'nmix':10, 'maxsteps':500, 'diag':'david'}, 'spinpol':False} calc = espresso(outdir = 'calcdir', **params) # regular espresso calculator calcvib = vibespresso(outdirprefix = 'vibdir', **params) # special calculator for the vibration calculations atoms.set_calculator(calc) # attach calculator to the atoms energy = atoms.get_potential_energy() # caclulate the energy, to be used to determine G # vibrate N and H atoms vibrateatoms = [atom.index for atom in atoms if atom.symbol in ['H','N']] # calculate the vibrational modes for all N and H atoms atoms.set_calculator(calcvib) # attach vibrations calculator to the 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.
atoms = io.read('qn.traj') # optimized atoms.set_masses() from espresso import espresso calc = vibespresso( pw=800, # planewave cutoff dw=8000, # density cutoff nbands=-10, # number of bands kpts=(8, 8, 8), # k points xc='rpbe', # exchange correlation method sigma=0.2, # Fermi temperature dipole={'status': False}, spinpol=False, convergence={ 'energy': 0.0005, 'mixing': 0.1, 'nmix': 10, 'maxsteps': 500, 'diag': 'david' }, outdirprefix='vibdir') atoms.set_calculator(calc) vib = Vibrations(atoms, delta=0.04, indices=vib_atoms) vib.run() vib.summary(log='vibrations.txt') vib.write_jmol()
dyn = QuasiNewton(atoms, logfile=name + '.log', trajectory=name + '.traj') dyn.run(fmax=0.05) energy = atoms.get_potential_energy() calc.stop() # Calculate vibrations calcvib = vibespresso(pw=500, # plane-wave cutoff dw=5000, # density cutoff xc='BEEF-vdW', # exchange-correlation functional kpts='gamma', # k-point sampling nbands=-10, # 10 extra bands besides the bands needed to hold # the valence electrons sigma=0.1, psppath='/home/vossj/suncat/psp/gbrv1.5pbe', # pseudopotential convergence={'energy': 1e-5, 'mixing': 0.1, 'nmix': 10, 'mix': 4, 'maxsteps': 500, 'diag': 'david' }, # convergence parameters outdirprefix='calcdirv') # output directory for Quantum Espresso files atoms.set_calculator(calcvib) vib = Vibrations(atoms, indices=vibrateatoms, delta=0.03) vib.run() vib.summary(method='standard')
atoms.rattle() atoms.set_masses() calc = vibespresso( pw=pw, # planewave cutoff dw=dw, # density cutoff nbands=-10, # number of bands kpts=kpts, # k points xc=xc, # exchange correlation method sigma=sigma, # Fermi temperature dipole= dipole, spinpol = spinpol, convergence={ 'energy': 0.0005, 'mixing': mixing, 'nmix':10, 'maxsteps': maxsteps, 'diag': 'david'}, #mode = 'scf', output = {'avoidio':False, 'removewf':True, 'wf_collect':False}, outdirprefix='vibdir' ) atoms.set_calculator(calc) vib = Vibrations(atoms, delta=0.04, indices=vib_atoms) vib.run()