qstack.fields.hf_otpd¶
Hartree-Fock on-top pair density.
- qstack.fields.hf_otpd.hf_otpd(mol, dm, grid_level=3, save_otpd=False, return_all=False)[source]¶
Compute the Hartree-Fock uncorrelated on-top pair density (OTPD) on a grid.
The on-top pair density is the probability density of finding two electrons at the same position. For Hartree-Fock, this is computed as (rho/2)^2.
- Parameters:
mol (pyscf Mole) – pyscf Mole object.
dm (numpy ndarray) – 2D density matrix in AO-basis.
grid_level (int) – DFT grid level controlling number of radial and angular points. Defaults to 3.
save_otpd (bool) – If True, saves results to a .npz file. Defaults to False.
return_all (bool) – If True, returns both OTPD and grid object; if False, returns only OTPD. Defaults to False.
- Returns:
If return_all is False, returns 1D array of OTPD values. If return_all is True, returns tuple of (otpd, grid) where grid is the pyscf Grid object.
- Return type:
numpy ndarray or tuple
- qstack.fields.hf_otpd.save_OTPD(mol, otpd, grid)[source]¶
Save on-top pair density computation results to a NumPy compressed file.
Creates a .npz file containing the molecular structure, OTPD values, grid coordinates, and integration weights for later analysis.
- Parameters:
mol (pyscf Mole) – pyscf Mole object.
otpd (numpy ndarray) – 1D array of on-top pair density values on the grid.
grid (pyscf Grid) – Grid object containing coordinates and weights.
- Output:
Creates a file named <elements>_otpd_data.npz on disk.