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_iabout originO:(r − O)_i χ_b = χ_{b+1_i} + (B − O)_i · χ_b— raise the ket monomial by one along axisi, plus a shifted copy. (This is exactly the multipole stepcrate::os::dipole_intoperforms.)p_i = −i ∂_{r_i}: sinceχ_bdepends onr − B,∂_{r_i} = −∂_{B_i}, sop_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 ofi.
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 4 | phase | buffer | sign |
|---|---|---|---|
| 0 | 1 | real | + |
| 1 | i | imag | + |
| 2 | −1 | real | − |
| 3 | −i | imag | − |
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 pinned in DESIGN_NOTES.md.
§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 inrandp, with a documentedoriginfor itsrfactors (the multipole / gauge origin). - Term
- One product term of an operator: a real scalar
coefftimes an ordered product ofFactors, 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 blocksout_re/out_im(each row-majorn_cart(la) × n_cart(lb), the same layout ascrate::os::overlap_into).