You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Functions to interpret basis sets: label-to-basis-index and basis-index-to-label #257
Quoting @PaulWAyers: It would be useful to have a label-to-basis-index and basis-index-to-label functionality, similar to PySCF. It would not need to be implemented exactly like this, but it would be nice to have functionality that, for a given basis function (say, the 17th) would tell you its type, contraction coefficients, exponents, center etc. (e.g., that it was the 3rd dz^2 basis function on the second atomic center). Similarly, it would be nice to be able to ask for a specific type of basis function (e.g., the 3rd dz^2 on a specified atom) and return the basis index.
I'd like to take this one. Both directions come out of a single walk over shells, since conventions[(angmom, kind)] already gives the ordered labels, so there is no naming convention to invent. Working locally: a BasisFunction namedtuple plus iter_basis_functions, get_basis_function(index) and find_basis_index(label, icenter, occurrence), checked against 5 of the test fixtures where the number of walked functions matches nbasis and the first dimension of the MO coefficients. It comes to 54 lines of code but 99 with docstrings, over the 50-line guideline, so I would rather split it in two with index-to-label first. Does that split work, and should find_basis_index match a sign-flipped label like -c3 exactly, or strip the minus?
It's good to split it but 54 + 45 lines is not crazy, so it's not mandatory.
I'm curious what @tovrstra , @msricher and @FarnazH think, but I think that it would be nice, but inessential, to keep track of the sign convention for the basis functions.
Activity
ARYAMANN7279 commentedon Oct 9, 2026
I'd like to take this one. Both directions come out of a single walk over
shells, sinceconventions[(angmom, kind)]already gives the ordered labels, so there is no naming convention to invent. Working locally: aBasisFunctionnamedtuple plusiter_basis_functions,get_basis_function(index)andfind_basis_index(label, icenter, occurrence), checked against 5 of the test fixtures where the number of walked functions matchesnbasisand the first dimension of the MO coefficients. It comes to 54 lines of code but 99 with docstrings, over the 50-line guideline, so I would rather split it in two with index-to-label first. Does that split work, and shouldfind_basis_indexmatch a sign-flipped label like-c3exactly, or strip the minus?PaulWAyers commentedon Oct 10, 2026