xnn.ffnn.models.amoeba.DipolePredictor#
- class xnn.ffnn.models.amoeba.DipolePredictor(kind='aspc', history=6)[source]#
Bases:
objectExtrapolate the induced dipoles of the next step from the last few.
In molecular dynamics the converged dipoles change smoothly from step to step, so a linear combination of the last
msets,mu_p = sum_j B_j mu(t - j dt), is a much better start for the iterative solve than the direct dipoles. The schemes:"aspc": the always stable predictor-corrector coefficients of Kolafa, J. Comput. Chem. 25, 335 (2004), withk = m - 2:B_j = (-1)^(j+1) j C(2k+4, k+2-j) / C(2k+2, k+1); time reversible and stable, exact for linear motion;"gear": polynomial extrapolation through thempoints,B_j = (-1)^(j+1) C(m, j), exact for polynomials of degreem - 1;"previous": the last dipoles.
Fewer stored sets than
m(the first steps) use the same scheme on the sets there are. A change of shape, dtype or device starts a new history. The solve is converged to the model’s tolerance, so the prediction only changes the number of iterations, not the dipoles.- Parameters:
- push(mu)[source]#
Store the converged dipoles of a step.
- Parameters:
mu (Tensor) – The dipoles
(N, 3).- Return type:
None