Skip to main content

Module operator

Module operator 

Source
Expand description

One-electron operator DSL over polynomials in r and p (L2).

This is the operator-algebra layer the architecture calls for (see ARCHITECTURE.md, L2): a typed representation of a one-electron integrand as a polynomial in the position operator r and the momentum operator p = −i∇, evaluated by decomposition into the base Cartesian integrals the engines already produce — no new recurrences. Adding a new integral type is then a single Operator declaration, not an engine change.

§Decomposition (fold the operator onto the ket)

For a one-electron integral ⟨χ_a | O | χ_b⟩, the operator O (a product of multiplication operators r and derivative operators p) acts on the ket function χ_b. Each elementary factor expands χ_b into a sum of pure Cartesian monomials:

  • r_i about origin O: (r − O)_i χ_b = χ_{b+1_i} + (B − O)_i · χ_b — raise the ket monomial by one along axis i, plus a shifted copy. (This is exactly the multipole step crate::os::dipole_into performs.)
  • p_i = −i ∂_{r_i}: since χ_b depends on r − B, ∂_{r_i} = −∂_{B_i}, so p_i χ_b = i · ∂_{B_i} χ_b = i · (2β · χ_{b+1_i} − b_i · χ_{b−1_i}). The real part is the center-derivative combiner; the operator carries an explicit factor of i.

Applying every factor (rightmost first — operators act right-to-left) turns χ_b into Σ_{m'} c(m') · χ_{m'}, so

  ⟨a | O | b⟩ = i^{n_p} · Σ_{m'} c(m') · ⟨a | m'⟩,

where n_p is the number of momentum factors and each ⟨a | m'⟩ is a plain overlap integral the crate::os engine already computes at a shifted ket momentum. The bra stays at la; the only engine call is overlap_into.

§Hermiticity / the imaginary unit (watch this)

Every p factor contributes one i, so a term with n_p momentum factors contributes the phase i^{n_p} ∈ {1, i, −1, −i}. The real-part expansion above is routed to a real or imaginary output buffer with a sign accordingly:

n_p mod 4phasebuffersign
01real+
1iimag+
2−1real
3−iimag

Consequently r, r_i r_j, and p·p (kinetic) are real-symmetric while p and r × p are imaginary/antisymmetric (anti-Hermitian real representation) — the Hermiticity character falls out of n_p and is not assumed. The i/sign convention is documented above.

§Angular-momentum limit

Folding onto the ket raises it to l_b + degree, so the overlap engine must stay inside its validated MAX_L: l_b + degree ≤ MAX_L. The driver enforces this with a typed error; here it is a debug assertion.

Structs§

Operator
A one-electron operator: a sum of Terms, polynomial in r and p, with a documented origin for its r factors (the multipole / gauge origin).
Term
One product term of an operator: a real scalar coeff times an ordered product of Factors, applied right-to-left to the ket.

Enums§

Factor
An elementary factor of a one-electron operator product, along a Cartesian axis (0 = x, 1 = y, 2 = z).

Functions§

operator_into
Accumulate scale · ⟨a | Op | b⟩ for one primitive pair into the real and imaginary Cartesian shell-pair blocks out_re/out_im (each row-major n_cart(la) × n_cart(lb), the same layout as crate::os::overlap_into).