Skip to main content

Module atom

Module atom 

Source
Expand description

Atom coordinate parsing.

This module provides functions to parse atom coordinates from various formats:

  • String format: "H 0 0 0; O 0 0 1.2"
  • List format: ["H 0 0 0", "O 0 0 1.2"]
  • Z-matrix format: "O; H 1 0.94; H 1 0.94 2 104.5"

Supports ghost atoms (GHOST-X, X- prefix) and labeled atoms (H1, H2).

StructsΒ§

AtomInfo
Information about a parsed atom.
ZmatEntry
Z-matrix entry for a single atom.

EnumsΒ§

Unit
Unit of length for coordinates.

ConstantsΒ§

ANG_TO_BOHR
Angstrom to Bohr conversion constant.
BOHR_TO_ANG
Bohr to Angstrom conversion constant.

FunctionsΒ§

cart2zmat
Convert Cartesian coordinates to z-matrix format.
charge_to_symbol πŸ”’
Convert atomic number to element symbol.
cross3 πŸ”’
Compute cross product of two 3D vectors.
dot3 πŸ”’
Compute dot product of two 3D vectors.
find_atom_index πŸ”’
Find atom index by name in z-matrix.
mat_vec_mul πŸ”’
Multiply 3x3 matrix by 3-vector.
norm3 πŸ”’
Compute norm of 3D vector.
parse_atom_line πŸ”’
Parse a single atom line.
parse_atom_string
Parse atom coordinates from a string.
parse_atom_symbol
Parse atom symbol, extracting element symbol and ghost status.
parse_float πŸ”’
Parse a float value with error context.
parse_zmatrix
Parse z-matrix format coordinates.
parse_zmatrix_to_entries πŸ”’
Parse z-matrix string to ZmatEntry structs and atom labels.
rotation_mat πŸ”’
Rodrigues’ rotation formula: rotate by angle theta around axis vec. Returns 3x3 rotation matrix.
symbol_to_charge
Get atomic number from element symbol using bse lookup.
zmat2cart
Convert z-matrix entries back to Cartesian coordinates.
zmat_entries_to_cart πŸ”’
Convert ZmatEntry structs to Cartesian coordinates.
zmatrix_to_cartesian πŸ”’
Convert z-matrix parameters to Cartesian coordinates.