matscipy.numerical

Numerical algorithms for force, stress, hessian, etc.

Functions

get_derivative_volume(atoms[, d])

Calculate the derivative of the volume with respect to strain using central differences.

get_derivative_wave_vector(atoms[, d])

Calculate the derivative of a wave vector with respect to strain using central differences.

numerical_forces(atoms[, d])

Compute numerical forces using finite differences.

numerical_hessian(atoms[, d, indices])

Compute the hessian matrix from Jacobian of forces using central differences.

numerical_nonaffine_forces(atoms[, d])

Calculate numerical non-affine forces using central differences.

numerical_nonaffine_forces_reference(atoms)

Compute nonaffine forces in the reference configuration using finite differences.

numerical_stress(atoms[, d, voigt])

Compute numerical stresses using finite differences.

matscipy.numerical.numerical_forces(atoms: Atoms, d: float = 1e-05)

Compute numerical forces using finite differences.

Parameters:
  • atoms (ase.Atoms) – Atomic configuration in a local or global minumum.

  • d (float) – Displacement increment.

matscipy.numerical.numerical_stress(atoms: Atoms, d: float = 1e-05, voigt: bool = True)

Compute numerical stresses using finite differences.

Parameters:
  • atoms (ase.Atoms) – Atomic configuration in a local or global minumum.

  • d (float) – Displacement increment.

  • voigt (bool) – Return results in Voigt notation.

matscipy.numerical.numerical_hessian(atoms: Atoms, d: float = 1e-05, indices=None) coo_matrix

Compute the hessian matrix from Jacobian of forces using central differences.

Parameters:
  • atoms (ase.Atoms) – Atomic configuration in a local or global minima.

  • d (float) – Displacement increment

  • indices – Compute the hessian only for these atom IDs

matscipy.numerical.numerical_nonaffine_forces(atoms: Atoms, d: float = 1e-05)

Calculate numerical non-affine forces using central differences.

This is done by deforming the box, rescaling atoms and measure the force.

Parameters:
  • atoms (ase.Atoms) – Atomic configuration in a local or global minima.

  • d (float) – Finite difference step size.

matscipy.numerical.numerical_nonaffine_forces_reference(atoms: Atoms, d: float = 1e-05)

Compute nonaffine forces in the reference configuration using finite differences.

matscipy.numerical.get_derivative_volume(atoms: Atoms, d: float = 1e-05)

Calculate the derivative of the volume with respect to strain using central differences.

Parameters:
  • atoms (ase.Atoms) – Atomic configuration in a local or global minima.

  • d (float) – Finite difference step size.

matscipy.numerical.get_derivative_wave_vector(atoms: Atoms, d: float = 1e-05)

Calculate the derivative of a wave vector with respect to strain using central differences.

Parameters:
  • atoms (ase.Atoms) – Atomic configuration in a local or global minima.

  • d (float) – Finite difference step size.