← 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.

Repository

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

  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. Writes <name>_out.txt and, 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.

Two columns, comma- or space-separated, header optional.
The DVR only runs at J=0 and 1; the rest is extrapolated.
First run downloads ~36 MB of Python runtime (numpy, scipy, matplotlib). Cached by your browser afterwards.

Credits