theochem / iodata

Python library for reading, writing, and converting computational chemistry file formats and generating input files.
https://iodata.readthedocs.io/
GNU Lesser General Public License v3.0
131 stars 46 forks source link

Intuitive representation of molecular basis set #42

Closed tovrstra closed 5 years ago

tovrstra commented 5 years ago

Our current representation of molecular Gaussian basis sets is not ideal:

The Gaussian orbital basis can be described by a single attribute:

obasis of the type namedtuple('OBasisInfo', ['centers', 'shells', 'type', 'conventions'])

where:

where:

Remarks:

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
FarnazH commented 5 years ago
  1. Is there any reason not to use center as an attribute in the namedtuple instead of icenter? This gives namedtuple('Shell', ['center', 'type', 'angmoms', 'exponents', 'concoeffs']) which gives better access to the shell.center instead of centers[shell.icenter].

  2. I think the last line of code snippet, ibasis += 1, should be indented to be included inside the last for loop, no?

tovrstra commented 5 years ago

For point 1, it is convenient to group shells by centers with integer indices. I'll fix point 2.

FarnazH commented 5 years ago

See https://github.com/theochem/iodata/blob/master/iodata/wfn.py#L141

PaulWAyers commented 5 years ago

I think we were going to change shell ordering in the next version of HORTON? Should we do that now? https://github.com/theochem/cgbasis/issues/2

tovrstra commented 5 years ago

@PaulWAyers Now would be good.

PaulWAyers commented 5 years ago

Do we know what that convention is? I looked quickly but didn't see it....

tovrstra commented 5 years ago

IOData should not fix this convention. The purpose of this issue is to define how the convention is represented. When implementing Gaussian integrals, you can decide which convention you use, as long as it can be described it with the data structure described here.

kimt33 commented 5 years ago

For implementing gbasis, we need a nice data structure from which we can build the rest of the code. We plan on creating a class for the set of contracted Cartesian Gaussians of the same angular momentum. I know there are plans to come up with some data structure for orbitals here, but we can refactor or make a wrapper around gbasis if necessary.

See https://github.com/theochem/gbasis/issues/2

PaulWAyers commented 5 years ago

I think the idea will be that flexible basis sets are allowed in iodata, and that iodata can convert from one basis-set representation to another. As such, one thing iodata could do is build whatever basis-set representation gbasis uses, or pass to gbasis the data so that gbasis porcelain can build its own representation. In terms of modularity, probably the latter is a bit better..but I'm not sure.

tovrstra commented 5 years ago

@PaulWAyers I fully agree. I would go for the second option, where gbasis knows how to interpret a a namedtuple from iodata.