Skip to content

Commit

Permalink
Update and add doc to MolecularBasis
Browse files Browse the repository at this point in the history
Added
- Emphasis on contracted shell.
- Method section detailing the methods
- Notes including the definitions of different types of molecular
basis.
  • Loading branch information
Ali-Tehrani committed Aug 5, 2020
1 parent d956cfa commit 8eb2ea7
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions iodata/basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def ncon(self) -> int: # noqa: D401


class MolecularBasis(NamedTuple):
"""A complete molecular orbital or density basis set.
"""A complete molecular orbital or density basis set as a collection of contracted shells.
Attributes
----------
Expand Down Expand Up @@ -225,6 +225,29 @@ class MolecularBasis(NamedTuple):
primitive_normalization
The normalization convention of primitives, which can be 'L2' (orbitals) or 'L1'
(densities) normalized.
Methods
-------
get_segmented
Return molecular basis object that is segmented.
get_decontracted
Return molecular basis object that is decontracted.
convert_kind
Return molecular basis object whose kinds are the same type.
Notes
-----
- Primitive Contracted Shell with exponent :math:`\alpha`:
Set of all contractions in a contracted shell that have the exponent :math:`\alpha`.
Since there is a single exponent, then the degree of these contractions is one.
- Segmented Molecular Basis:
Molecular basis where each contracted shell has contractions that all correspond to the
same total angular momentum number. There could only be the same shell-type inside a
contracted shell. There could only be one kind of shell-type inside a contracted shell.
- Decontracted Molecular Basis:
Segmented molecular basis where each contracted shell is a primitive contracted shell with
its single exponent.
"""

Expand All @@ -238,7 +261,11 @@ def nbasis(self) -> int: # noqa: D401
return sum(shell.nbasis for shell in self.shells)

def get_segmented(self):
"""Unroll generalized contractions."""
"""Convert Generalized Molecular Basis to Segmented Molecular Basis.
Segmented Molecular basis is a Molecular basis where all contracted shell in it share
a specific total angular momentum number.
"""
shells = []
for shell in self.shells:
for angmom, kind, coeffs in zip(shell.angmoms, shell.kinds, shell.coeffs.T):
Expand All @@ -249,7 +276,7 @@ def get_segmented(self):

def get_decontracted(self):
r"""
Get Decontracted Molecular Basis from a Molecular Basis.
Convert to Decontracted Molecular Basis from a Molecular Basis.
Decontracted Molecular basis is a Molecular basis where each contracted shell is a
primitive contracted shell (ie contracted shell with only one exponent and one kind).
Expand Down Expand Up @@ -289,7 +316,7 @@ def convert_kind(self, to: str):
See Also
--------
convert_primitive_kind : Converts individual groups of primitive shells.
convert_primitive_kind : Converts primitive shells with no averaging.
"""
if to != "c" and to != "p":
Expand Down

0 comments on commit 8eb2ea7

Please sign in to comment.