Skip to content

Commit

Permalink
Automatic Sync from SCM-svn to GitHub
Browse files Browse the repository at this point in the history
syncing the following commits:
GiulioBenedini: documentation improvements: spelling, get_energy documentation improvement, the units in the documentation is better to avoid the xpression atomic units EU209
  • Loading branch information
scmtestadf committed Dec 21, 2023
1 parent 847af29 commit 7408bf4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions interfaces/adfsuite/ams.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,31 +595,31 @@ def properties(kf):
return self._process_engine_results(properties, engine)


def get_energy(self, unit='au', engine=None):
"""Return final energy, expressed in *unit*.
def get_energy(self, unit='hartree', engine=None):
"""Return final energy, expressed in *unit*. The final energy is found in AMSResults%Energy of the engine rkf file. You can find the meaning of final energy in the engine documentation.
The *engine* argument should be the identifier of the file you wish to read. To access a file called ``something.rkf`` you need to call this function with ``engine='something'``. The *engine* argument can be omitted if there's only one engine results file in the job folder.
"""
return self._process_engine_results(lambda x: x.read('AMSResults', 'Energy'), engine) * Units.conversion_ratio('au', unit)


def get_gradients(self, energy_unit='au', dist_unit='au', engine=None):
def get_gradients(self, energy_unit='hartree', dist_unit='bohr', engine=None) -> np.ndarray:
"""Return the gradients of the final energy, expressed in *energy_unit* / *dist_unit*.
The *engine* argument should be the identifier of the file you wish to read. To access a file called ``something.rkf`` you need to call this function with ``engine='something'``. The *engine* argument can be omitted if there's only one engine results file in the job folder.
"""
return np.asarray(self._process_engine_results(lambda x: x.read('AMSResults', 'Gradients'), engine)).reshape(-1,3) * Units.conversion_ratio('au', energy_unit) / Units.conversion_ratio('au', dist_unit)


def get_stresstensor(self, engine=None):
def get_stresstensor(self, engine=None) -> np.ndarray:
"""Return the final stress tensor, expressed in atomic units.
The *engine* argument should be the identifier of the file you wish to read. To access a file called ``something.rkf`` you need to call this function with ``engine='something'``. The *engine* argument can be omitted if there's only one engine results file in the job folder.
"""
return np.asarray(self._process_engine_results(lambda x: x.read('AMSResults', 'StressTensor'), engine)).reshape(len(self.get_input_molecule().lattice),-1)


def get_hessian(self, engine=None):
def get_hessian(self, engine=None) -> np.ndarray:
"""Return the Hessian matrix, i.e. the second derivative of the total energy with respect to the nuclear coordinates, expressed in atomic units.
The *engine* argument should be the identifier of the file you wish to read. To access a file called ``something.rkf`` you need to call this function with ``engine='something'``. The *engine* argument can be omitted if there's only one engine results file in the job folder.
Expand Down
2 changes: 1 addition & 1 deletion tools/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class Units:
dicts['stress'] = stress


# Precompute a dict mapping lowercased unit names to quantityName:conversionFactor pairs
# Precomputed a dict mapping lowercased unit names to quantityName:conversionFactor pairs
quantities_for_unit = {}
for quantity in dicts:
for unit, factor in dicts[quantity].items():
Expand Down

0 comments on commit 7408bf4

Please sign in to comment.