Discrete Variable Representation
PyQED includes several discrete variable representation (DVR) utilities for grid-based quantum dynamics and model Hamiltonians. DVR methods represent wavefunctions on quadrature or collocation grids while keeping derivative and kinetic-energy operators as compact matrices.
Available Modules
The DVR code lives under pyqed.dvr:
pyqed.dvr.dvr_1dprovides one-dimensional DVR utilities.pyqed.dvr.dvr_2dprovides multidimensional tensor-product DVR utilities.pyqed.dvr.sddvrimplements simultaneous-diagonalization DVR helpers.pyqed.dvr.gwp_fbrcontains Gaussian-wavepacket finite-basis tools for SD-DVR.pyqed.dvr.gauss_hermitecontains legacy Gauss-Hermite DVR routines.
Typical Workflow
A DVR calculation usually follows this pattern:
Choose a coordinate domain and grid size.
Build the kinetic-energy operator for the chosen DVR basis.
Evaluate the potential on the DVR grid.
Assemble the Hamiltonian
H = T + V.Diagonalize or propagate the wavefunction.
Example
The one-dimensional utilities can be used to assemble a simple grid Hamiltonian. The exact class/function names depend on the DVR module selected, but the calculation structure is:
import numpy as np
from pyqed.dvr.dvr_1d import kinetic
x = np.linspace(-8.0, 8.0, 256)
mass = 1.0
T = kinetic(x, mass=mass, dvr="sinc")
V = np.diag(0.5 * x**2)
H = T + V
energies, states = np.linalg.eigh(H)
print(energies[:5])
Notes
This page is intentionally written as a static guide rather than an autodoc API page. Some legacy DVR modules import optional dependencies or run example code at import time, which is not suitable for warning-free Read the Docs builds.