GQCP
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
GQCP::LinearExpansion< _Scalar, _ONVBasis > Class Template Reference

#include <LinearExpansion.hpp>

Collaboration diagram for GQCP::LinearExpansion< _Scalar, _ONVBasis >:
Collaboration graph

Public Types

using Scalar = _Scalar
 
using ONVBasis = _ONVBasis
 

Public Member Functions

 LinearExpansion (const ONVBasis &onv_basis, const VectorX< Scalar > &coefficients)
 
 LinearExpansion ()=default
 
Scalar coefficient (const size_t i) const
 
const VectorX< Scalar > & coefficients () const
 
const ONVBasisonvBasis () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value > basisTransform (const RTransformation< double > &T)
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinUnresolvedONVBasis >::value, G1DM< double > > calculate1DM () const
 
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedONVBasis >::value, ScalarcalculateNDMElement (const std::vector< size_t > &bra_indices, const std::vector< size_t > &ket_indices) const
 
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedSelectedONVBasis >::value, ScalarcalculateNDMElement (const std::vector< size_t > &bra_indices, const std::vector< size_t > &ket_indices) const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, SpinResolved1DM< double > > calculateSpinResolved1DM () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, SpinResolved2DM< double > > calculateSpinResolved2DM () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, Orbital1DM< double > > calculate1DM () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, Orbital2DM< double > > calculate2DM () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SeniorityZeroONVBasis >::value, Orbital1DM< double > > calculate1DM () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SeniorityZeroONVBasis >::value, Orbital2DM< double > > calculate2DM () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SeniorityZeroONVBasis >::value, SpinResolved1DM< double > > calculateSpinResolved1DM () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SeniorityZeroONVBasis >::value, SpinResolved2DM< double > > calculateSpinResolved2DM () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedSelectedONVBasis >::value, SpinResolved1DM< double > > calculateSpinResolved1DM () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedSelectedONVBasis >::value, SpinResolved2DM< double > > calculateSpinResolved2DM () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedSelectedONVBasis >::value, Orbital1DM< double > > calculate1DM () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedSelectedONVBasis >::value, Orbital2DM< double > > calculate2DM () const
 
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedSelectedONVBasis >::value, G1DM< Scalar > > calculate1DM () const
 
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedSelectedONVBasis >::value, G2DM< Scalar > > calculate2DM () const
 
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedONVBasis >::value|std::is_same< Z, SpinResolvedONVBasis >::value, GQCP::Tensor< Scalar, 2 > > tensorizeCoefficients (const std::vector< typename ONVBasis::ONV > &system_onvs, const std::vector< typename ONVBasis::ONV > &environment_onvs) const
 
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinResolvedONVBasis >::value, Tensor< Scalar, 2 > > calculateSystemOrbitalRDM (const DiscreteDomainPartition &domain_partition) const
 
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedONVBasis >::value, Tensor< Scalar, 2 > > calculateSystemOrbitalRDM (const DiscreteDomainPartition &domain_partition) const
 
template<typename Z = Scalar>
enable_if_t< std::is_same< Z, double >::value, double > calculateShannonEntropy () const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, double > calculateSingleOrbitalEntropy (const size_t orbital_index) const
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, Scalar >::value &&std::is_same< Z2, SeniorityZeroONVBasis >::value, double > calculateSingleOrbitalEntropy (const size_t orbital_index) const
 
template<typename ElectronPartition , typename Z = ONVBasis, std::enable_if_t< std::is_same< Z, SpinResolvedONVBasis >::value, bool > = true>
double calculateProbabilityOfFindingElectronPartition (const DiscreteDomainPartition &domain_partition, const ElectronPartition &electron_partition) const
 
template<typename ElectronPartition , typename Z = ONVBasis, std::enable_if_t< std::is_same< Z, SpinUnresolvedONVBasis >::value, bool > = true>
double calculateProbabilityOfFindingElectronPartition (const DiscreteDomainPartition &domain_partition, const ElectronPartition &electron_partition) const
 
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinResolvedONVBasis >::value, void > forEach (const std::function< void(const Scalar, const SpinResolvedONV)> &callback) const
 
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedONVBasis >::value, void > forEach (const std::function< void(const Scalar, const SpinUnresolvedONV)> &callback) const
 
bool isApprox (const LinearExpansion< Scalar, ONVBasis > &other, double tolerance=1.0e-12) const
 

Static Public Member Functions

static LinearExpansion< Scalar, ONVBasisConstant (const ONVBasis &onv_basis)
 
static LinearExpansion< Scalar, ONVBasisHartreeFock (const ONVBasis &onv_basis)
 
static LinearExpansion< Scalar, ONVBasisNormalized (const ONVBasis &onv_basis, const VectorX< Scalar > &coefficients)
 
static LinearExpansion< Scalar, ONVBasisRandom (const ONVBasis &onv_basis)
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
static enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedSelectedONVBasis >::value, LinearExpansion< double, SpinResolvedSelectedONVBasis > > FromGAMESSUS (const std::string &GAMESSUS_filename)
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
static enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, LinearExpansion< double, SpinResolvedONVBasis > > FromONVProjection (const SpinResolvedONV &onv, const RSpinOrbitalBasis< double, GTOShell > &r_spinor_basis, const USpinOrbitalBasis< double, GTOShell > &u_spinor_basis)
 
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
static enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinUnresolvedONVBasis >::value, LinearExpansion< double, SpinUnresolvedONVBasis > > FromONVProjection (const SpinUnresolvedONV &onv_of, const GSpinorBasis< double, GTOShell > &spinor_basis_on, const GSpinorBasis< double, GTOShell > &spinor_basis_of)
 

Detailed Description

template<typename _Scalar, typename _ONVBasis>
class GQCP::LinearExpansion< _Scalar, _ONVBasis >

A class that represents a linear expansion inside an ONV basis.

Template Parameters
_ScalarThe scalar type of the expansion coefficients: real or complex.
_ONVBasisThe type of ONV basis.

Member Typedef Documentation

◆ ONVBasis

template<typename _Scalar , typename _ONVBasis >
using GQCP::LinearExpansion< _Scalar, _ONVBasis >::ONVBasis = _ONVBasis

◆ Scalar

template<typename _Scalar , typename _ONVBasis >
using GQCP::LinearExpansion< _Scalar, _ONVBasis >::Scalar = _Scalar

Constructor & Destructor Documentation

◆ LinearExpansion() [1/2]

template<typename _Scalar , typename _ONVBasis >
GQCP::LinearExpansion< _Scalar, _ONVBasis >::LinearExpansion ( const ONVBasis onv_basis,
const VectorX< Scalar > &  coefficients 
)
inline

Construct a linear expansion inside the given ONV basis, with corresponding expansion coefficients.

Parameters
onv_basisThe ONV basis with respect to which the coefficients are defined.
coefficientsThe expansion coefficients.

◆ LinearExpansion() [2/2]

template<typename _Scalar , typename _ONVBasis >
GQCP::LinearExpansion< _Scalar, _ONVBasis >::LinearExpansion ( )
default

Member Function Documentation

◆ basisTransform()

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value > GQCP::LinearExpansion< _Scalar, _ONVBasis >::basisTransform ( const RTransformation< double > &  T)
inline

Update the expansion coefficients of this linear expansion so that they correspond to the situation after a transformation of the underlying spinor basis with the given basis transformation.

Parameters
TThe transformation between the old and the new restricted spin-orbital basis.
Note
This method is only available for the full spin-resolved ONV basis.
This algorithm was implemented from a description in Helgaker2000.

The transformation of the expansion coefficients is adapted from Helgaker2000, chapter 11.9. For every orbital, a set of correction coefficients will be calculated (Delta C in Helgaker), to update the current coefficients.

◆ calculate1DM() [1/5]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinUnresolvedONVBasis >::value, G1DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculate1DM ( ) const
inline

◆ calculate1DM() [2/5]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, Orbital1DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculate1DM ( ) const
inline

Calculate the one-electron density matrix for a full spin-resolved wave function expansion.

Returns
The orbital (total, spin-summed) 1-DM

◆ calculate1DM() [3/5]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SeniorityZeroONVBasis >::value, Orbital1DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculate1DM ( ) const
inline

Calculate the orbital one-electron density matrix for a seniority-zero wave function expansion.

Returns
The orbital (total, spin-summed) 1-DM.

◆ calculate1DM() [4/5]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedSelectedONVBasis >::value, Orbital1DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculate1DM ( ) const
inline

Calculate the one-electron density matrix for a spin-resolved selected wave function expansion.

Returns
The orbital (total, spin-summed) 1-DM.

◆ calculate1DM() [5/5]

template<typename _Scalar , typename _ONVBasis >
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedSelectedONVBasis >::value, G1DM< Scalar > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculate1DM ( ) const
inline

Calculate the generalized (G) one-electron density matrix for a spin-unresolved selected wave function expansion.

Returns
The generalized (G) 1-DM.

◆ calculate2DM() [1/4]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, Orbital2DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculate2DM ( ) const
inline

Calculate the two-electron density matrix for a full spin-resolved wave function expansion.

Returns
The orbital (total, spin-summed) 2-DM.

◆ calculate2DM() [2/4]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SeniorityZeroONVBasis >::value, Orbital2DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculate2DM ( ) const
inline

Calculate the two-electron density matrix for a seniority-zero wave function expansion.

Returns
The orbital (total, spin-summed) 2-DM.

◆ calculate2DM() [3/4]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedSelectedONVBasis >::value, Orbital2DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculate2DM ( ) const
inline

Calculate the two-electron density matrix for a spin-resolved selected wave function expansion.

Returns
The orbital (total, spin-summed) 2-DM.

◆ calculate2DM() [4/4]

template<typename _Scalar , typename _ONVBasis >
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedSelectedONVBasis >::value, G2DM< Scalar > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculate2DM ( ) const
inline

Calculate the generalized (G) two-electron density matrix (1-DM) for a spin-unresolved selected wave function expansion.

Returns
The generalized (G) 2-DM.

◆ calculateNDMElement() [1/2]

template<typename _Scalar , typename _ONVBasis >
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedONVBasis >::value, Scalar > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateNDMElement ( const std::vector< size_t > &  bra_indices,
const std::vector< size_t > &  ket_indices 
) const
inline

Calculate an element of the N-electron density matrix.

Parameters
bra_indicesThe indices of the orbitals that should be annihilated on the left (on the bra).
ket_indicesThe indices of the orbitals that should be annihilated on the right (on the ket).
Returns
An element of the N-DM, as specified by the given bra and ket indices. calculateNDMElement({0, 1}, {2, 1}) would calculate an element of the 2-NDM d^{(2)} (0, 1, 1, 2) corresponding the operator string: a^\dagger_0 a^\dagger_1 a_2 a_1.
Note
This method is only enabled for linear expansions related to spin-unresolved ONV bases.

◆ calculateNDMElement() [2/2]

template<typename _Scalar , typename _ONVBasis >
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedSelectedONVBasis >::value, Scalar > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateNDMElement ( const std::vector< size_t > &  bra_indices,
const std::vector< size_t > &  ket_indices 
) const
inline

Calculate an element of the N-electron density matrix.

Parameters
bra_indicesThe indices of the orbitals that should be annihilated on the left (on the bra).
ket_indicesThe indices of the orbitals that should be annihilated on the right (on the ket).
Returns
An element of the N-DM, as specified by the given bra and ket indices. calculateNDMElement({0, 1}, {2, 1}) would calculate an element of the 2-NDM d^{(2)} (0, 1, 1, 2) corresponding the operator string: a^\dagger_0 a^\dagger_1 a_2 a_1.
Note
This method is only enabled for linear expansions related to spin-unresolved selected ONV bases.

◆ calculateProbabilityOfFindingElectronPartition() [1/2]

template<typename _Scalar , typename _ONVBasis >
template<typename ElectronPartition , typename Z = ONVBasis, std::enable_if_t< std::is_same< Z, SpinResolvedONVBasis >::value, bool > = true>
double GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateProbabilityOfFindingElectronPartition ( const DiscreteDomainPartition &  domain_partition,
const ElectronPartition &  electron_partition 
) const
inline

MARK: Probability Calculate the probability of finding a given electron distribution over the discrete domains according to equation (11) in VanHende2022 (https://doi.org/10.1002/jcc.26806).

Parameters
domain_partitionThe partition of the orbitals in discrete domains.
electron_partitionElectron occupation number in each discrete domain.
Returns
the probability of finding a given electron distribution over the discrete domains.

◆ calculateProbabilityOfFindingElectronPartition() [2/2]

template<typename _Scalar , typename _ONVBasis >
template<typename ElectronPartition , typename Z = ONVBasis, std::enable_if_t< std::is_same< Z, SpinUnresolvedONVBasis >::value, bool > = true>
double GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateProbabilityOfFindingElectronPartition ( const DiscreteDomainPartition &  domain_partition,
const ElectronPartition &  electron_partition 
) const
inline

Calculate the probability of finding a given electron distribution over the discrete domains according to equation (11) in VanHende2022 (https://doi.org/10.1002/jcc.26806).

Parameters
domain_partitionThe partition of the orbitals in discrete domains.
electron_partitionElectron occupation number in each discrete domain.
Returns
The probability of finding a given electron distribution over the discrete domains.

◆ calculateShannonEntropy()

template<typename _Scalar , typename _ONVBasis >
template<typename Z = Scalar>
enable_if_t< std::is_same< Z, double >::value, double > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateShannonEntropy ( ) const
inline
Returns
The Shannon entropy (information content) of the wave function.

◆ calculateSingleOrbitalEntropy() [1/2]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, double > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateSingleOrbitalEntropy ( const size_t  orbital_index) const
inline

Calculate the single orbital entropy of the orbital at the selected index, from the spin-resolved 1- and two-particle density matrix. The implementation is based on https://doi.org/10.1002/qua.24832.

Parameters
orbital_indexThe index of the orbital for which the single orbital entropy needs to be calculated.
Returns
The single orbital entropy of the orbital at the specified index.
Note
This version of this method is used when the linear expansion is based on a spin-resolved ONV basis.

◆ calculateSingleOrbitalEntropy() [2/2]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, Scalar >::value &&std::is_same< Z2, SeniorityZeroONVBasis >::value, double > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateSingleOrbitalEntropy ( const size_t  orbital_index) const
inline

Calculate the single orbital entropy of the orbital at the selected index, from the spin-resolved 1- and two-particle density matrix. The implementation is based on https://doi.org/10.1002/qua.24832.

Parameters
orbital_indexThe index of the orbital for which the single orbital entropy needs to be calculated.
Returns
The single orbital entropy of the orbital at the specified index.
Note
This version of this method is used when the linear expansion is based on a seniority-zero ONV basis.

◆ calculateSpinResolved1DM() [1/3]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, SpinResolved1DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateSpinResolved1DM ( ) const
inline

Calculate the spin-resolved one-electron density matrix for a full spin-resolved wave function expansion.

Returns
The spin-resolved 1-DM.

◆ calculateSpinResolved1DM() [2/3]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SeniorityZeroONVBasis >::value, SpinResolved1DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateSpinResolved1DM ( ) const
inline

Calculate the spin-resolved one-electron density matrix for a seniority-zero wave function expansion.

Returns
The spin-resolved 1-DM.

◆ calculateSpinResolved1DM() [3/3]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedSelectedONVBasis >::value, SpinResolved1DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateSpinResolved1DM ( ) const
inline

Calculate the spin-resolved one-electron density matrix for a spin-resolved selected wave function expansion.

Returns
The spin-resolved 1-DM.

◆ calculateSpinResolved2DM() [1/3]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, SpinResolved2DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateSpinResolved2DM ( ) const
inline

Calculate the spin-resolved two-electron density matrix for a full spin-resolved wave function expansion.

Returns
The spin-resolved 2-DM.

◆ calculateSpinResolved2DM() [2/3]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SeniorityZeroONVBasis >::value, SpinResolved2DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateSpinResolved2DM ( ) const
inline

Calculate the spin-resolved two-electron density matrix for a seniority-zero wave function expansion.

Returns
The spin-resolved 2-DM.

◆ calculateSpinResolved2DM() [3/3]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedSelectedONVBasis >::value, SpinResolved2DM< double > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateSpinResolved2DM ( ) const
inline

Calculate the spin-resolved two-electron density matrix for a spin-resolved selected wave function expansion.

Returns
The spin-resolved 2-DM.

◆ calculateSystemOrbitalRDM() [1/2]

template<typename _Scalar , typename _ONVBasis >
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinResolvedONVBasis >::value, Tensor< Scalar, 2 > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateSystemOrbitalRDM ( const DiscreteDomainPartition &  domain_partition) const
inline

Calculate the system orbital reduced density matrix as defined in equation (2) of Rissler2005 (https://doi.org/10.1016/j.chemphys.2005.10.018).

Parameters
domain_partitionThe (discrete) domain partition used to partition the spin-resolved ONVs in this LinearExpansion.
Returns
The system orbital reduced density matrix.

◆ calculateSystemOrbitalRDM() [2/2]

template<typename _Scalar , typename _ONVBasis >
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedONVBasis >::value, Tensor< Scalar, 2 > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::calculateSystemOrbitalRDM ( const DiscreteDomainPartition &  domain_partition) const
inline

Calculate the system orbital reduced density matrix as defined in equation (2) of Rissler2005 (https://doi.org/10.1016/j.chemphys.2005.10.018).

Parameters
domain_partitionThe (discrete) domain partition used to partition the spin-unresolved ONVs in this LinearExpansion.
Returns
The system orbital reduced density matrix.

◆ coefficient()

template<typename _Scalar , typename _ONVBasis >
Scalar GQCP::LinearExpansion< _Scalar, _ONVBasis >::coefficient ( const size_t  i) const
inline

Access a coefficient of the linear expansion.

Parameters
iThe index (address) of the coefficient that should be obtained.
Returns
The i-th expansion coefficient.

◆ coefficients()

template<typename _Scalar , typename _ONVBasis >
const VectorX< Scalar > & GQCP::LinearExpansion< _Scalar, _ONVBasis >::coefficients ( ) const
inline
Returns
The expansion coefficients of this linear expansion wave function model.

◆ Constant()

template<typename _Scalar , typename _ONVBasis >
static LinearExpansion< Scalar, ONVBasis > GQCP::LinearExpansion< _Scalar, _ONVBasis >::Constant ( const ONVBasis onv_basis)
inlinestatic

Create a linear expansion with a normalized coefficient vector (i.e. all the coefficients are equal).

Parameters
onv_basisThe ONV basis with respect to which the coefficients are defined.
Returns
A constant LinearExpansion.

◆ forEach() [1/2]

template<typename _Scalar , typename _ONVBasis >
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinResolvedONVBasis >::value, void > GQCP::LinearExpansion< _Scalar, _ONVBasis >::forEach ( const std::function< void(const Scalar, const SpinResolvedONV)> &  callback) const
inline

Iterate over all expansion coefficients and corresponding ONVs, and apply the given callback function.

Parameters
callbackThe function to be applied in every iteration. Its arguments are an expansion coefficient and the corresponding ONV.

◆ forEach() [2/2]

template<typename _Scalar , typename _ONVBasis >
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedONVBasis >::value, void > GQCP::LinearExpansion< _Scalar, _ONVBasis >::forEach ( const std::function< void(const Scalar, const SpinUnresolvedONV)> &  callback) const
inline

Iterate over all expansion coefficients and corresponding ONVs, and apply the given callback function.

Parameters
callbackThe function to be applied in every iteration. Its arguments are an expansion coefficient and the corresponding ONV.

◆ FromGAMESSUS()

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
static enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedSelectedONVBasis >::value, LinearExpansion< double, SpinResolvedSelectedONVBasis > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::FromGAMESSUS ( const std::string &  GAMESSUS_filename)
inlinestatic

Create a linear expansion by reading in a GAMESS-US file.

Parameters
GAMESSUS_filenameThe name of the GAMESS-US file that contains the spin-resolved selected wave function expansion.
Returns
The corresponding spin-resolved selected linear expansion from a given GAMESS-US file.

◆ FromONVProjection() [1/2]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
static enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinResolvedONVBasis >::value, LinearExpansion< double, SpinResolvedONVBasis > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::FromONVProjection ( const SpinResolvedONV &  onv,
const RSpinOrbitalBasis< double, GTOShell > &  r_spinor_basis,
const USpinOrbitalBasis< double, GTOShell > &  u_spinor_basis 
)
inlinestatic

Create the linear expansion of the given spin-resolved ONV that is expressed in the given USpinOrbitalBasis, by projection onto the spin-resolved ONVs expressed with respect to the given RSpinOrbitalBasis.

Parameters
onvA spin-resolved ONV expressed with respect to an unrestricted spin-orbital basis.
r_spinor_basisThe restricted spin-orbital basis that is used to define the resulting linear expansion of ONVs against.
u_spinor_basisThe unrestricted spin-orbital basis against which the given ONV is expressed.
Returns
A linear expansion inside a spin-resolved ONV basis.

◆ FromONVProjection() [2/2]

template<typename _Scalar , typename _ONVBasis >
template<typename Z1 = Scalar, typename Z2 = ONVBasis>
static enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, SpinUnresolvedONVBasis >::value, LinearExpansion< double, SpinUnresolvedONVBasis > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::FromONVProjection ( const SpinUnresolvedONV &  onv_of,
const GSpinorBasis< double, GTOShell > &  spinor_basis_on,
const GSpinorBasis< double, GTOShell > &  spinor_basis_of 
)
inlinestatic

Create the linear expansion of the given spin-unresolved ONV that is expressed in the given GSpinorBasis, by projection onto the spin-resolved ONVs expressed with respect to another given GSpinorBasis.

Parameters
onv_ofA spin-unresolved ONV expressed with respect to a general spinor basis.
spinor_basis_onThe general spinor basis that is used to define the resulting linear expansion of ONVs against.
spinor_basis_ofThe general spinor basis against which the given ONV is expressed.
Returns
A linear expansion inside a spin-unresolved ONV basis.

◆ HartreeFock()

template<typename _Scalar , typename _ONVBasis >
static LinearExpansion< Scalar, ONVBasis > GQCP::LinearExpansion< _Scalar, _ONVBasis >::HartreeFock ( const ONVBasis onv_basis)
inlinestatic

Create a linear expansion that represents the Hartree-Fock wave function.

Parameters
onv_basisThe ONV basis with respect to which the coefficients are defined.
Returns
a LinearExpansion

◆ isApprox()

template<typename _Scalar , typename _ONVBasis >
bool GQCP::LinearExpansion< _Scalar, _ONVBasis >::isApprox ( const LinearExpansion< Scalar, ONVBasis > &  other,
double  tolerance = 1.0e-12 
) const
inline
Parameters
otherThe other linear expansion for the comparison.
toleranceThe tolerance for the comparison of coefficients.
Returns
If the two linear expansions are equal within a given tolerance.

◆ Normalized()

template<typename _Scalar , typename _ONVBasis >
static LinearExpansion< Scalar, ONVBasis > GQCP::LinearExpansion< _Scalar, _ONVBasis >::Normalized ( const ONVBasis onv_basis,
const VectorX< Scalar > &  coefficients 
)
inlinestatic

Create a normalized linear expansion inside a given ONV basis with possibly non-normalized coefficients.

Parameters
onv_basisThe ONV basis with respect to which the coefficients are defined.
coefficientsthe expansion coefficients
Returns
A normalized LinearExpansion.

◆ onvBasis()

template<typename _Scalar , typename _ONVBasis >
const ONVBasis & GQCP::LinearExpansion< _Scalar, _ONVBasis >::onvBasis ( ) const
inline
Returns
The ONV basis that is related to this linear expansion wave function model.

◆ Random()

template<typename _Scalar , typename _ONVBasis >
static LinearExpansion< Scalar, ONVBasis > GQCP::LinearExpansion< _Scalar, _ONVBasis >::Random ( const ONVBasis onv_basis)
inlinestatic

Create a linear expansion with a random, normalized coefficient vector, with coefficients uniformly distributed in [-1, +1] before any normalization.

Parameters
onv_basisthe ONV basis with respect to which the coefficients are defined
Returns
A random LinearExpansion.

◆ tensorizeCoefficients()

template<typename _Scalar , typename _ONVBasis >
template<typename Z = ONVBasis>
enable_if_t< std::is_same< Z, SpinUnresolvedONVBasis >::value|std::is_same< Z, SpinResolvedONVBasis >::value, GQCP::Tensor< Scalar, 2 > > GQCP::LinearExpansion< _Scalar, _ONVBasis >::tensorizeCoefficients ( const std::vector< typename ONVBasis::ONV > &  system_onvs,
const std::vector< typename ONVBasis::ONV > &  environment_onvs 
) const
inline

MARK: Entropy Construct the linear expansion in tensor form.

Parameters
system_onvsA vector of all ONVs of the system that is obtained after splitting an ONV basis into two subsystems.
environment_onvsA vector of all ONVs of the environment that is obtained after splitting an ONV basis into two subsystems.
Returns
The expansion coefficients in tensor form.

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