Calculator
MSMCalculator bundles all MSM hyperparameters. It also serves as the AtomsCalculators.AbstractCalculator for AtomsBase systems.
MultilevelSummation.MSMCalculator — Type
MSMCalculator{T,S,B}(splitting, basis, h; charge_property=:charge)Container for MSM hyperparameters at the low-level (numerical) layer; also serves as the AtomsCalculators.AbstractCalculator for AtomsBase systems.
Fields:
splitting: a kernel splitting (e.g.HardyC2Cubic{T}), carryingaandL.basis: an interpolation basis (e.g.CubicC1{T}).h::T: the finest-level grid spacing (same along every axis, prototype).charge_property::Symbol: which AtomsBase atom property to read for charges when used through the AtomsCalculators interface (default:charge).
MultilevelSummation.msm_energy — Function
msm_energy(positions, charges, cell, periodic, calc) -> energy::TCompute the MSM-approximated energy U^MSM = ½ Σ{i≠j} qi qj K(rij) for charges q_i at positions r_i in an orthorhombic cell with per-axis periodic flags, using the calculator calc.
Only j = i is excluded (no bonded-pair exclusions in the prototype).
MultilevelSummation.msm_energy_forces — Function
msm_energy_forces(positions, charges, cell, periodic, calc) -> (energy, forces)Compute MSM energy and analytic per-particle forces.
MultilevelSummation.kernel_self_value — Function
kernel_self_value(splitting, ::Val{D}) -> TValue of the total long-range kernel at zero separation, k_long(0) = Σ_{l=1}^{L} k_l(0). Used to subtract the spurious self-interaction picked up by the long-range pathway (paper eq. 5, correction term with j = i).
Computed by directly summing the splitting components at r = 0.
AtomsCalculators interface
For a system sys::AbstractSystem (from AtomsBase.jl) and a calculator calc::MSMCalculator:
AtomsCalculators.potential_energy(sys, calc)
AtomsCalculators.forces(sys, calc)
AtomsCalculators.forces!(F, sys, calc)
AtomsCalculators.energy_forces(sys, calc)The calculator reads charges from the atom property whose name is calc.charge_property (default :charge). Length units on positions and cell vectors are stripped via Unitful.ustrip; the user is responsible for ensuring positions, h, and a share a consistent length unit. The numerical core is unit-free.