Closed jjgoings closed 2 years ago
Heavy elements won't work using periodictable due to a small formatting issue. For example, even after pip install periodictable, running, e.g.
periodictable
pip install periodictable
import tequila as tq geomstring="Zn 0.0 0.0 0.0" molecule = tq.Molecule(geometry=geomstring, frozen_core=True, basis_set='cc-pvdz', backend='pyscf')
will fail with
tequila.utils.exceptions.TequilaException: can not assign atomic number to element zn pip install periodictable will fix it
The issue lies in https://github.com/tequilahub/tequila/blob/d09a1ad6f161ee5f5b65c5ed4c83286d9973c217/src/tequila/quantumchemistry/chemistry_tools.py#L157 because you will get a TypeError: 'str' object does not support item assignment. The proposed fix is to convert to a list, make the first element uppercase, and then rejoin to str.
TypeError: 'str' object does not support item assignment
str
There is also a small issue with the return in https://github.com/tequilahub/tequila/blob/d09a1ad6f161ee5f5b65c5ed4c83286d9973c217/src/tequila/quantumchemistry/chemistry_tools.py#L159
because number is a parameter, not a callable. See, for example, the Element code here.
number
Element
Thanks for fixing! Re-directed to devel branch to stay consistent with the changes from yesterday, and to not lose overview over changes in the next version.
Heavy elements won't work using
periodictable
due to a small formatting issue. For example, even afterpip install periodictable
, running, e.g.will fail with
The issue lies in https://github.com/tequilahub/tequila/blob/d09a1ad6f161ee5f5b65c5ed4c83286d9973c217/src/tequila/quantumchemistry/chemistry_tools.py#L157 because you will get a
TypeError: 'str' object does not support item assignment
. The proposed fix is to convert to a list, make the first element uppercase, and then rejoin tostr
.There is also a small issue with the return in https://github.com/tequilahub/tequila/blob/d09a1ad6f161ee5f5b65c5ed4c83286d9973c217/src/tequila/quantumchemistry/chemistry_tools.py#L159
because
number
is a parameter, not a callable. See, for example, theElement
code here.