schrodinger.application.jaguar.hess_guess module

Module for generating a Hessian guess. This includes routines for generating redundant internal coordinates, computing an internal coordinate Schlegel Hessian guess, and converting it to Cartesian coordinates with the Wilson B matrix.

Note this will create a redundant set of coordinates (sometimes called valence coordinates) that are not suitable to use as optimization coordinates. They are however useful for generating a guess Hessian.

The routines here are based off the implementations of fint, wilson, and schlegel in the Jaguar Fortran code, which respectively generate valence coordinates, create a B matrix for those coordinates, and construct the internal coordinate Schlegel Hessian guess.

Jaguar’s Hessian guess deviates slightly from the original Schlegel paper:

  • Uses updated Bond stretch constants derived from B3LYP calculations. Take from J.M. Wittbrodt, H.B. Schlegel Journal of Molecular Structure (Theochem) 398-399 (1997) 55-61.

  • Uses a stricter bond length cutoff in the formula for torsion force constants, see isinstance(coord,Dihedral) in schegel_hessian.

  • Adds Lindh stretch constants for non-bonded atom pairs.

The routine for generating coordinates here deviates from Jaguar in that we neglect nearly linear angles, rather than replacing them with a pair of linear bends.

class schrodinger.application.jaguar.hess_guess.LindhConstants

Bases: object

Constants for Lindh stretch terms in the Schlegel Hessian guess.

Taken from: R. Lindh, A. Bernhardsson, G. Karlstrom & P.-A. Malmqvist Chem.Phys.Lett. 241 p423 (1995) DOI: 10.1016/0009-2614(95)00616-L

K_STRETCH = 0.45
ALPHA = array([[1.    , 0.3949, 0.3949],        [0.3949, 0.28  , 0.28  ],        [0.3949, 0.28  , 0.28  ]])
R = array([[1.35, 2.1 , 2.53],        [2.1 , 2.87, 3.4 ],        [2.53, 3.4 , 3.4 ]])
R_CUT = -13.0
static stretch_index(atomic_number: int) int

Get the index for which Lindh stretch constant to use for this atom. This corresponds to (row-1) of the periodic table for a given atomic number. The third row constants are used for all elements beyond the third row as well.

Parameters

atomic_number – atomic number of the element

Returns

row of the periodic table

Raises

ValueError – if the atomic number is less than 1

class schrodinger.application.jaguar.hess_guess.SchlegelConstants

Bases: object

Constants for the Schlegel Hessian guess.

These are mainly from: H.B. Schlegel, Theor.Chim.Acta v66, p333, 1984 DOI: 10.1007/BF00554788

However, the BOND_B constants are from a later update: J.M. Wittbrodt, H.B. Schlegel Journal of Molecular Structure (Theochem) 398-399 (1997) 55-61 DOI: 10.1016/S0166-1280(96)04928-7

BOND_A = 1.734
BOND_B = array([[-0.2573,  0.3401,  0.6937,  0.7126,  0.8355,  0.9491],        [ 0.3401,  0.9652,  1.2843,  1.4725,  1.6549,  1.719 ],        [ 0.6937,  1.2843,  1.6925,  1.8238,  2.1164,  2.3185],        [ 0.7126,  1.4725,  1.8238,  2.0203,  2.2137,  2.5206],        [ 0.8355,  1.6549,  2.1164,  2.2137,  2.3718,  2.511 ],        [ 0.9491,  1.719 ,  2.3185,  2.5206,  2.511 ,  2.511 ]])
ANGLE_A = 0.16
ANGLE_B = 0.25
TORSION_A = 0.0023
TORSION_B = 0.07
WAG = 0.045
DEFAULT = 1e-05
static stretch_index(atomic_number: int) int

Get the index for which Schlegel stretch constant to use for this atom. This corresponds to (row-1) of the periodic table for a given atomic number. The sixth row constants are used for all elements beyond the sixth row as well.

Parameters

atomic_number – atomic number of the element

Returns

row of the periodic table

Raises

ValueError – if the atomic number is less than 1

schrodinger.application.jaguar.hess_guess.distance_vectors(st: schrodinger.structure._structure.Structure) tuple[numpy.ndarray, numpy.ndarray]

Generate the distances (in bohr) and unit vectors between every pair of atoms in a structure.

Parameters

st – Structure object

Returns

tuple of distance vectors and distances

class schrodinger.application.jaguar.hess_guess.InternalCoordinate(indices: tuple[int, ...], value: float)

Bases: abc.ABC

Base class for internal coordinates.

All internal coordinates will have a tuple of atom indices (sorted in some specific way) and a value (possibly limited to a specific range).

__init__(indices: tuple[int, ...], value: float)
property indices
property value
static regularize_value(value: float) float

For example, if the value is an angle, it should be in the range [-180, 180].

abstract static regularize_indices(indices: tuple[int, ...]) tuple[int, ...]

In general, ensure the indices are sorted.

class schrodinger.application.jaguar.hess_guess.Bond(indices: tuple[int, int], length: float)

Bases: schrodinger.application.jaguar.hess_guess.InternalCoordinate

__init__(indices: tuple[int, int], length: float)
static regularize_value(value: float) float

Convert from angstroms to bohr.

static regularize_indices(indices: tuple[int, int]) tuple[int, int]

For bonds, the indices should be sorted.

class schrodinger.application.jaguar.hess_guess.GenericAngle(indices: tuple[int, ...], value: float)

Bases: schrodinger.application.jaguar.hess_guess.InternalCoordinate

static regularize_value(value: float) float

For angles, ensure value is in the range [-180, 180] degrees, then convert to radians.

static regularize_indices(indices: tuple[int, ...]) tuple[int, ...]

For angles, ensure the first index is less than the last index.

class schrodinger.application.jaguar.hess_guess.Angle(indices: tuple[int, int, int], angle: float)

Bases: schrodinger.application.jaguar.hess_guess.GenericAngle

__init__(indices: tuple[int, int, int], angle: float)
class schrodinger.application.jaguar.hess_guess.Dihedral(indices: tuple[int, int, int, int], angle: float)

Bases: schrodinger.application.jaguar.hess_guess.GenericAngle

__init__(indices: tuple[int, int, int, int], angle: float)
class schrodinger.application.jaguar.hess_guess.Wag(indices: tuple[int, int, int, int], angle: float)

Bases: schrodinger.application.jaguar.hess_guess.GenericAngle

__init__(indices: tuple[int, int, int, int], angle: float)
static regularize_indices(indices: tuple[int, ...]) tuple[int, ...]

For wags, the indices should be left alone, as their order is meaningful: i,j,k,l, where l is out of the plane of i,j,k and j,k,l are all bonded to atom i.

class schrodinger.application.jaguar.hess_guess.CoordinateManager(st: schrodinger.structure._structure.Structure)

Bases: object

__init__(st: schrodinger.structure._structure.Structure)

Generate a set of redundant internal coordinates for a given structure.

This will create a coordinate for: - Each bond length - Each bonded angle - Each bonded dihedral angle - Each bonded out-of-plane wag angle

Parameters

st – Structure object

natoms: int
graph: networkx.classes.graph.Graph
property structure
property bonds
are_bonded(i: int, j: int) bool

Check if two atoms are bonded. This uses a set of sorted atom index tuples, so it is faster than checking the bond list.

Parameters
  • i – atom index

  • j – other atom index

Returns

True if the atoms are bonded, False otherwise

are_torsion_safe_bonded(i: int, j: int) bool

Check if two atoms are bonded in the torsion-safe bonded set.

Parameters
  • i – atom index

  • j – other atom index

Returns

True if the atoms are bonded and don’t cause issues with torsions, False otherwise

property angles
property dihedrals
property wags
get_internal_coordinates() list[schrodinger.application.jaguar.hess_guess.InternalCoordinate]

Get all internal coordinates, sorted in the order bond, angle, dihedral, wag.

schrodinger.application.jaguar.hess_guess.wilson_b_matrix(coords: list[schrodinger.application.jaguar.hess_guess.InternalCoordinate], st: schrodinger.structure._structure.Structure) numpy.ndarray

Generate the Wilson B matrix from a set of internal coordinates. This is used to convert the Schlegel Hessian to Cartesian coordinates.

This function is based on the subroutine wilson in the Jaguar Fortran code, which in turn was derived from ‘Molecular Vibrations’ by Wilson, Decius, and Cross.

Parameters
  • coords – list of internal coordinates

  • st – Structure object

Returns

Wilson B matrix

schrodinger.application.jaguar.hess_guess.schlegel_hessian(coords: list[schrodinger.application.jaguar.hess_guess.InternalCoordinate], st: schrodinger.structure._structure.Structure) numpy.ndarray

Generate the Internal coordinate Schlegel Hessian guess from a set of internal coordinates.

Parameters
  • coords – list of internal coordinates

  • st – Structure object

Returns

Internal coordinate Schlegel Hessian guess. Return a 1D array, since this is a diagonal matrix. Units are hartree/bohr^2 for bond stretches, and hartree/radian^2 for angles/dihedrals/wags.

schrodinger.application.jaguar.hess_guess.schlegel_to_cartesian(hess: numpy.ndarray, bmatrix: numpy.ndarray, to_angstrom: bool = True) numpy.ndarray

Convert the Schlegel Hessian guess from internal to cartesian coordinates.

Note: The conversion performed by this function is approximate. The full conversion from internal to Cartesian should also depend on the derivative of the B matrix with respect to the internal coordinates. In practice, however, it is often accurate enough to neglect these terms, which is what is done by default in Jaguar. This is especially true for the Schlegel Hessian, which is an approximation anyway.

Parameters
  • hess – Schlegel Hessian guess, in internal coordinates, as a 1D array.

  • bmatrix – Wilson B matrix.

  • to_angstrom – Whether to convert the force constants to hartree/angstrom^2.

Returns

Cartesian Schlegel Hessian guess, hartree/bohr^2 or hartree/angstrom^2 (default).

schrodinger.application.jaguar.hess_guess.lindh(st: schrodinger.structure._structure.Structure, hess: numpy.ndarray, neighbors: set[tuple[int, int]]) numpy.ndarray

Add Lindh terms to the Cartesian Hessian matrix for non-bonded atom pairs.

Parameters
  • st – Structure object

  • hess – Cartesian Hessian matrix

  • neighbors – set of nearest and second nearest neighbor pairs. These pairs won’t have Lindh terms added. Assumed that the pairs are sorted.

Returns

Cartesian Hessian matrix with Lindh terms

schrodinger.application.jaguar.hess_guess.cartesian_hessian(st: schrodinger.structure._structure.Structure, to_angstrom: bool = True, with_lindh: bool = True) numpy.ndarray

Compute the Cartesian Hessian matrix for a structure.

Parameters
  • st – Structure object

  • to_angstrom – Whether to convert the force constants to hartree/angstrom^2.

  • with_lindh – Whether to include Lindh terms for non-bonded atom pairs.

Returns

Cartesian Hessian matrix