xnn.common.models.charge_solve#
Global charge solve for LES: charge equilibration with the latent Ewald kernel.
The latent charges of one channel are not read off the atom features but chosen to minimise, per structure:
E(q) = sum_i chi_i q_i + 1/2 sum_i J_i q_i^2 + E_lr(q), with sum_i q_i = Q,
where chi (an electronegativity, from the q head) and J > 0 (a hardness,
learned) come from the network and E_lr is the Ewald energy of
EwaldSummation for that channel, so each charge
responds to every other charge in the system, not only to its receptive field
(the charge-induced-dipole energy of an ion in a polar liquid is the case this
exists for). Without the Coulomb coupling the solution is the net-charge
constraint of constrain() with weights
1/J; with J large it is the local head.
E_lr is an exact quadratic form, E_lr = 1/2 q^T gamma q;
coulomb_matrix() writes gamma in closed form from the same kernel
functions. The stationarity conditions chi + J q + gamma q = mu with the
constraint row form one symmetric augmented system, solved by LU with the
derivatives taken through the residual (lu_solve_implicit()):
forces and stress then need no charge response (the energy is the minimised
functional itself), and force training gets its mixed second derivatives at
O(N^2) in the backward.
Module Attributes
each of these atoms is its own fragment with this charge; every other fragment is neutral unless the structure carries a |
Functions
|
Fragment index of every atom, |
|
Per-atom |
|
|
Covalent radii in Angstrom indexed by atomic number, |
|
|
The net charge of every fragment in e, |
|
|
|
Formal ion charges indexed by atomic number, |
|
The constrained minimum of |