Module shells

Module shells 

Source
Expand description

Sums over cube shells and when they stop.

Upstream: the shell loops of realsum* and recsum* in lattice/_esum.pyx. The relative tolerance, the shell limits that grow with the terms and the compensated sums are treams-rs extensions.

StructsΒ§

Shells πŸ”’
One Ewald part summed over cube shells of integer points (Shells::sum), which Shells::extend continues. Below every automatic split (below_automatic), where the parts cancel, a part that stops at SHELL_TOLERANCE of its own sum leaves that much in the complete sum, so both parts continue to SHELL_TOLERANCE of the complete sum, and each part keeps the rounding errors of its additions (add_exactly): next to a lattice point at a zero Bloch vector millions of real-space terms add in phase far below an ulp of it.

ConstantsΒ§

NOT_CONVERGED πŸ”’
The message of a shell sum that does not converge within its limit.
SHELL_TOLERANCE πŸ”’
Largest part of the scale of a shell sum that each of its last two shells may add before the sum stops.
TERM_DECAY πŸ”’
The shell limits of real_shells and reciprocal_shells reach every term whose Gaussian factor exceeds e^-TERM_DECAY.

FunctionsΒ§

add_exactly πŸ”’
Adds x to sum and the rounding error of that addition, which Knuth’s two-sum finds exactly, to error.
add_jet_exactly πŸ”’
add_exactly for the real and imaginary parts of a jet’s value and derivatives.
is_shell_limit πŸ”’
Whether error is the failure of not_converged rather than one of the cancellation failures that share its variant.
largest_index πŸ”’
The largest shell index of the lattice vectors within radius of a lattice reduced by reduction, whose dual rows are dual (see shells_within).
largest_modulus πŸ”’
Jet::norm, the largest modulus of the value and derivatives, from one square root of the largest squared modulus instead of a hypot per component; Jet::norm when the squares overflow.
norm πŸ”’
The Euclidean norm of a lattice-frame vector.
not_converged πŸ”’
The failure of a shell sum that does not converge within its limit.
peak_shells πŸ”’
Cube shells that an Ewald part of wave on a lattice of dimension dim visits before its convergence test may stop it (Shells::sum).
real_shells πŸ”’
Cube shells the real-space sum may visit.
reciprocal_shells πŸ”’
Cube shells the reciprocal sum may visit, as [fail, extend].
shells πŸ”’
Cube shells a sum may visit before it fails: 200, 32 and 16 in one, two and three dimensions.
shells_within πŸ”’
Cube shells of a sum over a lattice, reduced by reduction, whose dual rows are dual (a_i . b_j = 2 pi delta_ij): shells, or where reaching the lattice vectors within radius needs more, that many plus two, up to four times the base. Index i of a lattice vector x is c_i . x / 2 pi for the dual rows c of the reduced basis.