File InternalCoordinates.h¶
- Copyright
This code is licensed under the 3-clause BSD license.
Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.
See LICENSE.txt for details.
-
namespace
Scine
This header file contains functions that allow for common notation for common things that can be done at a different degree of derivatives.
This header contains alias definitions defining which classes to use for the different degrees of derivatives.
-
namespace
Utils
-
class
InternalCoordinates
- #include <InternalCoordinates.h>
This class provides the option to convert from Cartesian into internal coordinates.
As default internal redundant coordinates will be used, as a backup a set of internal coordinates generated by only removing translation and rotational degrees of freedom can be chosen.
The redundant internal coordinates are generated using ‘libirc’: https://github.com/RMeli/irc/
Public Functions
-
InternalCoordinates
(const AtomCollection &atoms, bool rotTransOnly = false) Constructor.
- Parameters
atoms
: The atoms for which the initial internal coordinates shall be generated.rotTransOnly
: If true will only remove rotation and translation, without actually generating internal coordinates from bonds, angles and dihedrals.
-
~InternalCoordinates
() Destructtor.
-
PositionCollection
coordinatesToCartesian
(const Eigen::VectorXd &internals, unsigned int maxIters = 25, double tolerance = 1e-6) const Back transforms internal coordinates into Cartesian ones.
This procedure is iterative.
- Return
PositionCollection The Cartesian representation of the coordinates.
- Parameters
internals
: The internal representation of the coordinates.maxIters
: The maximum number of iterations to be tried for the back transformation.tolerance
: The tolerance (RMS of the internals) at which the back transformation is considered converged.
-
Eigen::VectorXd
coordinatesToInternal
(const PositionCollection &cartesian) const Transforms Cartesian coordinates into internal coordinates.
- Return
Eigen::VectorXd The internal representation of the coordinates.
- Parameters
cartesian
: The Cartesian representation of the coordinates.
-
Eigen::VectorXd
gradientsToInternal
(const GradientCollection &cartesian) const Transforms Cartesian gradients into internal gradients.
This step does include the projection of the gradient into a valid one, for the case of internal redundant coordinates.
- Return
Eigen::VectorXd The internal representation of the gradients.
- Parameters
cartesian
: The Cartesian representation of the gradients.
-
Eigen::MatrixXd
projectHessianInverse
(const Eigen::MatrixXd &inverse) const Project the Hessian inverse such that it represents valid changes in internal coordinates.
If only translation and rotation were removed this call does nothing to the given matrix. It is thus safe to call this function in any case.
Note: this projection is not a projection into internal coordinates from Cartesian coordinates.
- Return
Eigen::MatrixXd The projected Hessian inverse.
- Parameters
inverse
: The Hessian inverse.
-
Eigen::MatrixXd
projectHessian
(const Eigen::MatrixXd &hessian) const Project the Hessian such that it represents valid changes in internal coordinates.
If only translation and rotation were removed this call does nothing to the given matrix. It is thus safe to call this function in any case.
Note: this projection is not a projection into internal coordinates from Cartesian coordinates.
- Return
Eigen::MatrixXd The projected Hessian.
- Parameters
hessian
: The Hessian.
-
Eigen::MatrixXd
inverseHessianGuess
() const Generates a guess for an inverse Hessian, the guess is a diagonal Matrix.
If the internal representation corresponds only to the removal of translation and rotation modes, the guess will be the identity.
- Return
Eigen::MatrixXd The initial guess for the inverse Hessian.
-
Eigen::MatrixXd
hessianGuess
() const Generates a guess for a Hessian, the guess is a diagonal Matrix.
If the internal representation corresponds only to the removal of translation and rotation modes, the guess will be the identity.
- Return
Eigen::MatrixXd The initial guess for the Hessian.
-
-
class
-
namespace