# vibrational_averaging

Main driver for calculation of vibrational corrections to properties.

class daltonproject.vibrational_averaging.ComputeVibAvCorrection(hess_objects: Sequence[OutputParser], prop_objects: Sequence[OutputParser], vibav_settings: VibAvSettings)

ComputeVibAvCorrection class for computing a vibrational correction to a property.

call_vibav() None

Compute vibrational correction to properties.

coefficients_of_inertia_expansion(mode_vector) ndarray

Calculate coefficients of inertia expansion.

Parameters

mode_vector – Normal coordinate vector.

Returns

Coefficients of inertia expansion in ang*amu^(1/2).

Return type

coeff_expansion_tensor

compute_vib_correction(property_mat: np.ndarray, property_labels: Sequence[str | Sequence[str]])

Vibrational correction to properties.

Parameters
• property_mat – property matrix.

• property_labels – Property labels.

Returns

ComputeVibCorrection class object.

The vibrational correction to a property P is then given by $$\Delta^\text{VPT2}P = -\frac{1}{4}\sum_i\frac{1}{\omega_i}\frac{\partial P}{\partial q_i} \ \sum_j k_{ijj} + \frac{1}{4}\sum_{i} \frac{\partial^2 P}{\partial {q_i^2}}$$. Temperature dependent corrections to properties are calculated using $$\Delta^\text{VPT2}P = \ -\frac{1}{4}\sum_i\frac{1}{\omega_i}\frac{\partial P}{\partial q_i} \ \left(\sum_j k_{ijj}\coth\left(\frac{{h}c\omega_j}{2kT}\right)\right) + \ \frac{1}{4}\sum_{i}\frac{\partial^2 P}{\partial q_i^2}\coth\left(\frac{hc\omega_i}{2kT}\right)$$

conversion_factor() ndarray

Calculate conversion factor (bohr^-2*amu^-1) to convert cubic force constants to cm^-1.

Returns

Conversion factor.

cubic_fc(q_mat_displaced: ndarray, factor: ndarray) ndarray

Calculate cubic force constants numerically.

Parameters
• q_mat_displaced – Displaced normal coordinate matrix.

• factor – Conversion factor in units of bohr^-2*amu^-1.

Returns

Cubic force constants in units of cm^-1.

Cubic force constants are calculated numerically using the following equation: $$\Phi_{ijk} \simeq \ \frac{1}{3}\left(\frac{\Phi_{jk}(\partial Q_i)-\Phi_{jk}(\partial Q_i)}{2\partial Q_i} \ + \frac{\Phi_{ki}(\partial Q_j)-\Phi_{ki}(\partial Q_j)}{2\partial Q_j} \ + \frac{\Phi_{ij}(\partial Q_k)-\Phi_{ij}(\partial Q_k)}{2\partial Q_k}\right)$$.

Ref: Barone, V. J. Phys. Chem. 2005, 122, 014108

displace_q_geometries() ndarray

Generate displaced normal mode geometries.

Returns

Displaced normal coordinate matrix.

mean_displacement() tuple[numpy.ndarray, numpy.ndarray]

Calculate mean displacements.

Returns

Mean displacement (dimensionless). q2: Mean displacement squared (dimensionless).

Return type

q

Mean displacement is defined as: $$\left<\phi^{(1)}\left|q_i\right|\phi^{(0)}\right> = \frac{1}{4}\sum_i\frac{1}{\omega_i}\sum_j k_{ijj}$$ Mean displacement squared is defined as: $$\left<\phi^{(0)}\left|{q_i}{q_j}\right|\phi^{(0)}\right> = \frac{1}{2}$$

process_property_parsers() None

Process property values to ensure correct dimensionality.

rotational_contribution() ndarray

Calculate rotational contribution to a temperature dependent vibrational correction.

Returns

Rotational contribution to vibrational correction in ang^(-1)*amu^(-1/2).

Return type

quotient

write_output_file(total_corrections: ndarray) None

Write output file for vibrational correction results.

Parameters

total_corrections – Property values.

class daltonproject.vibrational_averaging.ComputeVibCorrection(property_first_derivatives: np.ndarray, property_second_derivatives: np.ndarray, mean_displacement_q: np.ndarray, mean_displacement_q2: np.ndarray, cubic_force_constants: np.ndarray, vibrational_corrections: np.ndarray)

Data structure for vibrational correction to properties.

cubic_force_constants: ndarray

Alias for field number 4

mean_displacement_q: ndarray

Alias for field number 2

mean_displacement_q2: ndarray

Alias for field number 3

property_first_derivatives: ndarray

Alias for field number 0

property_second_derivatives: ndarray

Alias for field number 1

vibrational_corrections: ndarray

Alias for field number 5

class daltonproject.vibrational_averaging.VibAvConstants

Modified constants used in vibrational averaging.

property c_cm: float

Return speed of light in units of cm/s.

property hbar_a: float

Return reduced Planck constant in units of angstrom^2 * kg/s.

property m2au: float

Convert from meter to bohr.

class daltonproject.vibrational_averaging.VibAvSettings(molecule: Molecule, property_program: str, is_mol_linear: bool, hessian: np.ndarray, property_obj: Property, stepsize: float | int, differentiation_method: str, temperature: float | int, polynomial_fitting_order: int | None = None, linear_point_stencil: int | None = None, plot_polyfittings: bool | None = False)

VibAvSettings class for initialising user input and generating distorted geometry .xyz or .gau files for property and Hessian calculations.

check_property_assignment()

Check to see if property and program combination is supported.

displace_coordinates(factor: int, eq_freq: float, mode_num: int, reordered_q_mat: ndarray) ndarray

Displace equilibrium coordinates.

Parameters
• factor – Factor to multiply normal coordinate by.

• eq_freq – An equilibrium frequency.

• mode_num – Mode number.

• reordered_q_mat – Reordered normal coordinates.

Returns

Displaced coordinates.

Return type

displaced_coords

generate_displaced_geometries() list[str]

Write loop for displaced geometries.

Returns

Sequence of filenames for displaced geometries.

Return type

file_list

static step_modifier(stepsize: float, eq_freq: float) float

Modify stepsize from units of reduced normal coordinates to units of normal coordinates.

Normal coordinates Q are converted to reduced normal coordinates q: Q = $$(\hbar/ 2 \pi c \omega)^{0.5} q.$$

Parameters
• stepsize – Step size in reduced normal coordinates.

• eq_freq – An equilibrium frequency.

Returns

Modified stepsize in normal coordinates.

write_gau_input(coords: ndarray, filename: str) None

Write .gau file for a given displaced geometry.

Parameters
• coords – Coordinates to write.

• filename – Name of the file to write.

write_xyz_input(coords: ndarray, filename: str) None

Write .xyz file for a given displaced geometry.

Parameters
• coords – Coordinates to write.

• filename – Name of the file to write.