Closed matt-chan closed 5 years ago
@matt-chan, there is no Orbital
class in iodata
at this point, is there? I think this is relevant to the other thread regarding Orbital
package vs. class.
Sorry for the delay @FarnazH. No, there's no orbital class right now. But even to instantiate an Orbital instance from meanfield or from another orbital package, it's too clunky I think. We should instead give it all the parameters needed as a dictionary. Right now a developer would need to use the first code-block just to create an orbital instance.
Re-introducing an Orbital class is certainly an option, but it should remain focussed on facilitating IOData, not too many adding computational features. I would suggest to have one class, with possibly two instances, one for alpha and one for beta orbitals. I still need to figure out how to make it the most convenient for chemtools and denspart.
Here is a new proposal: one mo
attribute in IOData
that is flexible enough to handle different cases (restricted, unrestricted, generalized, open-/closed-shells)
mo
is an instance of type namedtuple('MolecularOrbitals', ['type', 'norba', 'norbb' 'energies', 'occupations', 'irreps', 'coefficients'])
where
type
is any of 'generalized'
, 'restricted
', 'unrestricted'
.norba
and norbb
are the number of alpha and beta orbitals. These can be set to None
in case of generalized. In case of restricted (open or closed) these are always the same. In case of unrestricted, they may (but not must) be different.energies
is an array of orbital energies, with shape (norb,)
.occupations
is an array with occupation numbers, with shape (norb,)
. Normally in the range [0, 1], but can be [0, 2] for restricted.irreps
is a list of strings describing the irrep to which each orbital belongs, with length (norb,)
coefficients
one array with orbital coefficients, with shape (nbasis, norb)
. Rows corresponding to basis functions and columns corresponding to orbitals. The number of rows equals the number of spatial basis functions, except for generalized where it is twice as large (once for alpha and once for beta). The number of columns equals the number of orbitals. In case of unrestricted, norb=norba+norbb
, and all alpha orbitals come first, followed by the beta orbitals. In case of restricted, norb=norba=norbb
. In case of generalized, norb
just is what it is.@FarnazH This is currently partially implemented. Do you have additional work on this in a local branch? If not, I could tackle this in the next few days.
@tovrstra I had a few small local commits and considering all the recent updates, there is nothing sitting there that isn't fully covered. Thanks for checking with me.
Fixed in #76.
It's too complicated to make an Orbital instance right now. You need to assign the attributes by hand, which is really clunky. ie
Instead we should introduce a new parameter,
orb_alpha_params
(or something along those lines) to be fed into Orbitals in the same way we do GBasis (this also requires an API change to Orbitals within meanfield). Then the API becomes something like