Exemplo n.º 1
0
 def calculate(self, name, atoms):
     data = MoleculeTask.calculate(self, name, atoms)
     exx = HybridXC('EXX', alpha=5.0)
     dexx = atoms.calc.get_xc_difference(exx)
     data['EXX'] = dexx
     data['EXXvc'] = exx.evc
     return data
Exemplo n.º 2
0
 def calculate(self, name, atoms):
     data = MoleculeTask.calculate(self, name, atoms)
     try:
         steps = atoms.get_calculator().get_number_of_iterations()
     except (AttributeError, NotImplemented):
         steps = None
     data['calculator steps'] = steps
     return data
Exemplo n.º 3
0
 def calculate(self, name, atoms):
     data = MoleculeTask.calculate(self, name, atoms)
     try:
         steps = atoms.get_calculator().get_number_of_iterations()
     except (AttributeError, NotImplemented):
         steps = None
     data['calculator steps'] = steps
     return data
Exemplo n.º 4
0
 def calculate(self, name, atoms):
     data = MoleculeTask.calculate(self, name, atoms)
     data['relaxed fmax'] = np.sqrt((atoms.get_forces()**2).sum(axis=1)).max()
     data['fmax'] = self.fmax
     if 'energy' in data and 'relaxed energy' not in data:
         # no optimization performed
         data['relaxed energy'] = data['energy']
         data['steps'] = 0
     elif 'relaxed energy' in data:
         # optimization
         data['steps'] = self.steps
     if data['relaxed fmax'] > data['fmax']:
         raise RuntimeError('Optimization failed to converge')
     return data
Exemplo n.º 5
0
 def calculate(self, name, atoms):
     data = MoleculeTask.calculate(self, name, atoms)
     data['relaxed fmax'] = np.sqrt(
         (atoms.get_forces()**2).sum(axis=1)).max()
     data['fmax'] = self.fmax
     if 'energy' in data and 'relaxed energy' not in data:
         # no optimization performed
         data['relaxed energy'] = data['energy']
         data['steps'] = 0
     elif 'relaxed energy' in data:
         # optimization
         data['steps'] = self.steps
     if data['relaxed fmax'] > data['fmax']:
         raise RuntimeError('Optimization failed to converge')
     return data