DVRKing 1.0
releasedSinc-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.
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
- Reads the CSV and converts to bohr/hartree; units are detected automatically and can be
forced with
--r-unit/--e-unit. - Fits a 6th-order extended Rydberg potential to the points by variable projection,
returning
De, Re, xe, c1..c6and the fit rms. - Builds the DVR Hamiltonian on a uniform 500-point grid spanning the
rrange of the CSV, with the analytic Colbert-Miller kinetic energy and the potential on the diagonal. - Diagonalizes for J=0 and J=1, returning every bound state below
De— the number of levels is automatic, not a parameter. - Computes
we, wexe, weyefrom the first level spacings,alfae, gamaeandBe, Bvfrom the J=0/J=1 combination. - Extrapolates to arbitrary J with Dunham’s expansion, and finds the two summation limits:
ε(v,0) < DeandBv > 0. - 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 derivesU,Cv,SandGper mole over a temperature grid. - Writes
<name>_out.txtand, 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
- Programmer: Rafael Ferreira Veríssimo