pyef.fchk_interface

Parser for formatted checkpoint (.fchk) files.

Supports:
  • Gaussian fchk: geometry + normal modes + frequencies

  • Q-Chem fchk: geometry only (no Vib-Modes section)

Auto-detection: if ‘Vib-Modes’ section is present → Gaussian format.

All coordinates are returned in Angstroms (fchk stores Bohr). Normal mode eigenvectors are returned as (n_modes, n_atoms, 3) arrays, already mass-weighted and normalized as printed by the QM code.

Module Contents

Functions

detect_format(fchk_path)

Return 'gaussian' if Vib-Modes section present, else 'qchem'.

parse_geometry(fchk_path)

Parse reference geometry from fchk (Gaussian or Q-Chem).

parse_normal_modes(fchk_path)

Parse normal mode frequencies and eigenvectors from a Gaussian fchk.

get_mode(fchk_path, mode_index[, mode_vectors])

Retrieve a single normal mode vector.

Attributes

BOHR_TO_ANG

BOHR_TO_ANG = 0.529177210903
detect_format(fchk_path)[source]

Return ‘gaussian’ if Vib-Modes section present, else ‘qchem’.

parse_geometry(fchk_path)[source]

Parse reference geometry from fchk (Gaussian or Q-Chem).

Returns:

  • atomic_numbers (np.ndarray shape (n_atoms,) int)

  • coords (np.ndarray shape (n_atoms, 3) float, Angstroms)

parse_normal_modes(fchk_path)[source]

Parse normal mode frequencies and eigenvectors from a Gaussian fchk.

Returns:

  • frequencies (np.ndarray shape (n_modes,) cm⁻¹)

  • modes (np.ndarray shape (n_modes, n_atoms, 3)) – Each row is one normalised eigenvector in Cartesian space.

Raises:

ValueError if the file is Q-Chem format (no Vib-Modes section).

get_mode(fchk_path, mode_index, mode_vectors=None)[source]

Retrieve a single normal mode vector.

Parameters:
  • fchk_path (str path to .fchk file) –

  • mode_index (int 1-based mode number (as printed by Q-Chem / Gaussian)) –

  • mode_vectors (np.ndarray or None) – If provided, shape (n_modes, n_atoms, 3) or (n_atoms, 3). Required for Q-Chem fchk; ignored for Gaussian fchk.

Returns:

  • freq (float or None frequency in cm⁻¹ (None for Q-Chem))

  • vector (np.ndarray shape (n_atoms, 3) normalised displacement)