File SparrowState.h

Copyright

This code is licensed under the 3-clause BSD license.

Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.

See LICENSE.txt for details.

namespace Scine
namespace Sparrow
class StateNotAvailableException : public exception
#include <SparrowState.h>

Exception for the case that a state is requested which is not available.

Public Functions

StateNotAvailableException(std::string stateName)
const char *what() const

Private Members

std::string stateName_
class EmptyStateException : public exception

Public Functions

const char *what() const
struct SparrowState : public State
#include <SparrowState.h>

Definition of a calculation state for NDDO methods.

The calculation state is defined as being a collection of the density matrix, optionally the Fock matrix and the one and two electron matrices. Only matrix states are saved here.

Public Functions

SparrowState(Utils::StateSize size, GenericMethodWrapper &methodWrapper)

Constructor, calls the base class constructor to initialize the size of the state.

const Eigen::MatrixXd &getMatrixState(const std::string &matrixState) const

Getter for a Eigen::MatrixXd state identified with a std::string.

Return

The value of the key-value pair, an Eigen::MatrixXd.

Parameters
  • matrixState: The key for the state’s key-value pair.

const std::string &getStringState(const std::string &stringState) const

Getter for a std::string state identified with a std::string.

Return

The value of the key-value pair, a std::string.

Parameters
  • stringState: The key for the state’s key-value pair.

int getIntState(const std::string &intState) const

Getter for a integer state identified with a std::string.

Return

The value of the key-value pair, an integer.

Parameters
  • intState: The key for the state’s key-value pair.

double getDoubleState(const std::string &doubleState) const

Getter for a double state identified with a std::string.

Return

The value of the key-value pair, a double.

Parameters
  • doubleState: The key for the state’s key-value pair.

void initialize()

Initializer for the state, resets it to the initial state.

In this case the initial state is just the initial density matrix guess.

bool hasState(const std::string &matrixState) const
void generateDensityMatrixState(const Utils::DensityMatrix &densityMatrix, bool isUnrestricted)
void generateFockMatrixState(const Utils::SpinAdaptedMatrix &fockMatrix, bool isUnrestricted)

Private Members

MatrixState matrixStates_

A std::map of std::string keys with Eigen::MatrixXd values.

GenericMethodWrapper &methodWrapper_