Avogadro::Core::GaussianSet#

class GaussianSet : public BasisSet#

A container for Gaussian type outputs from QM codes.

The GaussianSet class has a transparent data structure for storing the basis sets output by many quantum mechanical codes. It has a certain hierarchy where shells are built up from n primitives, in this case Gaussian Type Orbitals (GTOs). Each shell has a type (S, P, D, F, etc) and is composed of one or more GTOs. Each GTO has a contraction coefficient, c, and an exponent, a.

Author

Marcus D. Hanwell

When calculating Molecular Orbitals (MOs) each orthogonal shell has an independent coefficient. That is the S type orbitals have one coefficient, the P type orbitals have three coefficients (Px, Py and Pz), the D type orbitals have five (or six if cartesian types) coefficients, and so on.

Public Types

enum orbital#

Enumeration of the Gaussian type orbitals.

Values:

enumerator S#
enumerator SP#
enumerator P#
enumerator D#
enumerator D5#
enumerator F#
enumerator F7#
enumerator G#
enumerator G9#
enumerator H#
enumerator H11#
enumerator I#
enumerator I13#
enumerator UU#

Public Functions

GaussianSet()#

Constructor.

~GaussianSet() override#

Destructor.

inline virtual GaussianSet *clone() const override#

Clone.

unsigned int addBasis(unsigned int atom, orbital type)#

Add a basis to the basis set.

Parameters:
  • atom – Index of the atom to add the Basis to.

  • type – The type of the Basis being added.

Returns:

The index of the added Basis.

unsigned int addGto(unsigned int basis, double c, double a)#

Add a GTO to the supplied basis.

Parameters:
  • basis – The index of the Basis to add the GTO to.

  • c – The contraction coefficient of the GTO.

  • a – The exponent of the GTO.

Returns:

The index of the added GTO.

void setMolecularOrbitals(const std::vector<double> &MOs, ElectronType type = Paired)#

Set the molecular orbital (MO) coefficients to the GaussianSet.

Parameters:
  • MOs – Vector containing the MO coefficients for the GaussianSet.

  • type – The type of the MOs (Paired, Alpha, Beta).

void setMolecularOrbitals(const std::vector<double> &MOs, ElectronType type, Index index)#

Set the molecular orbital (MO) coefficients for a given index. Note that this must be used with coordinate sets to work correctly.

Parameters:
  • MOs – Vector containing the MO coefficients for the GaussianSet.

  • type – The type of the MOs (Paired, Alpha, Beta).

  • index – The index of the MO in the sequence.

inline int setCount()#

Get the number of elements in the set.

bool setActiveSetStep(int index)#

Set the active element in the set, this expects a corresponding coordinate set element, and will change the active MO matrix.

void setMolecularOrbitalEnergy(const std::vector<double> &energies, ElectronType type = Paired)#

Set the molecular orbital energies, expected in Hartrees.

Parameters:
  • energies – The vector containing energies for the MOs of type

  • type – The type of the electrons being set.

void setMolecularOrbitalOccupancy(const std::vector<unsigned char> &occ, ElectronType type = Paired)#

Set the molecular orbital occupancies.

Parameters:
  • occ – The occupancies for the MOs of type.

  • type – The type of the electrons being set.

void setMolecularOrbitalNumber(const std::vector<unsigned int> &nums, ElectronType type = Paired)#

This enables support of sparse orbital sets, and provides a mapping from the index in memory to the actual molecular orbital number.

Parameters:
  • nums – The MO numbers (starting with an index of 1 for the first one).

  • type – The MO type (Paired, Alpha, Beta).

bool setDensityMatrix(const MatrixX &m)#

Set the SCF density matrix for the GaussianSet.

bool setSpinDensityMatrix(const MatrixX &m)#

Set the spin density matrix for the GaussianSet.

bool generateDensityMatrix()#

Generate the density matrix if we have the required information.

Returns:

True on success, false on failure.

bool generateSpinDensityMatrix()#

Generate the spin density matrix if we have the required information.

Returns:

True on success, false on failure.

virtual unsigned int molecularOrbitalCount(ElectronType type = Paired) override#
Returns:

The number of molecular orbitals in the GaussianSet.

void outputAll(ElectronType type = Paired)#

Debug routine, outputs all of the data in the GaussianSet.

Parameters:

type – The electrons to output the information for.

virtual bool isValid() override#
Returns:

True of the basis set is valid, false otherwise. Default is true, if false then the basis set is likely unusable.

inline void setScfType(ScfType type)#

Set the SCF type for the object.

inline ScfType scfType() const#

Get the SCF type for the object.

inline void setFunctionalName(const std::string &name)#

Set the functional name (if applicable).

inline std::string functionalName() const#

Get the functional name (empty if none used).

void initCalculation()#

Initialize the calculation, this must normally be done before anything.

inline std::vector<int> &symmetry()#

Accessors for the various properties of the GaussianSet.

inline std::vector<int> symmetry() const#
inline std::vector<unsigned int> &atomIndices()#
inline std::vector<unsigned int> atomIndices() const#
inline std::vector<unsigned int> &moIndices()#
inline std::vector<unsigned int> moIndices() const#
inline std::vector<unsigned int> &gtoIndices()#
inline std::vector<unsigned int> gtoIndices() const#
inline std::vector<unsigned int> &cIndices()#
inline std::vector<unsigned int> cIndices() const#
inline std::vector<double> &gtoA()#
inline std::vector<double> gtoA() const#
inline std::vector<double> &gtoC()#
inline std::vector<double> gtoC() const#
inline std::vector<double> &gtoCN()#
inline MatrixX &moMatrix(ElectronType type = Paired)#
inline MatrixX moMatrix(ElectronType type = Paired) const#
inline std::vector<double> &moEnergy(ElectronType type = Paired)#
inline std::vector<double> moEnergy(ElectronType type = Paired) const#
inline std::vector<unsigned char> &moOccupancy(ElectronType type = Paired)#
inline std::vector<unsigned char> moOccupancy(ElectronType type = Paired) const#
inline std::vector<unsigned int> &moNumber(ElectronType type = Paired)#
inline std::vector<unsigned int> moNumber(ElectronType type = Paired) const#
inline MatrixX &densityMatrix()#
inline MatrixX &spinDensityMatrix()#