theochem / AtomDB

An Extended Periodic Table of Neutral and Charged Atomic Species
http://atomdb.qcdevs.org/
GNU General Public License v3.0
16 stars 14 forks source link

no kinetic energy density from numeric dataset #129

Closed JannisErhard closed 1 week ago

JannisErhard commented 2 weeks ago

When I load in a numeric species object and I try to generate use the ked_func method I run into an error.

Here is minimal code to produce the error:

from atomdb import load
HF = load(elem="O", charge=0, mult=3, dataset="numeric")
ked_spline = HF.ked_func(spin="t")

Here is the error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[5], line 3
      1 from atomdb import load
      2 HF = load(elem="O", charge=0, mult=3, dataset="numeric")
----> 3 ked_spline = HF.ked_func(spin="t")
      4 print(HF.ked_func.__code__.co_filename)

File ~/Heat_Bath_CI/lib/python3.12/site-packages/atomdb/species.py:136, in spline.<locals>.wrapper(self, spin, index, log)
    134     arr = arr[index]
    135 # Colapse the orbital dimension to get total density values
--> 136 if arr.ndim > 1:
    137     arr = arr.sum(axis=0)  # (N,)
    139 # Return cubic spline

AttributeError: 'NoneType' object has no attribute 'ndi
PaulWAyers commented 2 weeks ago

Can we confirm that the data we had generated doesn't have the kinetic energy density? I think that is likely to be the case; as I recall we had only densities and their core/valence separation. Technically the (very old) code (dating from something Lee Bartolotti did in the 1980s!) I had would generate the k.e. density, but I wouldn't want to dig into it to do that, especially when we have the capability of generating accurate HF results already with the Slater basis functions.

gabrielasd commented 1 week ago

Yes, that is exactly what happens.

The file parsed for the numeric HF dataset has this information for the atomic species: 1st line is atomic no., no. of electrons, no. of grid points. Next line is kin. E, Vne, J, Exchange E, total E (?) next is R, rho, gradient, Laplacian

So the information for the kinetic energy density is not included.

PaulWAyers commented 1 week ago

Closing the issue then.

TL;DR The local kinetic energy is not available from the available numeric HF data.