Skip to main content

normalize_coefficients

Function normalize_coefficients 

Source
pub fn normalize_coefficients(
    l: u64,
    exponents: &[f64],
    coefficients: &[f64],
    normalization: f64,
) -> Result<Vec<f64>, CuestError>
Expand description

Normalize contraction coefficients following the cuEST convention.

cuEST uses contraction coefficients verbatim against raw (unnormalized) primitive Gaussians, so coefficients from standard basis files (relative to normalized primitives) must first be brought to the “finished” primitive-and-L normalized form documented by cuEST:

d   = prod_{k=1..L} (2k - 1)
c_k = c_k^raw * sqrt( 2^L * (2 e_k)^(L + 3/2) / (pi^(3/2) * d) )
V   = sum_ij c_i^raw c_j^raw * ( 2 sqrt(e_i e_j) / (e_i + e_j) )^(L + 3/2)
c_k^N = c_k * sqrt( normalization / V )

This mirrors compute_normalized_coefficients from the cuEST C examples and the formula in the cuEST documentation (api_methods.rst, “Primitive Basis Function Normalization”).

Returns CuestError::Rust for invalid input: empty or mismatched lists, non-positive exponents, L >= 9, non-positive normalization, or a degenerate contraction.