horton.espfit.cost – ESP cost functions for estimating and testing charges¶
ESPCost(A, B, C, natom)¶
__init__(A, B, C, natom)¶
from_grid_data(coordinates, ugrid, vref, weights, rcut=20.0, alpha=None, gcut=None)¶
Return a worst-case value for the cost function
- The total charge of the molecule/crystal
Higher values for the cost function are still possible but if that happens, it is better not to use charges at all.
setup_weights(coordinates, numbers, grid, dens=None, near=None, far=None)¶
Define a weight function for the ESPCost
- An array with shape (N, 3) containing atomic coordinates.
- A vector with shape (N,) containing atomic numbers.
- A UniformGrid object.
The density-based criterion. This is a three-tuple with rho, lnrho0 and sigma. rho is the atomic or the pro-atomic electron density on the same grid as the ESP data. lnrho0 and sigma are parameters defined in JCTC, 3, 1004 (2007), DOI:10.1021/ct600295n. The weight function takes the form:
exp(-sigma*(ln(rho) - lnrho0)**2)
Note that the density, rho, should not contain depletions in the atomic cores, as is often encountered with pseudo-potential computations. In that case it is recommended to construct a promolecular density as input for this option.
- Exclude points near the nuclei. This is a dictionary with as items (number, (R0, gamma)).
- Exclude points far away. This is a two-tuple: (R0, gamma).