File SpinAdaptedMatrix.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

This header file contains functions that allow for common notation for common things that can be done at a different degree of derivatives.

This header contains alias definitions defining which classes to use for the different degrees of derivatives.

namespace Utils
class SpinAdaptedMatrix
#include <SpinAdaptedMatrix.h>

Class defining a matrix and which can be used for both spin-restricted and spin-unrestricted formalisms in electronic structure calculation methods. There is only slight overhead if only the restricted formulation is needed.

Accessors to the underlying matrices by reference. @{

SpinAdaptedMatrix::Matrix &restrictedMatrix()
const SpinAdaptedMatrix::Matrix &restrictedMatrix() const
SpinAdaptedMatrix::Matrix &alphaMatrix()
const SpinAdaptedMatrix::Matrix &alphaMatrix() const
SpinAdaptedMatrix::Matrix &betaMatrix()
const SpinAdaptedMatrix::Matrix &betaMatrix() const

Accessors to the matrix elements.

Using template functions to allow perfect forwarding to the Eigen functions.

template<typename Index>
double restricted(Index i, Index j) const
template<typename Index>
double alpha(Index i, Index j) const
template<typename Index>
double beta(Index i, Index j) const

Setters for the matrix elements.

Using template functions to allow perfect forwarding to the Eigen functions.

template<typename Index>
void setRestricted(Index i, Index j, double x)
template<typename Index>
void setAlpha(Index i, Index j, double x)
template<typename Index>
void setBeta(Index i, Index j, double x)

Public Types

using Matrix = Eigen::MatrixXd

Public Functions

template<typename T>
void setRestrictedMatrix(T &&restrictedMatrix)
template<typename T>
void setAlphaMatrix(T &&alphaMatrix)
template<typename T>
void setBetaMatrix(T &&betaMatrix)
void resize(int nAOs)

Set the size of the matrices (number of atomic orbitals)

Public Static Functions

static SpinAdaptedMatrix createRestricted(Eigen::MatrixXd m)

Construct a SpinAdaptedMatrix with restricted part only from an Eigen::MatrixXd.

static SpinAdaptedMatrix createUnrestricted(Eigen::MatrixXd alpha, Eigen::MatrixXd beta)

Construct a SpinAdaptedMatrix with alpha and beta parts only from two Eigen::MatrixXd.

Protected Attributes

Matrix restrictedMatrix_
Matrix alphaMatrix_
Matrix betaMatrix_