← Software

DVRKing 1.0

released

Sinc-DVR solver for the 1D vibrational Schrödinger equation of a diatomic molecule: give it a potential energy curve, get back the vibrational levels, the spectrum and the spectroscopic constants.

Rodar no navegador → Repository

Language: Python. OS: Linux, macOS, Windows. Requires: Python 3 with NumPy and SciPy (Matplotlib and pdflatex for the PDF report).


DVRKing solves the 1D vibrational Schrödinger equation of a diatomic molecule with the sinc-DVR method of Colbert & Miller (J. Chem. Phys. 96, 1982, 1992). It is a Python/NumPy/SciPy port of the legacy Fortran 77 program DVR.f.

Input is a CSV with two columns — internuclear distance r and potential energy V. Output is the vibrational levels, the spectrum and the spectroscopic constants, in cm⁻¹.

You can run it in your browser — no install needed.

What it does

  1. Reads the CSV and converts to bohr/hartree; units are detected automatically and can be forced with --r-unit / --e-unit.
  2. Fits a 6th-order extended Rydberg potential to the points by variable projection, returning De, Re, xe, c1..c6 and the fit rms.
  3. Builds the DVR Hamiltonian on a uniform 500-point grid spanning the r range of the CSV, with the analytic Colbert-Miller kinetic energy and the potential on the diagonal.
  4. Diagonalizes for J=0 and J=1, returning every bound state below De — the number of levels is automatic, not a parameter.
  5. Computes we, wexe, weye from the first level spacings, alfae, gamae and Be, Bv from the J=0/J=1 combination.
  6. Extrapolates to arbitrary J with Dunham’s expansion, and finds the two summation limits: ε(v,0) < De and Bv > 0.
  7. Sums the rovibrational partition function Q(T) = Σ_v Σ_J (2J+1) exp(−[ε(v,J)−ε(0,0)]hc/kT) explicitly — no Euler-Maclaurin, so nothing assumes a high temperature — and derives U, Cv, S and G per mole over a temperature grid.
  8. Writes <name>_out.txt and, by default, a LaTeX/PDF report with five tables and four figures.

Everything but the reduced mass comes from the CSV.

Run

pip install numpy scipy matplotlib
python dvr.py <file.csv> (--mass-amu M | --mass M) [--r-unit U] [--e-unit U]
                         [--jmax J] [--temps LIST] [--no-pdf]

The reduced mass is required, either in amu (--mass-amu) or in electron masses (--mass). Accepted units: r in bohr/angstrom; V in hartree, cm-1, eV, kcal/mol, kJ/mol. --temps takes the temperatures of the thermodynamic table, comma-separated (default 100–1000 K plus 298.15).

Créditos

LEEDMOL no GitHub