!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!! !!!!!
!!!!! 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_ZhangTrinkle_2016_TiO__MO_612732924171_001
Supported species : O Ti
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 O 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 3.7853736159904838e-01 eV
Model returned forces (eV/Angstrom):
[[ 1.6895064608815602e+00 -8.0645899323619774e-01 -5.6345664364257264e-01]
[-2.5563132726034459e+00 1.1975509333023773e+00 9.1029613611624161e-01]
[ 1.8209172572634480e-01 9.0310614210466628e-02 2.7737579023155096e-01]
[ 7.7503871987043704e-01 -6.3135073345283876e-01 -4.3975813745259318e-01]
[-9.0323633874895906e-02 1.4994817917619258e-01 -1.8445714525262671e-01]]
Cumulative norm of all forces: 3.7410413511595615e+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 1.3910992434992869e-02 Hartree
Model returned forces (Hartree/Bohr):
[[ 3.2855671944862101e-02 -1.5683131572593496e-02 -1.0957487921658350e-02]
[-4.9712381821334514e-02 2.3288659447514633e-02 1.7702442644288562e-02]
[ 3.5411205241659086e-03 1.7562619512504450e-03 5.3941006917129601e-03]
[ 1.5072104495736578e-02 -1.2277817848444866e-02 -8.5519348009399903e-03]
[-1.7565151434300809e-03 2.9160280222732863e-03 -3.5871206134031807e-03]]
Cumulative norm of all forces: 7.2751676428468512e-02 Hartree/Bohr
Converting energy and forces returned by model back to Angstroms and eV...
Converted energy is 3.7853736156031353e-01 eV
Converted forces (eV/Angstrom):
[[ 1.6895064607086805e+00 -8.0645899315367697e-01 -5.6345664358491687e-01]
[-2.5563132723418707e+00 1.1975509331798377e+00 9.1029613602309523e-01]
[ 1.8209172570771243e-01 9.0310614201225228e-02 2.7737579020316877e-01]
[ 7.7503871979113093e-01 -6.3135073338823522e-01 -4.3975813740759456e-01]
[-9.0323633865653757e-02 1.4994817916084935e-01 -1.8445714523375259e-01]]
Cumulative norm of converted forces: 3.7410413507767584e+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: 3.873484866190324e-11 eV
Cumulative norm of difference in initial forces and converted forces: 3.8280304122086565e-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