vibrav.numerical.derivatives module

vibrav.numerical.derivatives.arb_disps_1d(plus, minus, disp_steps, delta)[source]

Unlike the functions vibrav.numerical.derivatives.four_point_1d(), vibrav.numerical.derivatives.six_point_1d(). This function serves to calculate a derivative when the displacements are not constant.

Note

This requires that the steps are symmetric. Meaning, the steps that are taken in the positive direction must be the same as in the negative direction.

Parameters:
  • plus (numpy.ndarray) – Array with the positive displacement data.

  • minus (numpy.ndarray) – Array with the negative displacement data.

  • disp_steps (numpy.ndarray) – Array with the displacement step size taken.

  • delta (float) – Displacement taken for first diaplacement step.

Returns:

deriv (float) – Numerical first derivative for given data.

vibrav.numerical.derivatives.eight_point_1d(plus, minus, delta)[source]
vibrav.numerical.derivatives.eight_point_2d(plus, minus, equil, delta)[source]
vibrav.numerical.derivatives.four_point_1d(plus, minus, delta)[source]

Four point central finite difference method to approximate the first derivative of the input data, also know as the five point stencil.

Parameters:
  • plus (float) – Data frame with the positive displacement data.

  • minus (float) – Data frame with the negative displacement data.

  • delta (float) – Displacement parameter used.

Returns:

deriv (float) – Numerical first derivative for given data.

vibrav.numerical.derivatives.four_point_2d(plus, minus, equil, delta)[source]
vibrav.numerical.derivatives.get_pos_neg_gradients(grad, freq, nmodes)[source]

Here we get the gradients of the equilibrium, positive and negative displaced structures. We extract them from the gradient dataframe and convert them into normal coordinates by multiplying them by the frequency normal mode displacement values.

Parameters:
  • grad (exatomic.gradient.Gradient) – DataFrame containing all of the gradient data

  • freq (exatomic.atom.Frquency) – DataFrame containing all of the frequency data

  • nmodes (int) – Number of normal modes in the molecule.

Returns:

delfq_zero (pandas.DataFrame)

Normal mode converted gradients

of equilibrium structure

delfq_plus (pandas.DataFrame): Normal mode converted gradients

of positive displaced structure

delfq_minus (pandas.DataFrame): Normal mode converted gradients

of negative displaced structure

vibrav.numerical.derivatives.six_point_1d(plus, minus, delta)[source]

Six point central finite difference method to approximate the first derivative of the input data.

Parameters:
  • plus (float) – Data frame with the positive displacement data.

  • minus (float) – Data frame with the negative displacement data.

  • delta (float) – Displacement parameter used.

Returns:

deriv (float) – Numerical first derivative for given data.

vibrav.numerical.derivatives.six_point_2d(plus, minus, equil, delta)[source]
vibrav.numerical.derivatives.two_point_1d(plus, minus, delta)[source]

Two point central finite difference method to approximate the first derivative of the input data.

Parameters:
  • plus (float) – Data frame with the positive displacement data.

  • minus (float) – Data frame with the negative displacement data.

  • delta (float) – Displacement parameter used.

Returns:

deriv (float) – Numerical first derivative for given data.

vibrav.numerical.derivatives.two_point_2d(plus, minus, equil, delta)[source]