morfeus.local_force module#

Local force constant code.

class morfeus.local_force.LocalForce(elements=None, coordinates=None)[source]#

Bases: object

Calculates and stores the results from local force constant calculations.

The method is described by Cremer in 10.1002/(SICI)1097-461X(1998)67:1<1::AID-QUA1>3.0.CO;2-Z. Alternatively, the compliance matrix method can be used according to 10.1063/1.3413528

Parameters:
  • elements (Iterable[int] | Iterable[str] | None) – Elements as atomic symbols or numbers

  • coordinates (ArrayLike2D | None) – Coordinates (Å)

internal_coordinates#

Internal coordinates

Type:

list[Bond | Angle | Dihedral]

local_force_constants#

Local force constants (mDyne/Å)

Type:

Array1DFloat

local_frequencies#

Local mode frequencies (cm⁻¹)

Type:

Array1DFloat

n_imag#

Number of normal modes with imaginary frequencies

Type:

int

add_internal_coordinate(atoms)[source]#

Add internal coordinate.

Composed of two (bond), three (angle) or four atoms (dihedral).

Parameters:

atoms (Sequence[int]) – Atom indices of internal coordinate

Returns:

Self

Return type:

self

compute_compliance()[source]#

Compute local force constants with the compliance matrix method.

Return type:

LocalForce

compute_frequencies()[source]#

Compute local frequencies.

Return type:

LocalForce

compute_local(project_imag=True, cutoff=0.001)[source]#

Compute local force constants with the local modes approach.

Parameters:
  • project_imag (bool) – Whether to project out imaginary frequencies

  • cutoff (float) – Cutoff for low force constant (mDyne/Å)

Returns:

Self

Return type:

self

detect_bonds(radii=None, radii_type='pyykko', scale_factor=1.2)[source]#

Detect bonds based on scaled sum of covalent radii.

Parameters:
  • radii (ArrayLike1D | None) – Covalent radii (Å)

  • radii_type (str) – Covalent radii type: ‘pyykko’

  • scale_factor (float) – Scale factor for covalent radii

Returns:

Self

Return type:

self

get_local_force_constant(atoms)[source]#

Return the local force constant between a set of atoms.

Parameters:

atoms (Sequence[int]) – Atom indices of the internal coordinate

Returns:

Local force constant (mDyne/Å, mDyne Å/rad²)

Return type:

force_constant

Raises:

ValueError – When no internal coordinate found

get_local_frequency(atoms)[source]#

Return the local frequency between a set of atoms.

Parameters:

atoms (Sequence[int]) – Atom indices in the internal coordinate

Returns:

Local frequency (cm⁻¹)

Return type:

frequency

Raises:

ValueError – When no internal coordinate found

load_file(file, program, filetype)[source]#

Load data from external file.

Parameters:
  • file (str | PathLike) – File

  • program (str) – Program used to generate file: ‘gaussian’, ‘unimovib’ or ‘xtb’

  • filetype (str) – Filetype. For ‘gaussian’: ‘fchk’ or ‘log’. For ‘unimovib’: ‘local’ or ‘log’. For ‘xtb’: ‘hessian’ or ‘normal_modes’

Returns:

Self

Return type:

self

normal_mode_analysis(hessian=None, save_hessian=False)[source]#

Perform normal mode analysis.

With projection of translations and vibrations to get normal modes and force constants.

Parameters:
  • hessian (ArrayLike2D | None) – User-supplied Hessian

  • save_hessian (bool) – Save projected Hessian for use in compliance matrix method.

Returns:

Self

Return type:

self

print_report(angles=False, dihedrals=False, angle_units=False)[source]#

Print report of results.

Parameters:
  • angle_units (bool) – Wheter to convert angle and dihedral force constants to mDyne Å/rad²

  • angles (bool) – Whether to print angles

  • dihedrals (bool) – Whether to print dihedrals

Return type:

None

reset_internal_coordinates()[source]#

Reset internal coordinate system.

Return type:

LocalForce

morfeus.local_force.cli(file=None)[source]#

CLI for local force.

Parameters:

file (str | None) – Geometry file

Returns:

Partially instantiated class

Return type:

Any