Module ewald

Module ewald 

Source
Expand description

The Ewald sum: real-space part, reciprocal-space part and self term.

Upstream: lsum*, realsum* and recsum* of lattice/_esum.pyx. The reduction into a cell, the exact zeros by symmetry, the checks at small splits and the spectral series of 1D spherical sums are treams-rs extensions.

ModulesΒ§

probes πŸ”’
The reads of the test probes in builds without tests: constants that fold away.

StructsΒ§

AutomaticSplit πŸ”’
The same sum at the automatic split, against which sums below every automatic split fail early (SmallSplitMonitor::hopeless) or verify their settled shells (verify_settled).
CellReduction πŸ”’
The shift and the Bloch vector of one sum, each reduced into a cell of its reduced basis.
RealSummands πŸ”’
What the real-space terms of one sum read.
ReciprocalSummands πŸ”’
What the reciprocal-space terms of one sum read.
SmallSplitMonitor πŸ”’
The real-space terms below every automatic split: the Kambe integrals that keep their rounding below that of the largest term so far, and the early failure of complete sums (EARLY_FAILURE_LOSS).
SphericalCache πŸ”’
Ewald samples of one spherical degree, shared by its orders. Each order still follows its own shell convergence test; the shell iterator visits the same prefix of lattice points, so later orders reuse the samples already visited and append only the farther points they need. Each slot also records its lattice point: a different visit order evaluates mismatched slots afresh, never reusing another point’s sample. The cache lives for one degree evaluation with fixed inputs.
SphericalRealSample πŸ”’
SphericalReciprocalSample πŸ”’
Symmetry πŸ”’
A sum that vanishes by symmetry (vanishes) is exactly zero, as are its derivatives that move k alone; jets keep the other derivatives and their check of the cancellation.

ConstantsΒ§

SHARED_REAL_POINTS πŸ”’
A bounded prefix covers ordinary Ewald sums without retaining a large 3D cube at the shell limit: at most 1.4 MiB per degree for the largest (16-slot) jets. Farther samples stream through the scalar arithmetic instead.

FunctionsΒ§

ewald πŸ”’
The Ewald parts selected by evaluation with split eta. Both sums run over shells of reduced bases, and the reciprocal sum over the Bloch vector reduced into a cell of the reduced reciprocal basis, so their results do not depend on the given basis or on the Bloch vector’s cell.
reduce_to_cell πŸ”’
Reduces the shift of inputs into a cell of the reduced direct basis, in place, and the Bloch vector into a cell of the reduced reciprocal basis.
vanishes πŸ”’
Whether the sum vanishes by symmetry.
verify_settled πŸ”’
sum, whose real-space shells settled at their limit (Shells::settled), if it agrees with the sum at the automatic split within the rounding predicted that its parts predict for the value (without the truncation that the comparison verifies) plus twice the convergence tolerance of each shell sum.