Tests fail. I'm not sure the errors are non-negligible though?
xtb version 6.4.1 and xtb-python v20.2, I use intel compilers and mkl versions 2021.4.0 on CentOS 7.9
============================= test session starts ==============================
platform linux -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/energy/stly/modules
collected 30 items
test_interface.py .......... [ 33%]
test_libxtb.py . [ 36%]
test_utils.py .. [ 43%]
ase/test_calculator.py ..... [ 60%]
ase/test_optimize.py F.F [ 70%]
qcschema/test_qcschema.py F........ [100%]
=================================== FAILURES ===================================
______________________________ test_gfn1xtb_bfgs _______________________________
def test_gfn1xtb_bfgs():
"""Perform geometry optimization with GFN1-xTB and BFGS"""
thr = 1.0e-5
atoms = Atoms(
symbols = "NHCHC2H3OC2H3ONHCH3",
positions = np.array([
[ 1.40704587284727, -1.26605342016611, -1.93713466561923],
[ 1.85007200612454, -0.46824072777417, -1.50918242392545],
[-0.03362432532150, -1.39269245193812, -1.74003582081606],
[-0.56857009928108, -1.01764444489068, -2.61263467107342],
[-0.44096297340282, -2.84337808903410, -1.48899734014499],
[-0.47991761226058, -0.55230954385212, -0.55520222968656],
[-1.51566045903090, -2.89187354810876, -1.32273881320610],
[-0.18116520746778, -3.45187805987944, -2.34920431470368],
[ 0.06989722340461, -3.23298998903001, -0.60872832703814],
[-1.56668253918793, 0.00552120970194, -0.52884675001441],
[ 1.99245341064342, -1.73097165236442, -3.08869239114486],
[ 3.42884244212567, -1.30660069291348, -3.28712665743189],
[ 3.87721962540768, -0.88843123009431, -2.38921453037869],
[ 3.46548545761151, -0.56495308290988, -4.08311788302584],
[ 4.00253374168514, -2.16970938132208, -3.61210068365649],
[ 1.40187968630565, -2.43826111827818, -3.89034127398078],
[ 0.40869198386066, -0.49101709352090, 0.47992424955574],
[ 1.15591901335007, -1.16524842262351, 0.48740266650199],
[ 0.00723492494701, 0.11692276177442, 1.73426297572793],
[ 0.88822128447468, 0.28499001838229, 2.34645658013686],
[-0.47231557768357, 1.06737634000561, 1.52286682546986],
[-0.70199987915174, -0.50485938116399, 2.28058247845421],
]),
)
atoms.calc = XTB(method="GFN1-xTB", accuracy=2.0, cache_api=False)
opt = BFGS(atoms)
opt.run(fmax=0.1)
assert approx(atoms.get_potential_energy(), thr) == -951.9006674709672
> assert approx(np.linalg.norm(atoms.get_forces(), ord=2), thr) == 0.2052117803208497
E AssertionError: assert 0.2051907763726757 ± 2.1e-06 == 0.2052117803208497
E + where 0.2051907763726757 ± 2.1e-06 = approx(0.2051907763726757, 1e-05)
E + where 0.2051907763726757 = <function norm at 0x7f95f1cf0790>(array([[ 0.02237361, 0.02429641, -0.06093066],\n [-0.00613627, 0.020313 , 0.03872088],\n [-0.02944359, -...0481288, -0.03749684],\n [ 0.00898936, -0.03774712, -0.02156718],\n [ 0.05122454, -0.01808473, -0.06098617]]), ord=2)
E + where <function norm at 0x7f95f1cf0790> = <module 'numpy.linalg' from '/home/modules/software/SciPy-bundle/2021.10-intel-2021b/lib/python3.9/site-packages/numpy/linalg/__init__.py'>.norm
E + where <module 'numpy.linalg' from '/home/modules/software/SciPy-bundle/2021.10-intel-2021b/lib/python3.9/site-packages/numpy/linalg/__init__.py'> = np.linalg
E + and array([[ 0.02237361, 0.02429641, -0.06093066],\n [-0.00613627, 0.020313 , 0.03872088],\n [-0.02944359, -...0481288, -0.03749684],\n [ 0.00898936, -0.03774712, -0.02156718],\n [ 0.05122454, -0.01808473, -0.06098617]]) = <bound method Atoms.get_forces of Atoms(symbols='NHCHC2H3OC2H3ONHCH3', pbc=False, calculator=XTB(...))>()
E + where <bound method Atoms.get_forces of Atoms(symbols='NHCHC2H3OC2H3ONHCH3', pbc=False, calculator=XTB(...))> = Atoms(symbols='NHCHC2H3OC2H3ONHCH3', pbc=False, calculator=XTB(...)).get_forces
/home/modules/energy/software/xtb-python/20.2-intel-2021b-Python-3.9.6/xtb-python-20.2/xtb/ase/test_optimize.py:67: AssertionError
----------------------------- Captured stdout call -----------------------------
Step Time Energy fmax
BFGS: 0 11:23:59 -951.875911 9.91156e-01
BFGS: 1 11:23:59 -951.883077 1.11168e+00
BFGS: 2 11:23:59 -951.896465 1.46586e-01
BFGS: 3 11:23:59 -951.898042 1.16038e-01
BFGS: 4 11:23:59 -951.900667 9.72160e-02
_________________________ test_gfn2xtb_velocityverlet __________________________
def test_gfn2xtb_velocityverlet():
"""Perform molecular dynamics with GFN2-xTB and Velocity Verlet Integrator"""
thr = 1.0e-5
atoms = Atoms(
symbols = "NHCHC2H3OC2H3ONHCH3",
positions = np.array([
[ 1.40704587284727, -1.26605342016611, -1.93713466561923],
[ 1.85007200612454, -0.46824072777417, -1.50918242392545],
[-0.03362432532150, -1.39269245193812, -1.74003582081606],
[-0.56857009928108, -1.01764444489068, -2.61263467107342],
[-0.44096297340282, -2.84337808903410, -1.48899734014499],
[-0.47991761226058, -0.55230954385212, -0.55520222968656],
[-1.51566045903090, -2.89187354810876, -1.32273881320610],
[-0.18116520746778, -3.45187805987944, -2.34920431470368],
[ 0.06989722340461, -3.23298998903001, -0.60872832703814],
[-1.56668253918793, 0.00552120970194, -0.52884675001441],
[ 1.99245341064342, -1.73097165236442, -3.08869239114486],
[ 3.42884244212567, -1.30660069291348, -3.28712665743189],
[ 3.87721962540768, -0.88843123009431, -2.38921453037869],
[ 3.46548545761151, -0.56495308290988, -4.08311788302584],
[ 4.00253374168514, -2.16970938132208, -3.61210068365649],
[ 1.40187968630565, -2.43826111827818, -3.89034127398078],
[ 0.40869198386066, -0.49101709352090, 0.47992424955574],
[ 1.15591901335007, -1.16524842262351, 0.48740266650199],
[ 0.00723492494701, 0.11692276177442, 1.73426297572793],
[ 0.88822128447468, 0.28499001838229, 2.34645658013686],
[-0.47231557768357, 1.06737634000561, 1.52286682546986],
[-0.70199987915174, -0.50485938116399, 2.28058247845421],
]),
)
atoms.calc = XTB(method="GFN2-xTB", cache_api=False)
dyn = VelocityVerlet(atoms, timestep=1.0*fs)
dyn.run(20)
assert approx(atoms.get_potential_energy(), thr) == -896.9772346260584
> assert approx(atoms.get_kinetic_energy(), thr) == 0.022411127028842362
E AssertionError: assert 0.022409341448333585 ± 2.2e-07 == 0.022411127028842362
E + where 0.022409341448333585 ± 2.2e-07 = approx(0.022409341448333585, 1e-05)
E + where 0.022409341448333585 = <bound method Atoms.get_kinetic_energy of Atoms(symbols='NHCHC2H3OC2H3ONHCH3', pbc=False, momenta=..., calculator=XTB(...))>()
E + where <bound method Atoms.get_kinetic_energy of Atoms(symbols='NHCHC2H3OC2H3ONHCH3', pbc=False, momenta=..., calculator=XTB(...))> = Atoms(symbols='NHCHC2H3OC2H3ONHCH3', pbc=False, momenta=..., calculator=XTB(...)).get_kinetic_energy
/home/modules/energy/software/xtb-python/20.2-intel-2021b-Python-3.9.6/xtb-python-20.2/xtb/ase/test_optimize.py:150: AssertionError
_____________________________ test_gfn2xtb_energy ______________________________
def test_gfn2xtb_energy():
"""Use QCSchema to calculate the energy of a halogen bond compound"""
thr = 1.0e-7
atomic_input = qcel.models.AtomicInput(
molecule = {
"symbols": [
"C", "C", "C", "C", "C", "C", "I", "H", "H",
"H", "H", "H", "S", "H", "C", "H", "H", "H",
],
"geometry": [
-1.42754169820131, -1.50508961850828, -1.93430551124333,
1.19860572924150, -1.66299114873979, -2.03189643761298,
2.65876001301880, 0.37736955363609, -1.23426391650599,
1.50963368042358, 2.57230374419743, -0.34128058818180,
-1.12092277855371, 2.71045691257517, -0.25246348639234,
-2.60071517756218, 0.67879949508239, -1.04550707592673,
-2.86169588073340, 5.99660765711210, 1.08394899986031,
2.09930989272956, -3.36144811062374, -2.72237695164263,
2.64405246349916, 4.15317840474646, 0.27856972788526,
4.69864865613751, 0.26922271535391, -1.30274048619151,
-4.63786461351839, 0.79856258572808, -0.96906659938432,
-2.57447518692275, -3.08132039046931, -2.54875517521577,
-5.88211879210329, 11.88491819358157, 2.31866455902233,
-8.18022701418703, 10.95619984550779, 1.83940856333092,
-5.08172874482867, 12.66714386256482, -0.92419491629867,
-3.18311711399702, 13.44626574330220, -0.86977613647871,
-5.07177399637298, 10.99164969235585, -2.10739192258756,
-6.35955320518616, 14.08073002965080, -1.68204314084441,
],
},
driver = "energy",
model = {
"method": "GFN2-xTB",
},
keywords = {
"accuracy": 1.0,
"electronic_temperature": 300.0,
"max_iterations": 50,
"solvent": "none",
}
)
dipole_moment = np.array(
[0.3345064021648074, -1.0700925215553294, -1.2299195418603437]
)
atomic_result = run_qcschema(atomic_input)
assert atomic_result.success
assert approx(atomic_result.return_result, abs=thr) == -26.60185037124828
> assert approx(atomic_result.properties.scf_dipole_moment, abs=thr) == dipole_moment
E AssertionError: assert approx([0.3345115197707841 ± 1.0e-07, -1.070101790561011 ± 1.0e-07, -1.229921234359982 ± 1.0e-07]) == array([ 0.3345064021648074, -1.0700925215553294, -1.2299195418603437])
E + where approx([0.3345115197707841 ± 1.0e-07, -1.070101790561011 ± 1.0e-07, -1.229921234359982 ± 1.0e-07]) = approx(array([ 0.3345115197707841, -1.070101790561011 , -1.229921234359982 ]), abs=1e-07)
E + where array([ 0.3345115197707841, -1.070101790561011 , -1.229921234359982 ]) = AtomicResultProperties(return_energy=-26.60185043351621, scf_dipole_moment=array([ 0.3345115197707841, -1.070101790561011 , -1.229921234359982 ])).scf_dipole_moment
E + where AtomicResultProperties(return_energy=-26.60185043351621, scf_dipole_moment=array([ 0.3345115197707841, -1.070101790561011 , -1.229921234359982 ])) = AtomicResult(driver='energy', model={'method': 'GFN2-xTB', 'basis': None}, molecule_hash='3b522fc').properties
/home/modules/energy/software/xtb-python/20.2-intel-2021b-Python-3.9.6/xtb-python-20.2/xtb/qcschema/test_qcschema.py:73: AssertionError
=========================== short test summary info ============================
FAILED ase/test_optimize.py::test_gfn1xtb_bfgs - AssertionError: assert 0.205...
FAILED ase/test_optimize.py::test_gfn2xtb_velocityverlet - AssertionError: as...
FAILED qcschema/test_qcschema.py::test_gfn2xtb_energy - AssertionError: asser...
========================= 3 failed, 27 passed in 4.82s =========================