xtb-python icon indicating copy to clipboard operation
xtb-python copied to clipboard

The computational results is not aligned with xtb

Open zengkaipeng opened this issue 10 months ago • 0 comments

I followed the documentation at https://xtb-python.readthedocs.io/en/latest/index.html and used xtb-python to calculate orbital energies and orbital occupations. The code is as follows:

from xtb.libxtb import VERBOSITY_FULL
from xtb.interface import Calculator, Param
import numpy as np

numbers = np.array([8, 1, 1])
positions = np.array([
    [0.00000000000000, 0.00000000000000, -0.73578586109551],
    [1.44183152868459, 0.00000000000000, 0.36789293054775],
    [-1.44183152868459, 0.00000000000000, 0.36789293054775]]
)

calc = Calculator(Param.GFN2xTB, numbers, positions)
calc.set_verbosity(VERBOSITY_FULL)
res = calc.singlepoint()

print('xtb-py energy in Hartree:', res.get_energy())
print('xtb-py gradient:')
print(res.get_gradient())
print('xtb-py orbital occu:', res.get_orbital_occupations())
print('xtb-py orbital energy in Hartree', res.get_orbital_eigenvalues())

The results and the intermediate calculation logs are shown in the figures below .

Image

Image

However, when I saved the corresponding data into an XYZ file as follows:

3

O 0.00000000000000   0.00000000000000  -0.73578586109551
H 1.44183152868459  0.00000000000000  0.36789293054775
H -1.44183152868459  0.00000000000000  0.36789293054775

and ran the command xtb conf.xyz -c 0 --uhf 0 --gfn 2, I obtained completely different results. The results and intermediate process are shown in the figures below. I would like to know why this discrepancy occurs.

Image

Image

zengkaipeng avatar Feb 23 '25 10:02 zengkaipeng