!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!! !!!!!
!!!!! VERIFICATION CHECK: vc-unit-conversion !!!!!
!!!!! !!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Description: This verification check ensures that a model can properly convert
units of length and energy. Working in one unit system, a random
cluster of atoms is generated based on the smallest cutoff of the
model such that the energy and/or forces (depending on what the
model actually reports) are sizeable. Next, the model is
reinitialized with a different set of registered units. The
coordinates of the atoms in the cluster are rescaled to correspond
to the new length units and the energy and/or forces are requested
from the model once again. The energy and/or force returned by the
model are then compared to a manual conversion of those originally
returned (in the first set of units).
Author: Daniel S. Karls
Checking if model properly converts its cutoffs from Angstrom to Bohr
SUCCESS: Absolute difference in smallest cutoff is 1.7763568394002505e-15 Bohr, which is below
tolerance 1e-06.
Creating Model object with Angstrom and eV as simulator registered units
------------------------------------------------------------------------------------------------------------------------
Results for KIM Model : MEAM_LAMMPS_KimKoLee_2020_NaSn__MO_329881861557_001
Supported species : Na Sn
Model computes energy : True
Model computes forces : True
Model native length unit : A
Model native energy unit : eV
Influence distance : 4.8 Angstroms
Model cutoffs : [4.8] Angstroms
Smallest model cutoff : 4.8 Angstroms
Parameters for random cluster generation
Random seed: 11
Min. distance between atoms (dmin) : 4.7999999999999998e-01 Angstroms
------------------------------------------------------------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
STEP I: Cluster generation
Attempting to find a species supported by the Model for which a random cluster can be generated
that has significant energy and/or forces (depending on what the Model is able to compute). We
construct the cluster by first placing a single atom at the origin and then generating
additional atom positions that fall within a distance 'rball' of the origin; no atoms are
allowed to fall within a distance of 'dmin' of one another. Note that 'rball' is chosen to be
0.9 * the smallest cutoff reported by the Model in Angstroms. In the event that the Model's
native length unit is not Angstroms and the cutoffs it reports are improperly converted to
Angstroms, it's possible that the cluster generated may actually be far too large for atomic
interactions to occur. Accordingly, if the energy and/or forces are not sizable using the
initial value of 'rball', we regenerate the cluster positions iteratively using smaller and
smaller values of 'rball' (while keeping 'dmin' fixed); if the energy and/or forces still aren't
sizeable when generating a cluster using rball = 0.2 * the smallest cutoff reported by the
Model, that species is skipped and the process is repeated for the next species.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Creating random cluster of 5 Na atoms with a diameter 4.320000 Angstroms and a minimum separation of
0.480000 Angstroms between all atoms
Cluster positions (Angstroms):
[[-3.7878403001998175e+00 1.1684304557916991e+00 4.7729322876626240e-01]
[-2.4783266387137930e+00 5.4335274672342027e-01 3.9794499379993582e-02]
[ 1.0856954869368127e+00 2.4942762727996106e+00 6.4809037040248194e-02]
[ 2.0419186686064492e-01 -7.3770812917863859e-01 -1.0639594585416983e+00]
[ 1.9805969501707015e+00 1.2686616383111045e+00 1.8551759273749222e+00]]
Calling Model compute...
Model returned energy of 1.7230648557222230e+00 eV
Model returned forces (eV/Angstrom):
[[-6.6619707209446055e+00 3.1808245131857444e+00 2.2257660894861524e+00]
[ 6.4964629737016288e+00 -3.0799278117163560e+00 -2.1502102237384269e+00]
[-6.0163101377394745e-01 8.9828541499440662e-01 -1.1738604562215131e+00]
[ 2.3242723920853886e-01 -9.6370391279996359e-02 8.1123798719492483e-03]
[ 5.3471152180838499e-01 -9.0281172518379904e-01 1.0901922106018389e+00]]
Cumulative norm of all forces: 1.0984836300707395e+01 eV/Angstrom
SUCCESS: Absolute value of energy exceeds tolerance 0.001 eV and cumulative norm of forces on
all atoms exceeds tolerance 0.001 eV/Angstrom. Proceeding with unit conversion...
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
STEP II: Convert units and ask model to recompute energy and/or forces
Take the set of coordinates that was found to have sizeable energy/forces from Step I and change
the units from Angstroms to Bohr ourselves. Next, create a new Model object wherein we've
registered Bohr and Hartree as the unit set. Ask the model for its neighbor list cutoffs and
influence once more and use them to create a new neighbor list using the coordinates we
converted to Bohr. Finally, have the Model compute the energy and/or forces once more and
compare the results to our own conversion of the energy and/or forces the model returned in Step
I.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Creating Model object with Bohr and Hartree as simulator registered units
Cluster positions converted to Bohr:
[[-7.1579807709447358e+00 2.2080135570398718e+00 9.0195348347468784e-01]
[-4.6833585943677756e+00 1.0267878803340988e+00 7.5200705092118014e-02]
[ 2.0516671249802236e+00 4.7134990345769010e+00 1.2247133040246437e-01]
[ 3.8586670522901956e-01 -1.3940663240083673e+00 -2.0105919842778213e+00]
[ 3.7427857989593161e+00 2.3974230411422264e+00 3.5057744156132307e+00]]
Calling Model compute...
Model returned energy of 6.3321469964549806e-02 Hartree
Model returned forces (Hartree/Bohr):
[[-1.2955471291859816e-01 6.1857192700448878e-02 4.3284262093911272e-02]
[ 1.2633609945149740e-01 -5.9895064114052557e-02 -4.1814934336962796e-02]
[-1.1699861277889630e-02 1.7468871289493842e-02 -2.2827952986066782e-02]
[ 4.5199904820139771e-03 -1.8741058613290283e-03 1.5776068215030950e-04]
[ 1.0398484262976395e-02 -1.7556894014561137e-02 2.1200864546968002e-02]]
Cumulative norm of all forces: 2.1362106995182917e-01 Hartree/Bohr
Converting energy and forces returned by model back to Angstroms and eV...
Converted energy is 1.7230648555459163e+00 eV
Converted forces (eV/Angstrom):
[[-6.6619707202627607e+00 3.1808245128601902e+00 2.2257660892583480e+00]
[ 6.4964629730367580e+00 -3.0799278114011241e+00 -2.1502102235183616e+00]
[-6.0163101371241223e-01 8.9828541490241920e-01 -1.1738604561014014e+00]
[ 2.3242723918475652e-01 -9.6370391270069314e-02 8.1123798711545490e-03]
[ 5.3471152175365744e-01 -9.0281172509141638e-01 1.0901922104902606e+00]]
Cumulative norm of converted forces: 1.0984836299583133e+01 eV/Angstrom
========================================================================================================================
To pass this verification check, the Model must be able to compute the energy and/or forces for a
random cluster of atoms in two different sets of units. If energies are computed, the results must
match within 1e-06 eV. If forces are computed, the cumulative norm of the difference between the
forces computed in one set of units and the other must be less than 1e-06 eV/Angstrom.
Absolute difference between initial energy and converted energy: 1.7630674697954873e-10 eV
Cumulative norm of difference in initial forces and converted forces: 1.1242620140449834e-09
eV/Angstrom
SUCCESS: Absolute difference in energy is below tolerance 1e-06 and cumulative norm of difference in
forces on all atoms is below tolerance 1e-06.
Grade: P
Comment: Unit conversion successful