Calculator

MSMCalculator bundles all MSM hyperparameters. It also serves as the AtomsCalculators.AbstractCalculator for AtomsBase systems.

MultilevelSummation.MSMCalculatorType
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}), carrying a and L.
  • 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).
source
MultilevelSummation.msm_energyFunction
msm_energy(positions, charges, cell, periodic, calc) -> energy::T

Compute 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).

source
MultilevelSummation.kernel_self_valueFunction
kernel_self_value(splitting, ::Val{D}) -> T

Value 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.

source

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.