예제 #1
0
 def run_atoms(self, job, atoms):
     self.log('-'*60)
     self.log('Submit job {0}'.format(job))
     self.log.print_atoms(atoms)
     calc = Espresso(
             label = os.path.join(self.label, job),
             **self.calculator,
             )
     calc.parameters['input_data']['prefix'] = job
     # self.log('    Commnad: {0}'.format(calc.command))
     atoms.calc = calc
     # atoms.get_potential_energy()
     calc.run(atoms = atoms, restart = 1)
     calc.read_results()
     self.results[job] = deepcopy(calc.results)
     calc.clean()
     return job, self.results[job]['energy']
예제 #2
0
 def cell_relax_espresso(self, job, atoms):
     """
     """
     self.log('-' * 60)
     self.log('Submit job {0}'.format(job))
     self.log.print_atoms(atoms)
     calculator = deepcopy(self.calculator)
     calculator.update({
         'calculation': 'vc-relax',
         'prefix': job,
     })
     calc = Espresso(
         label=os.path.join(self.label, job),
         **calculator,
     )
     atoms.calc = calc
     calc.run(atoms=atoms)
     calc.read_results()
     self.results[job] = deepcopy(calc.results)
     return job, self.results[job]['energy']
예제 #3
0
 def geo_relax_espresso(self, job, atoms):
     """
     """
     self.log('-' * 60)
     self.log('Run geometry relaxtion: {0}'.format(job))
     self.log.print_atoms(atoms)
     calculator = deepcopy(self.calculator)
     calculator.update({
         'calculation': 'relax',
         'prefix': job,
     })
     dip = dipole_correction(atoms, edir=3)
     calculator.update(dip)
     calc = Espresso(
         label=os.path.join(self.label, job),
         **calculator,
     )
     atoms.calc = calc
     calc.run(atoms=atoms)
     calc.read_results()
     energy = calc.results['energy']
     self.results[job] = deepcopy(calc.results)
     self.calcs[job] = calc
     return job, energy
예제 #4
0
from ase.build import bulk
from xespresso import Espresso

atoms = bulk('Fe')
pseudopotentials = {'Fe': 'Fe.pbe-spn-rrkjus_psl.1.0.0.UPF'}
input_data = {'smearing': 'gaussian'}
calc = Espresso(pseudopotentials = pseudopotentials, 
                label  = 'scf/fe',  # 'scf/fe' is the directory, 'fe' is the prefix
                ecutwfc = 40,
                occupations = 'smearing',
                degauss = 0.02,
                input_data = input_data,
                kpts=(6, 6, 6),
                debug = True,
                )
atoms.calc = calc
calc.run(atoms = atoms)
e = calc.results['energy']
print('Energy: {0:1.3f}'.format(e))

'''
Energy: -3368.401
'''