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. 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 further down this page — 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. - Writes
<name>_out.txtand, by default, a LaTeX/PDF report with three 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] [--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.
Run it here
Upload a CSV with two columns — internuclear distance r and potential energy V — and the solver runs in your browser. Nothing is uploaded anywhere: Python itself is downloaded into the page and your file never leaves your machine.
Credits
- Programmer: Rafael Ferreira Veríssimo