sisi4s
Loading...
Searching...
No Matches
sisi4s::ClusterSinglesDoublesAlgorithm Class Referenceabstract

Contains all the necessary tools for an algorithm with singles and doubles amplitudes. It calculates the energy from the amplitudes $T_{a}^{i}$ and $T_{ab}^{ij}$ and the Coulomb integrals $V_{ij}^{ab}$. For calculating the amplitudes it calls the iteration routine of the actual algorithm. More...

#include <ClusterSinglesDoublesAlgorithm.hpp>

Inheritance diagram for sisi4s::ClusterSinglesDoublesAlgorithm:
Collaboration diagram for sisi4s::ClusterSinglesDoublesAlgorithm:

Public Member Functions

 ClusterSinglesDoublesAlgorithm (std::vector< Argument > const &argumentList)
 
virtual ~ClusterSinglesDoublesAlgorithm ()
 
virtual void run ()
 Calculates the energy of a ClusterSinglesDoubles algorithm.
 
virtual std::string getAbbreviation ()=0
 Returns the abbreviation of the concrete algorithm, e.g. "Ccd", "Dcd".
 
- Public Member Functions inherited from sisi4s::Algorithm
 Algorithm (std::vector< Argument > const &argumentList)
 
virtual ~Algorithm ()
 
virtual std::string getName ()=0
 
virtual void run ()=0
 
virtual void dryRun ()
 The dryRun estimates resource consumption, especially memory and processor time.
 
bool isArgumentGiven (std::string const &argumentName)
 
std::string getTextArgument (std::string const &argumentName)
 
std::string getTextArgument (std::string const &argumentName, std::string const &defaultValue)
 
bool getBooleanArgument (std::string const &name)
 
bool getBooleanArgument (std::string const &name, bool const &defaultValue)
 
int64_t getIntegerArgument (std::string const &argumentName)
 
int64_t getIntegerArgument (std::string const &argumentName, int64_t const defaultValue)
 
real getRealArgument (std::string const &argumentName)
 
real getRealArgument (std::string const &argumentName, real const defaultValue)
 
template<typename F = real, typename T = Tensor<F>>
T * getTensorArgument (std::string const &argumentName)
 
template<typename F = real, typename C = std::vector<F>>
C * getContainerArgument (std::string const &argumentName)
 
template<typename F = real, typename C = std::vector<F>>
void allocateContainerArgument (std::string const &argumentName, C *container)
 
std::vector< std::string > getGivenArgumentNames () const
 
void checkArgumentsOrDie (const std::vector< std::string > args) const
 
template<typename F = real, typename T = Tensor<F>>
void allocatedTensorArgument (std::string const &argumentName, T *tensor)
 Specifies the location of an output tensor data.
 
void setRealArgument (std::string const &argumentName, real const value)
 
void setIntegerArgument (std::string const &argumentName, int const value)
 
real getRealArgumentFromInteger (IntegerData *data)
 
real getRealArgumentFromTensor (TensorData< real > *data)
 
template<typename F = real, typename T = Tensor<F>>
T * getTensorArgumentFromReal (RealData *realData)
 Converts the given real data into a scalar tensor.
 
DatagetArgumentData (std::string const &argumentName)
 

Static Public Attributes

static int constexpr DEFAULT_MAX_ITERATIONS = 16
 Defines the default number of iterations (16).
 
static double constexpr DEFAULT_ENERGY_CONVERGENCE = 1E-6
 
static double constexpr DEFAULT_AMPLITUDES_CONVERGENCE = 1E-5
 
static double constexpr DEFAULT_LEVEL_SHIFT = 0.0
 

Protected Member Functions

template<typename F >
run ()
 
virtual std::shared_ptr< FockVector< double > > getResiduum (const int iteration, const std::shared_ptr< const FockVector< double > > &amplitudes)=0
 Computes and returns the residuum of the given amplitudes.
 
virtual std::shared_ptr< FockVector< complex > > getResiduum (const int iteration, const std::shared_ptr< const FockVector< complex > > &amplitudes)=0
 Computes and returns the residuum of the given amplitudes.
 
template<typename F >
getEnergy (const std::shared_ptr< const FockVector< F > > &amplitdues)
 Computes and returns the energy of the given amplitudes.
 
template<typename F >
void estimateAmplitudesFromResiduum (const std::shared_ptr< FockVector< F > > &residuum, const std::shared_ptr< const FockVector< F > > &amplitudes)
 Calculates an improved estimate of the amplitudes provided the given the residuum. $T_{ij\ldots}^{ab\ldots} = \frac{R_{ij\ldots}^{a\ldots}}
{-\Delta_{ij\ldots}^{ab\ldots}}$ with $\Delta_{ij\ldots}^{ab\ldots} =
\varepsilon_i+\ldots-\varepsilon_a-\ldots$.
 
template<typename F >
void calculateExcitationEnergies (Tensor< F > &D, const std::string &indices)
 Calculates eps_a+eps_b+...-eps_i-eps_j-... into D^ab..._ij...
 
template<typename F >
void dryAmplitudesFromResiduum (sisi4s::DryTensor< F > &R)
 Dry run for amplitudesFromResiduum.
 
template<typename F >
std::shared_ptr< FockVector< F > > createAmplitudes (std::vector< std::string > amplitudeNames, std::vector< std::vector< TensorIndex > > amplitudeLens, std::vector< std::string > amplitudeIndices)
 
template<typename F >
void storeAmplitudes (const std::shared_ptr< const FockVector< F > > &amplitudes, std::vector< std::string > names)
 
Tensor< double > * sliceCoupledCoulombIntegrals (const std::shared_ptr< const FockVector< double > > &amplitudes, int a, int b, int integralsSliceSize)
 Calculates and returns one slice Xxycd of the Coulomb integrals $V_{cd}^{ab}$ coupled to the singles amplitudes. The indices x and y are restricted to the range {No+a, ..., No+a+No-1} and {No+b, ..., No+b+No-1}, respectively. The caller is responsible for deleting the dynamically allocated result tensor.
 
Tensor< complex > * sliceCoupledCoulombIntegrals (const std::shared_ptr< const FockVector< complex > > &amplitudes, int a, int b, int integralsSliceSize)
 
Tensor< double > * sliceAmplitudesFromCoupledCoulombFactors (const std::shared_ptr< const FockVector< double > > &amplitudes, int a, int b, int factorsSliceSize)
 Calculates and returns one slice Fabij of the residuum from the dressed Coulomb factors. The slice is computed from Rx and Ry and are restricted to the range {a, ..., factorsSliceSize+a-1} and {b, ..., factorsSliceSize+b-1}, respectively. The caller is responsible for deleting the dynamically allocated result tensor.
 
Tensor< complex > * sliceAmplitudesFromCoupledCoulombFactors (const std::shared_ptr< const FockVector< complex > > &amplitudes, int a, int b, int factorsSliceSize)
 
template<typename F >
void sliceIntoResiduum (Tensor< F > &Rxyij, int a0, int b0, Tensor< F > &Rabij)
 Adds the given slice of the residuum tensor Rxyij to the entire residuum tensor Rabij at the respective index range.
 
std::string getCapitalizedAbbreviation ()
 The abbreviation of the algorithm in capital letters.
 
std::string getDataName (const std::string &type, const std::string &data)
 

Additional Inherited Members

- Public Attributes inherited from sisi4s::Algorithm
std::string note
 
bool fallible = false
 
std::map< std::string, std::string > arguments
 

Detailed Description

Contains all the necessary tools for an algorithm with singles and doubles amplitudes. It calculates the energy from the amplitudes $T_{a}^{i}$ and $T_{ab}^{ij}$ and the Coulomb integrals $V_{ij}^{ab}$. For calculating the amplitudes it calls the iteration routine of the actual algorithm.

Constructor & Destructor Documentation

◆ ClusterSinglesDoublesAlgorithm()

ClusterSinglesDoublesAlgorithm::ClusterSinglesDoublesAlgorithm ( std::vector< Argument > const &  argumentList)

◆ ~ClusterSinglesDoublesAlgorithm()

ClusterSinglesDoublesAlgorithm::~ClusterSinglesDoublesAlgorithm ( )
virtual

Member Function Documentation

◆ calculateExcitationEnergies()

template<typename F >
template void ClusterSinglesDoublesAlgorithm::calculateExcitationEnergies ( Tensor< F > &  D,
const std::string &  indices 
)
protected

Calculates eps_a+eps_b+...-eps_i-eps_j-... into D^ab..._ij...

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createAmplitudes()

template<typename F >
template std::shared_ptr< FockVector< sisi4s::Complex64 > > ClusterSinglesDoublesAlgorithm::createAmplitudes ( std::vector< std::string >  amplitudeNames,
std::vector< std::vector< TensorIndex > >  amplitudeLens,
std::vector< std::string >  amplitudeIndices 
)
protected
Here is the call graph for this function:

◆ dryAmplitudesFromResiduum()

template<typename F >
template void ClusterSinglesDoublesAlgorithm::dryAmplitudesFromResiduum ( sisi4s::DryTensor< F > &  R)
protected

Dry run for amplitudesFromResiduum.

Parameters
[in]Rresiduum tensor.

◆ estimateAmplitudesFromResiduum()

template<typename F >
template void ClusterSinglesDoublesAlgorithm::estimateAmplitudesFromResiduum ( const std::shared_ptr< FockVector< F > > &  residuum,
const std::shared_ptr< const FockVector< F > > &  amplitudes 
)
protected

Calculates an improved estimate of the amplitudes provided the given the residuum. $T_{ij\ldots}^{ab\ldots} = \frac{R_{ij\ldots}^{a\ldots}}
{-\Delta_{ij\ldots}^{ab\ldots}}$ with $\Delta_{ij\ldots}^{ab\ldots} =
\varepsilon_i+\ldots-\varepsilon_a-\ldots$.

Parameters
[in,out]residuumFock vector, overwritten with new amplitudes.
[in]amplitudesFock vector, previous amplitudes
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAbbreviation()

virtual std::string sisi4s::ClusterSinglesDoublesAlgorithm::getAbbreviation ( )
pure virtual

◆ getCapitalizedAbbreviation()

std::string ClusterSinglesDoublesAlgorithm::getCapitalizedAbbreviation ( )
protected

The abbreviation of the algorithm in capital letters.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDataName()

std::string ClusterSinglesDoublesAlgorithm::getDataName ( const std::string &  type,
const std::string &  data 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEnergy()

template<typename F >
F ClusterSinglesDoublesAlgorithm::getEnergy ( const std::shared_ptr< const FockVector< F > > &  amplitdues)
protected

Computes and returns the energy of the given amplitudes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getResiduum() [1/2]

virtual std::shared_ptr< FockVector< complex > > sisi4s::ClusterSinglesDoublesAlgorithm::getResiduum ( const int  iteration,
const std::shared_ptr< const FockVector< complex > > &  amplitudes 
)
protectedpure virtual

◆ getResiduum() [2/2]

virtual std::shared_ptr< FockVector< double > > sisi4s::ClusterSinglesDoublesAlgorithm::getResiduum ( const int  iteration,
const std::shared_ptr< const FockVector< double > > &  amplitudes 
)
protectedpure virtual

Computes and returns the residuum of the given amplitudes.

Implemented in sisi4s::CcsdEnergyFromCoulombIntegrals, sisi4s::CcsdEnergyFromCoulombIntegralsReference, sisi4s::CcsdtEnergyFromCoulombIntegrals, sisi4s::DrccdEnergyFromCoulombIntegrals, sisi4s::UccsdAmplitudesFromCoulombIntegrals, sisi4s::UccsdtAmplitudesFromCoulombIntegrals, sisi4s::UccsdtqAmplitudesFromCoulombIntegrals, and sisi4s::UrpaAmplitudesFromCoulombIntegrals.

Here is the caller graph for this function:

◆ run() [1/2]

void ClusterSinglesDoublesAlgorithm::run ( )
virtual

Calculates the energy of a ClusterSinglesDoubles algorithm.

Implements sisi4s::Algorithm.

Reimplemented in sisi4s::ClusterSinglesDoublesTriplesAlgorithm, sisi4s::ClusterSinglesDoublesTriplesAlgorithm, sisi4s::ClusterSinglesDoublesTriplesQuadruplesAlgorithm, sisi4s::ClusterSinglesDoublesTriplesQuadruplesAlgorithm, sisi4s::UccsdAmplitudesFromCoulombIntegrals, sisi4s::UccsdtAmplitudesFromCoulombIntegrals, and sisi4s::UccsdtqAmplitudesFromCoulombIntegrals.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run() [2/2]

template<typename F >
F ClusterSinglesDoublesAlgorithm::run
protectedvirtual

◆ sliceAmplitudesFromCoupledCoulombFactors() [1/2]

Tensor< sisi4s::complex > * ClusterSinglesDoublesAlgorithm::sliceAmplitudesFromCoupledCoulombFactors ( const std::shared_ptr< const FockVector< complex > > &  amplitudes,
int  a,
int  b,
int  factorsSliceSize 
)
protected
Here is the call graph for this function:

◆ sliceAmplitudesFromCoupledCoulombFactors() [2/2]

Tensor< double > * ClusterSinglesDoublesAlgorithm::sliceAmplitudesFromCoupledCoulombFactors ( const std::shared_ptr< const FockVector< double > > &  amplitudes,
int  a,
int  b,
int  factorsSliceSize 
)
protected

Calculates and returns one slice Fabij of the residuum from the dressed Coulomb factors. The slice is computed from Rx and Ry and are restricted to the range {a, ..., factorsSliceSize+a-1} and {b, ..., factorsSliceSize+b-1}, respectively. The caller is responsible for deleting the dynamically allocated result tensor.

Parameters
[in]a1st sliced dimension (Rx).
[in]b2nd sliced dimension (Ry).
[in]factorsSliceSizeslicing rank of NR.
[out]Fabijsliced Residuum
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sliceCoupledCoulombIntegrals() [1/2]

Tensor< complex > * sisi4s::ClusterSinglesDoublesAlgorithm::sliceCoupledCoulombIntegrals ( const std::shared_ptr< const FockVector< complex > > &  amplitudes,
int  a,
int  b,
int  integralsSliceSize 
)
protected

◆ sliceCoupledCoulombIntegrals() [2/2]

Tensor< double > * ClusterSinglesDoublesAlgorithm::sliceCoupledCoulombIntegrals ( const std::shared_ptr< const FockVector< double > > &  amplitudes,
int  a,
int  b,
int  integralsSliceSize 
)
protected

Calculates and returns one slice Xxycd of the Coulomb integrals $V_{cd}^{ab}$ coupled to the singles amplitudes. The indices x and y are restricted to the range {No+a, ..., No+a+No-1} and {No+b, ..., No+b+No-1}, respectively. The caller is responsible for deleting the dynamically allocated result tensor.

Parameters
[in]a1st sliced dimension (x).
[in]b2nd sliced dimension (y).
[in]integralsSliceSizeslicing rank.
[out]Xxycdsliced coupled Coulomb integrals Xabcd
Here is the call graph for this function:

◆ sliceIntoResiduum()

template<typename F >
template void ClusterSinglesDoublesAlgorithm::sliceIntoResiduum ( Tensor< F > &  Rxyij,
int  a0,
int  b0,
Tensor< F > &  Rabij 
)
protected

Adds the given slice of the residuum tensor Rxyij to the entire residuum tensor Rabij at the respective index range.

Parameters
[in]a01st sliced dimension (x).
[in]b02nd sliced dimension (y).
[in]Rxyijsliced residuum
[in]Rabijentire residuum.
Here is the caller graph for this function:

◆ storeAmplitudes()

template<typename F >
void ClusterSinglesDoublesAlgorithm::storeAmplitudes ( const std::shared_ptr< const FockVector< F > > &  amplitudes,
std::vector< std::string >  names 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ DEFAULT_AMPLITUDES_CONVERGENCE

double constexpr sisi4s::ClusterSinglesDoublesAlgorithm::DEFAULT_AMPLITUDES_CONVERGENCE = 1E-5
staticconstexpr

◆ DEFAULT_ENERGY_CONVERGENCE

double constexpr sisi4s::ClusterSinglesDoublesAlgorithm::DEFAULT_ENERGY_CONVERGENCE = 1E-6
staticconstexpr

◆ DEFAULT_LEVEL_SHIFT

double constexpr sisi4s::ClusterSinglesDoublesAlgorithm::DEFAULT_LEVEL_SHIFT = 0.0
staticconstexpr

◆ DEFAULT_MAX_ITERATIONS

int constexpr sisi4s::ClusterSinglesDoublesAlgorithm::DEFAULT_MAX_ITERATIONS = 16
staticconstexpr

Defines the default number of iterations (16).


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