Our current representation of molecular Gaussian basis sets is not ideal:
- not very intuitive
- not very pythonic
- mainly geared toward the FCHK format, but it requires non-intuitive manipulations for all other formats.
The Gaussian orbital basis can be described by a single attribute:
obasis
of the type namedtuple('OBasisInfo', ['centers', 'shells', 'type', 'conventions'])
where:
centers
is an array with of shape (ncenter, 3)
shells
is a list of objects of the type namedtuple('Shell', ['icenter', 'iatom', 'angmoms', 'exponents', 'contractions'])
type
: any of 'cart'
or 'pure'
conventions
: a dictionary with as key an angular momentum character ('s'
, 'p'
, ...) and as value a list of basis function strings, e.g.
# alphabetically ordered Cartesian functions
['1'],
['x', 'y', 'z'],
['xx', 'xy', 'xz', 'yy', 'yz', 'zz'],
# wikipedia ordered real solid spherical harmonics
['s'],
['pc1', 'pc0', 'ps1],
['dc2', 'dc1', 'dc0', 'ds1', 'ds2'],
Any of these strings can be prefixed with a minus sign (-
) to denote sign conventions.
where:
icenter
: an integer referring to a row of centers
iatom
: an integer for the atom on which the shell is centered, or None
. This could be convenient when implementing Pulay forces.
angmoms
: a string where each character represents an angular momentum of one of the contractions in the shell. The length equals the number of contractions: len(angmoms)=ncon
. Any of the following can be used: ["s", "p", "d", "f", "g", "h", "i", "k", "l", "m", "n", "o", "q", "r", "t", "u", "v", "w", "x", "y", "z", "a", "b", "c", "e"]
exponents
: an array of exponents of primitives, with shape (nprim,)
.
contractions
: an array with contraction coefficients, with shape (ncon, nprim)
. These coefficients assume that the primitives are L2-normalized, but contractions are not necessarily normalized.
Remarks:
- A main downside of this idea is that IOData objects will become harder to store as
npz
files.
- Attributes
permutation
and signs
can be removed and should be replaced by convenience functions.
Example of an iterator over all basis functions:
def iterate_basis(obasis):
for shell in obasis.shells:
for angmom in shell.angmoms:
for convention in obasis.conventions[angmom]:
yield shell.icenter, shell.iatom, angmom, convention