pele.utils.hessian#

Module source

Tools for manipulating the Hessian. In particular, for finding eigenvalues and eigenvectors

pele.utils.hessian.get_eigvals()[source]

Source

def get_eigvals(hess, **kwargs):

return the eigenvalues of a Hessian (symmetric)

The following docs are from numpy.linalg.eigvalsh

Compute the eigenvalues of a Hermitian or real symmetric matrix.

Main difference from eigh: the eigenvectors are not computed.

Parameters:
aarray_like, shape (M, M)

A complex- or real-valued matrix whose eigenvalues are to be computed.

UPLO{‘L’, ‘U’}, optional

Specifies whether the calculation is done with the lower triangular part of a (‘L’, default) or the upper triangular part (‘U’).

Returns:
wndarray, shape (M,)

The eigenvalues, not necessarily ordered, each repeated according to its multiplicity.

Raises:
LinAlgError

If the eigenvalue computation does not converge.

pele.utils.hessian.get_eig()[source]

Source

def get_eig(hess, **kwargs):

return the eigenvalue and eigenvectors of a Hessian (symmetric)

The following is from numpy.linalg.eigh

Return the eigenvalues and eigenvectors of a Hermitian or symmetric matrix.

Returns two objects, a 1-D array containing the eigenvalues of a, and a 2-D square array or matrix (depending on the input type) of the corresponding eigenvectors (in columns).

Parameters:
aarray_like, shape (M, M)

A complex Hermitian or real symmetric matrix.

UPLO{‘L’, ‘U’}, optional

Specifies whether the calculation is done with the lower triangular part of a (‘L’, default) or the upper triangular part (‘U’).

Returns:
wndarray, shape (M,)

The eigenvalues, not necessarily ordered.

vndarray, or matrix object if a is, shape (M, M)

The column v[:, i] is the normalized eigenvector corresponding to the eigenvalue w[i].

Raises:
LinAlgError

If the eigenvalue computation does not converge.

pele.utils.hessian.sort_eigs()[source]

Source

def sort_eigs(evals, evecs, reverse=False):

return the sorted eigenvalues and eigenvectors

pele.utils.hessian.get_sorted_eig()[source]

Source

def get_sorted_eig(hess, **kwargs):

return the sorted eigenvalues and eigenvectors of a Hessian sorted

pele.utils.hessian.get_smallest_eig()[source]

Source

def get_smallest_eig(hess, **kwargs):

return the smallest eigenvalue and associated eigenvector of a Hessian

pele.utils.hessian.get_smallest_eig_nohess()[source]

Source

def get_smallest_eig_nohess(coords, system, **kwargs):

find the smallest eigenvalue and eigenvector without a hessian

this is just a wrapper for findLowestEigenVector

pele.utils.hessian.make_sparse()[source]

Source

def make_sparse(hess, **kwargs):

return a sparse form of the hessian using scipy.sparse

this function returns the hessian in compressed sparse column (CSC) form

Advantages of the CSC format:
  • efficient arithmetic operations CSC + CSC, CSC * CSC, etc.

  • efficient column slicing

  • fast matrix vector products (CSR, BSR may be faster)

Disadvantages of the CSC format:
  • slow row slicing operations (consider CSR)

  • changes to the sparsity structure are expensive (consider LIL or DOK)