geometric/internal.py
def calcGradProj(self, xyz, gradx):
        """
        Project out the components of the internal coordinate gradient along the
        constrained degrees of freedom. This is used to calculate the convergence
        criteria for constrained optimizations.

        Parameters
        ----------
        xyz : np.ndarray
            Flat array containing Cartesian coordinates in atomic units
        gradx : np.ndarray
            Flat array containing gradient in Cartesian coordinates

        Returns
        -------
        np.ndarray
            Flat array containing gradient in Cartesian coordinates with forces
            along constrained directions projected out
        """
        if len(self.Prims.cPrims) == 0:
            return gradx
        q0 = self.calculate(xyz)
        Ginv = self.GInverse(xyz)
        Bmat = self.wilsonB(xyz)
        # Internal coordinate gradient
        # Gq = np.matrix(Ginv)*np.matrix(Bmat)*np.matrix(gradx).T
        Gq = multi_dot([Ginv, Bmat, gradx.T])
        Gqc = np.array(Gq).flatten()
        # Remove the directions that are along the DLCs that we are constraining
        for i in self.cDLC:
            Gqc[i] = 0.0
        # Gxc = np.array(np.matrix(Bmat.T)*np.matrix(Gqc).T).flatten()
        Gxc = multi_dot([Bmat.T, Gqc.T]).flatten()
        return Gxc

        Project out the components of the internal coordinate gradient along the
        constrained degrees of freedom. This is used to calculate the convergence
        criteria for constrained optimizations.

        Parameters
        ----------
        xyz : np.ndarray
            Flat array containing Cartesian coordinates in atomic units
        gradx : np.ndarray
            Flat array containing gradient in Cartesian coordinates

        Returns
        -------
        np.ndarray
            Flat array containing gradient in Cartesian coordinates with forces
            along constrained directions projected out
        
Project out the components of the internal coordinate gradient along the
constrained degrees of freedom. This is used to calculate the convergence
criteria for constrained optimizations.

Parameters

xyz : np.ndarray
Flat array containing Cartesian coordinates in atomic units
gradx : np.ndarray
Flat array containing gradient in Cartesian coordinates

Returns

np.ndarray
Flat array containing gradient in Cartesian coordinates with forces
along constrained directions projected out
Project out the components of the internal coordinate gradient along the constrained degrees of freedom . This is used to calculate the convergence criteria for constrained optimizations . Parameters xyz : np . ndarray Flat array containing Cartesian coordinates in atomic units gradx : np . ndarray Flat array containing gradient in Cartesian coordinates Returns np . ndarray Flat array containing gradient in Cartesian coordinates with forces along constrained directions projected out
def calcGradProj(self, xyz, gradx):
        if len(self.Prims.cPrims) == 0:
            return gradx
        q0 = self.calculate(xyz)
        Ginv = self.GInverse(xyz)
        Bmat = self.wilsonB(xyz)
        Gq = multi_dot([Ginv, Bmat, gradx.T])
        Gqc = np.array(Gq).flatten()
        for i in self.cDLC:
            Gqc[i] = 0.0
        Gxc = multi_dot([Bmat.T, Gqc.T]).flatten()
        return Gxc
def calcGradProj ( self , xyz , gradx ) : if len ( self . Prims . cPrims ) == 0 : return gradx q0 = self . calculate ( xyz ) Ginv = self . GInverse ( xyz ) Bmat = self . wilsonB ( xyz ) Gq = multi_dot ( [ Ginv , Bmat , gradx . T ] ) Gqc = np . array ( Gq ) . flatten ( ) for i in self . cDLC : Gqc [ i ] = 0.0 Gxc = multi_dot ( [ Bmat . T , Gqc . T ] ) . flatten ( ) return Gxc
Project out the components of the internal coordinate gradient along the
constrained degrees of freedom.
Project out the components of the internal coordinate gradient along the constrained degrees of freedom .
"""
        Project out the components of the internal coordinate gradient along the
        constrained degrees of freedom. This is used to calculate the convergence
        criteria for constrained optimizations.

        Parameters
        ----------
        xyz : np.ndarray
            Flat array containing Cartesian coordinates in atomic units
        gradx : np.ndarray
            Flat array containing gradient in Cartesian coordinates

        Returns
        -------
        np.ndarray
            Flat array containing gradient in Cartesian coordinates with forces
            along constrained directions projected out
        """ # Internal coordinate gradient # Gq = np.matrix(Ginv)*np.matrix(Bmat)*np.matrix(gradx).T # Remove the directions that are along the DLCs that we are constraining # Gxc = np.array(np.matrix(Bmat.T)*np.matrix(Gqc).T).flatten()
self
xyz
gradx