Vibrational Analysis
A vibrational analysis computes a Cartesian Hessian and harmonic frequencies for the input geometry. It is usually run after a geometry optimization or transition-state search.
Your First Vibrational Analysis
import atomiverse
from atomiverse import Atoms, JobFailedError, Vibrations
from atomiverse.levels import GFN2_XTB
atomiverse.configure(api_key="your-api-key")
water = Atoms.from_smiles("O")
job = Vibrations(
atoms=water,
level_of_theory=GFN2_XTB,
)
job.submit()
try:
result = job.require_result()
except JobFailedError as exc:
print(f"Job failed: {exc.failure.error}")
else:
print(f"Hessian dimension: {len(result.hessian)}")
for freq in result.frequencies:
print(f"{freq:10.2f} cm^-1")
Result
job.require_result() returns a VibrationsResult with two fields:
| Field | Type | Units | Shape |
|---|---|---|---|
hessian | list[list[float]] | Hartree/Angstrom^2 | (3 * n_atoms, 3 * n_atoms) |
frequencies | list[float] | cm^-1 | variable |
Imaginary modes are returned as negative frequencies. For a transition state, the reaction-coordinate mode should usually appear as a negative value.
Charge, Multiplicity, and Level of Theory
These work exactly as for single point energy calculations:
job = Vibrations(
atoms=molecule,
charge=-1,
multiplicity=2,
level_of_theory=GFN2_XTB,
)
See Levels of Theory for all available methods and Single Point Energy for charge/multiplicity details.
Handling Failures
The most common failures are unsupported elements or charge/multiplicity combinations, unreasonable geometries, and methods that cannot evaluate the requested structure.
from atomiverse import JobFailedError
job.submit()
try:
result = job.require_result()
except JobFailedError as exc:
print(f"Vibrational analysis failed: {exc.failure.error}")
else:
print(result.frequencies)
print(result.hessian[0][0])
For best results, start from an optimized minimum or a converged transition-state geometry.