!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!! !!!!!
!!!!! 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 3.552713678800501e-15 Bohr, which is below
tolerance 1e-06.
Creating Model object with Angstrom and eV as simulator registered units
------------------------------------------------------------------------------------------------------------------------
Results for KIM Model : LJ_Shifted_Bernardes_1958MedCutoff_Xe__MO_849320763277_004
Supported species : Xe
Model computes energy : True
Model computes forces : True
Model native length unit : A
Model native energy unit : eV
Influence distance : 15.9 Angstroms
Model cutoffs : [15.9] Angstroms
Smallest model cutoff : 15.9 Angstroms
Parameters for random cluster generation
Random seed: 11
Min. distance between atoms (dmin) : 1.5900000000000001e+00 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 Xe atoms with a diameter 14.310000 Angstroms and a minimum separation
of 1.590000 Angstroms between all atoms
Cluster positions (Angstroms):
[[-1.2547220994411896e+01 3.8704258848100035e+00 1.5810338202882444e+00]
[-8.2094569907394401e+00 1.7998559735213298e+00 1.3181927919622874e-01]
[ 3.5963663004781927e+00 8.2622901536487117e+00 2.1467993519582218e-01]
[ 6.7638555897588626e-01 -2.4436581779042403e+00 -3.5243657064193754e+00]
[ 6.5607273974404494e+00 4.2024416769055337e+00 6.1452702594294299e+00]]
Calling Model compute...
Model returned energy of -1.6704077495153295e-02 eV
Model returned forces (eV/Angstrom):
[[ 1.0333501283026635e-02 -4.9325508941644430e-03 -3.4527354698129882e-03]
[-1.0191392979424613e-02 4.8860970177268277e-03 3.4031954823816675e-03]
[ 3.7191023014031429e-04 -6.2850049718513306e-04 7.9701206051834353e-04]
[-9.2792116912475796e-05 1.2984666210406963e-04 9.0701232507718426e-05]
[-4.2122641682986020e-04 5.4510771151867923e-04 -8.3817330559474146e-04]]
Cumulative norm of all forces: 1.6874010427281576e-02 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:
[[-2.3710811303754436e+01 7.3140449076945755e+00 2.9877209140099037e+00]
[-1.5513625343843259e+01 3.4012348536067027e+00 2.4910233561764092e-01]
[ 6.7961473514969919e+00 1.5613465552035986e+01 4.0568628195816331e-01]
[ 1.2781834610711271e+00 -4.6178446982777164e+00 -6.6600859479202823e+00]
[ 1.2397977959052735e+01 7.9414638237836259e+00 1.1612877751718827e+01]]
Calling Model compute...
Model returned energy of -6.1386356867659071e-04 Hartree
Model returned forces (Hartree/Bohr):
[[ 2.0095461962292896e-04 -9.5922849531715585e-05 -6.7145019291238767e-05]
[-1.9819105291756542e-04 9.5019465401414556e-05 6.6181619853069841e-05]
[ 7.2325029808127874e-06 -1.2222389574007733e-05 1.5499417967792584e-05]
[-1.8045194989990180e-06 2.5251157258082515e-06 1.7638582682384728e-06]
[-8.1915501871773250e-06 1.0600657978500515e-05 -1.6299876797862133e-05]]
Cumulative norm of all forces: 3.2814728077669762e-04 Hartree/Bohr
Converting energy and forces returned by model back to Angstroms and eV...
Converted energy is -1.6704077493444061e-02 eV
Converted forces (eV/Angstrom):
[[ 1.0333501281969257e-02 -4.9325508936597191e-03 -3.4527354694596861e-03]
[-1.0191392978381777e-02 4.8860970172268569e-03 3.4031954820334348e-03]
[ 3.7191023010225884e-04 -6.2850049712082231e-04 7.9701206043679006e-04]
[-9.2792116902980855e-05 1.2984666209078305e-04 9.0701232498437411e-05]
[-4.2122641678675850e-04 5.4510771146290158e-04 -8.3817330550897597e-04]]
Cumulative norm of converted forces: 1.6874010425554940e-02 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.7092334492208039e-12 eV
Cumulative norm of difference in initial forces and converted forces: 1.7266363638367337e-12
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