Loading...
Searching...
No Matches
GaussianSet Class Reference

A container for Gaussian type outputs from QM codes. More...

`#include <avogadro/core/gaussianset.h>`

Inheritance diagram for GaussianSet:

## Public Types

enum | orbital { S , SP , P , D , D5 , F , F7 , G , G9 , H , H11 , I , I13 , UU }
Public Types inherited from BasisSet
enum | ElectronType { Paired , Alpha , Beta }
| The ElectronType enum describes the type of electrons being set or retrieved. If Paired, then Alpha and Beta cannot be set, if Alpha or Beta then both must be set.

## Public Member Functions

| GaussianSet ()
| ~GaussianSet () override=default
GaussianSet * | clone () const override
unsigned int | addBasis (unsigned int atom, orbital type)
unsigned int | addGto (unsigned int basis, double c, double a)
void | setMolecularOrbitals (const std::vector< double > &MOs, ElectronType type=Paired)
void | setMolecularOrbitals (const std::vector< double > &MOs, ElectronType type, Index index)
int | setCount ()
bool | setActiveSetStep (int index)
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.
bool | setDensityMatrix (const MatrixX &m)
bool | setSpinDensityMatrix (const MatrixX &m)
bool | generateDensityMatrix ()
| Generate the density matrix if we have the required information.
bool | generateSpinDensityMatrix ()
| Generate the spin density matrix if we have the required information.
unsigned int | molecularOrbitalCount (ElectronType type=Paired) const override
void | outputAll (ElectronType type=Paired)
bool | isValid () override
void | setScfType (ScfType type)
ScfType | scfType () const
void | setFunctionalName (const std::string &name)
std::string | functionalName () const
void | initCalculation ()
std::vector< int > & | symmetry ()
std::vector< int > | symmetry () const
std::vector< unsigned int > & | atomIndices ()
std::vector< unsigned int > | atomIndices () const
std::vector< unsigned int > & | moIndices ()
std::vector< unsigned int > | moIndices () const
std::vector< unsigned int > & | gtoIndices ()
std::vector< unsigned int > | gtoIndices () const
std::vector< unsigned int > & | cIndices ()
std::vector< unsigned int > | cIndices () const
std::vector< double > & | gtoA ()
std::vector< double > | gtoA () const
std::vector< double > & | gtoC ()
std::vector< double > | gtoC () const
std::vector< double > & | gtoCN ()
MatrixX & | moMatrix (ElectronType type=Paired)
MatrixX | moMatrix (ElectronType type=Paired) const
std::vector< unsigned int > & | moNumber (ElectronType type=Paired)
std::vector< unsigned int > | moNumber (ElectronType type=Paired) const
MatrixX & | densityMatrix ()
MatrixX & | spinDensityMatrix ()
Public Member Functions inherited from BasisSet
| BasisSet ()=default
virtual | ~BasisSet ()=default
virtual void | setElectronCount (unsigned int n, ElectronType type=Paired)
unsigned int | electronCount (ElectronType type=Paired) const
void | setMolecule (Molecule *molecule_)
Molecule * | molecule ()
const Molecule * | molecule () const
void | setName (const std::string &name)
std::string | name () const
void | setTheoryName (const std::string &name)
std::string | theoryName () const
unsigned int | homo (ElectronType type=Paired) const
unsigned int | lumo (ElectronType type=Paired) const
std::vector< std::string > | symmetryLabels (ElectronType type=Paired) const
void | setSymmetryLabels (const std::vector< std::string > &labels, ElectronType type=Paired)
void | setMolecularOrbitalEnergy (const std::vector< double > &energies, ElectronType type=Paired)
| Set the molecular orbital energies, expected in Hartrees.
void | setMolecularOrbitalOccupancy (const std::vector< unsigned char > &occ, ElectronType type=Paired)
| Set the molecular orbital occupancies.
std::vector< double > & | moEnergy (ElectronType type=Paired)
std::vector< double > | moEnergy (ElectronType type=Paired) const
std::vector< unsigned char > & | moOccupancy (ElectronType type=Paired)
std::vector< unsigned char > | moOccupancy (ElectronType type=Paired) const

## Additional Inherited Members

Protected Attributes inherited from BasisSet
std::array< unsigned int, 2 > | m_electrons = {}
Molecule * | m_molecule = nullptr
std::string | m_name
std::string | m_theoryName
std::vector< std::string > | m_symmetryLabels [2]
std::vector< double > | m_moEnergy [2]
| This block stores energies for the molecular orbitals (same convention as the molecular orbital coefficients).
std::vector< unsigned char > | m_moOccupancy [2]
| The occupancy of the molecular orbitals.

## Detailed Description

Author
  Marcus D. Hanwell

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.

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.

## Member Enumeration Documentation

## orbital

enum orbital

Enumeration of the Gaussian type orbitals.

## Constructor & Destructor Documentation

## GaussianSet()

GaussianSet | ( |  | ) |

Constructor.

## ~GaussianSet()

~GaussianSet | ( |  | ) |

override default

Destructor.

## Member Function Documentation

## clone()

GaussianSet * clone | ( |  | ) | const

override virtual

Clone.

Implements BasisSet.

## addBasis()

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.

## addGto()

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.

## setMolecularOrbitals() [1/2]

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).

## setMolecularOrbitals() [2/2]

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.

## setCount()

int setCount | ( |  | ) |

Get the number of elements in the set.

## setActiveSetStep()

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.

## setMolecularOrbitalNumber()

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

Parameters

  nums | The MO numbers (starting with an index of 1 for the first one).
  type | The MO type (Paired, Alpha, Beta).

## setDensityMatrix()

bool setDensityMatrix | ( | const MatrixX & | m | ) |

Set the SCF density matrix for the GaussianSet.

## setSpinDensityMatrix()

bool setSpinDensityMatrix | ( | const MatrixX & | m | ) |

Set the spin density matrix for the GaussianSet.

## generateDensityMatrix()

bool generateDensityMatrix | ( |  | ) |

Returns
  True on success, false on failure.

## generateSpinDensityMatrix()

bool generateSpinDensityMatrix | ( |  | ) |

Returns
  True on success, false on failure.

## molecularOrbitalCount()

unsigned int molecularOrbitalCount | ( | ElectronType | type = Paired | ) | const

override virtual

Returns
  The number of molecular orbitals in the GaussianSet.

Implements BasisSet.

## outputAll()

void outputAll | ( | ElectronType | type = Paired | ) |

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

Parameters

  type | The electrons to output the information for.

## isValid()

bool isValid | ( |  | ) |

override virtual

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

Implements BasisSet.

## setScfType()

void setScfType | ( | ScfType | type | ) |

Set the SCF type for the object.

## scfType()

ScfType scfType | ( |  | ) | const

Get the SCF type for the object.

## setFunctionalName()

void setFunctionalName | ( | const std::string & | name | ) |

Set the functional name (if applicable).

## functionalName()

std::string functionalName | ( |  | ) | const

Get the functional name (empty if none used).

## initCalculation()

void initCalculation | ( |  | ) |

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

## symmetry()

std::vector< int > & symmetry | ( |  | ) |

Accessors for the various properties of the GaussianSet.

The documentation for this class was generated from the following file:

- gaussianset.h