!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!! !!!!!
!!!!! 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 0.0 Bohr, which is below tolerance 1e-06.
Creating Model object with Angstrom and eV as simulator registered units
------------------------------------------------------------------------------------------------------------------------
Results for KIM Model : MEAM_LAMMPS_WeiZhouLi_2019_BeO__MO_344044439515_000
Supported species : Be O
Model computes energy : True
Model computes forces : True
Model native length unit : A
Model native energy unit : eV
Influence distance : 5.5 Angstroms
Model cutoffs : [5.5] Angstroms
Smallest model cutoff : 5.5 Angstroms
Parameters for random cluster generation
Random seed: 11
Min. distance between atoms (dmin) : 5.5000000000000004e-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 Be atoms with a diameter 4.950000 Angstroms and a minimum separation of
0.550000 Angstroms between all atoms
Cluster positions (Angstroms):
[[-4.3402336773122920e+00 1.3388265639279888e+00 5.4689849129467583e-01]
[-2.8397492735262215e+00 6.2259168895391914e-01 4.5597863872909317e-02]
[ 1.2440260787817647e+00 2.8580248959162211e+00 7.4260354941951073e-02]
[ 2.3396984744448898e-01 -8.4529056468385688e-01 -1.2191202129123628e+00]
[ 2.2694340054039293e+00 1.4536747938981409e+00 2.1257224167837654e+00]]
Calling Model compute...
Model returned energy of -6.3999241861681844e+00 eV
Model returned forces (eV/Angstrom):
[[-1.7047220616245728e+00 8.1374044576086568e-01 5.6953623914596319e-01]
[ 2.0374214489471818e+00 -9.1302972539240634e-01 -6.7941866869175782e-01]
[ 8.1085061832163283e-02 -4.2727359701045720e-01 3.0227054537901266e-01]
[-1.2904448069800364e-01 3.9860865961203129e-01 3.3320285347758766e-01]
[-2.8473996845676836e-01 1.2795421702996651e-01 -5.2559096931080551e-01]]
Cumulative norm of all forces: 3.2061982149514741e+00 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:
[[-8.2018529667075111e+00 2.5300155341081871e+00 1.0334883664814134e+00]
[-5.3663483893797439e+00 1.1765277795494884e+00 8.6167474584718573e-02]
[ 2.3508685807065066e+00 5.4008843104527005e+00 1.4033173275282379e-01]
[ 4.4213893307491825e-01 -1.5973676629262545e+00 -2.3038033153183370e+00]
[ 4.2886087279742169e+00 2.7470472346421353e+00 4.0170331845568281e+00]]
Calling Model compute...
Model returned energy of -2.3519289235342292e-01 Hartree
Model returned forces (Hartree/Bohr):
[[-3.3151568289759022e-02 1.5824733289408987e-02 1.1075717238941943e-02]
[ 3.9621541728287885e-02 -1.7755602495740930e-02 -1.3212590427208242e-02]
[ 1.5768535089218827e-03 -8.3091491267534481e-03 5.8782266345324815e-03]
[-2.5095157800666583e-03 7.7517048071901566e-03 6.4797642971068702e-03]
[-5.5373111673840819e-03 2.4883135258952360e-03 -1.0221117743373054e-02]]
Cumulative norm of all forces: 6.2350632672738569e-02 Hartree/Bohr
Converting energy and forces returned by model back to Angstroms and eV...
Converted energy is -6.3999241855133091e+00 eV
Converted forces (eV/Angstrom):
[[-1.7047220614500804e+00 8.1374044567757287e-01 5.6953623908766660e-01]
[ 2.0374214487385953e+00 -9.1302972529893822e-01 -6.7941866862220046e-01]
[ 8.1085061823892510e-02 -4.2727359696678280e-01 3.0227054534812237e-01]
[-1.2904448068474281e-01 3.9860865957125302e-01 3.3320285344349693e-01]
[-2.8473996842766436e-01 1.2795421701689513e-01 -5.2559096925708559e-01]]
Cumulative norm of converted forces: 3.2061982146232952e+00 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: 6.548752651269751e-10 eV
Cumulative norm of difference in initial forces and converted forces: 3.28178798394461e-10
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