grid.coulomb module#
Coulomb potential module for Gaussian charge densities.
Provides exact analytical formulas for evaluating the electrostatic potential of s-type and p-type Gaussian functions.
- grid.coulomb.coulomb_gaussian_p(r: ndarray, alpha: float, normalized: bool = True) ndarray#
Compute the exact Coulomb potential of a p-type radial Gaussian charge density.
If
normalizedis True, the charge density is: .. math:\rho(r) = \frac{2}{3} \frac{\alpha^{5/2}}{\pi^{3/2}} r^2 e^{-\alpha r^2}
and the potential is: .. math:
V(r) = \frac{\text{erf}(\sqrt{\alpha} r)}{r} + \frac{4}{3} \sqrt{\frac{\alpha}{\pi}} e^{-\alpha r^2}
If
normalizedis False, the charge density is: .. math:\rho(r) = r^2 e^{-\alpha r^2}
and the potential is: .. math:
V(r) = \frac{3 \pi^{3/2}}{2 \alpha^{5/2}} \frac{\text{erf}(\sqrt{\alpha} r)}{r} + \frac{2\pi}{\alpha^2} e^{-\alpha r^2}
Parameters#
- rnp.ndarray
Radial distances from the center of the Gaussian.
- alphafloat
Gaussian exponent.
- normalizedbool, default=True
Whether to compute the potential of a normalized p-type Gaussian.
Returns#
- np.ndarray
Coulomb potential evaluated at the radial distances as a 1D array (scalar input returns shape
(1,)).
- grid.coulomb.coulomb_gaussian_s(r: ndarray, alpha: float, normalized: bool = True) ndarray#
Compute the exact Coulomb potential of an s-type Gaussian charge density.
If
normalizedis True, the charge density is: .. math:\rho(r) = \left(\frac{\alpha}{\pi}\right)^{3/2} e^{-\alpha r^2}
and the potential is: .. math:
V(r) = \frac{\text{erf}(\sqrt{\alpha} r)}{r}
If
normalizedis False, the charge density is: .. math:\rho(r) = e^{-\alpha r^2}
and the potential is: .. math:
V(r) = \left(\frac{\pi}{\alpha}\right)^{3/2} \frac{\text{erf}(\sqrt{\alpha} r)}{r}
Parameters#
- rnp.ndarray
Radial distances from the center of the Gaussian.
- alphafloat
Gaussian exponent.
- normalizedbool, default=True
Whether to compute the potential of a normalized s-type Gaussian.
Returns#
- np.ndarray
Coulomb potential evaluated at the radial distances.
- grid.coulomb.coulomb_potential(points: ndarray, centers_s: ndarray, coeffs_s: ndarray, alphas_s: ndarray, centers_p: ndarray | None = None, coeffs_p: ndarray | None = None, alphas_p: ndarray | None = None, normalized: bool = True) ndarray#
Compute the total Coulomb potential at evaluation points from a set of Gaussians.
Parameters#
- pointsnp.ndarray
Evaluation points, shape (N, 3).
- centers_snp.ndarray
Centers of the s-type Gaussians, shape (Ks, 3).
- coeffs_snp.ndarray
Coefficients of the s-type Gaussians, shape (Ks,).
- alphas_snp.ndarray
Exponents of the s-type Gaussians, shape (Ks,).
- centers_pnp.ndarray, optional
Centers of the p-type Gaussians, shape (Kp, 3).
- coeffs_pnp.ndarray, optional
Coefficients of the p-type Gaussians, shape (Kp,).
- alphas_pnp.ndarray, optional
Exponents of the p-type Gaussians, shape (Kp,).
- normalizedbool, default=True
Whether the coefficients correspond to normalized Gaussians.
Returns#
- np.ndarray
The computed electrostatic potential, shape (N,).