vibeqc.normal_mode_trajectory¶
- vibeqc.normal_mode_trajectory(mol, hessian_result, mode_index, *, amplitude=0.5, n_frames=20)[source]¶
Generate a list of
Moleculeframes sampling one vibrational normal mode for animated visualization.The displacement pattern for atom
iin modepis the standard Wilson-FG normalisation:Δr_i = (L_{ip} / sqrt(M_i)) · A · sin(2π · t / T)where
Lis the mass-weighted normal-mode matrix,M_ithe atomic mass (in electron-mass units),Ais the amplitude (controlled byamplitude), andtruns throughn_framespoints over one full vibration periodT.- Parameters:
mol (vibeqc._vibeqc_core.Molecule) – Reference
Molecule(the equilibrium geometry).hessian_result –
HessianResultfrom any of the analytic-Hessian drivers orcompute_hessian_fd(). Readsnormal_modes,frequencies_cm1, andmasses_amu.mode_index (int) – Which mode to animate (0 = lowest,
3N − 1= highest). Trans/rot zero modes (typically indices 0..5) animate as rigid translations / rotations and are usually not physically interesting; pick a higher index to see a vibration.amplitude (float) – Maximum atomic displacement in bohr along the mode eigenvector. Default 0.5 bohr ≈ 0.26 Å — large enough to be visible in a molecular animation, small enough to stay in the harmonic regime.
n_frames (int) – Number of frames per period. Default 20. moltui plays back in a loop, so this controls both temporal resolution and playback speed.
- Returns:
n_framesmolecules, each with the equilibrium geometry + a sinusoidal displacement along modep. Pair withwrite_xyz_trajectory()to drop into moltui:frames = vq.normal_mode_trajectory(mol, hess, 8) vq.write_xyz_trajectory("mode-8.xyz", frames)
- Return type:
Notes
For zero modes (frequencies near 0), the eigenvector L_p still has well-defined norm but the “vibration” is an unphysical rigid translation/rotation. The function still writes a valid trajectory; visual inspection will show a translating / rotating cluster, which is sometimes useful as a sanity check on the Hessian projection.