GQCP
|
#include <LinearExpansion.hpp>
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 ONVBasis & | onvBasis () 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, Scalar > | calculateNDMElement (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, Scalar > | calculateNDMElement (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, ONVBasis > | Constant (const ONVBasis &onv_basis) |
static LinearExpansion< Scalar, ONVBasis > | HartreeFock (const ONVBasis &onv_basis) |
static LinearExpansion< Scalar, ONVBasis > | Normalized (const ONVBasis &onv_basis, const VectorX< Scalar > &coefficients) |
static LinearExpansion< Scalar, ONVBasis > | Random (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) |
A class that represents a linear expansion inside an ONV basis.
_Scalar | The scalar type of the expansion coefficients: real or complex. |
_ONVBasis | The type of ONV basis. |
using GQCP::LinearExpansion< _Scalar, _ONVBasis >::ONVBasis = _ONVBasis |
using GQCP::LinearExpansion< _Scalar, _ONVBasis >::Scalar = _Scalar |
|
inline |
Construct a linear expansion inside the given ONV basis, with corresponding expansion coefficients.
onv_basis | The ONV basis with respect to which the coefficients are defined. |
coefficients | The expansion coefficients. |
|
default |
|
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.
T | The transformation between the old and the new restricted spin-orbital basis. |
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.
|
inline |
|
inline |
Calculate the one-electron density matrix for a full spin-resolved wave function expansion.
|
inline |
Calculate the orbital one-electron density matrix for a seniority-zero wave function expansion.
|
inline |
Calculate the one-electron density matrix for a spin-resolved selected wave function expansion.
|
inline |
Calculate the generalized (G) one-electron density matrix for a spin-unresolved selected wave function expansion.
|
inline |
Calculate the two-electron density matrix for a full spin-resolved wave function expansion.
|
inline |
Calculate the two-electron density matrix for a seniority-zero wave function expansion.
|
inline |
Calculate the two-electron density matrix for a spin-resolved selected wave function expansion.
|
inline |
Calculate the generalized (G) two-electron density matrix (1-DM) for a spin-unresolved selected wave function expansion.
|
inline |
Calculate an element of the N-electron density matrix.
bra_indices | The indices of the orbitals that should be annihilated on the left (on the bra). |
ket_indices | The indices of the orbitals that should be annihilated on the right (on the ket). |
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
.
|
inline |
Calculate an element of the N-electron density matrix.
bra_indices | The indices of the orbitals that should be annihilated on the left (on the bra). |
ket_indices | The indices of the orbitals that should be annihilated on the right (on the ket). |
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
.
|
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).
domain_partition | The partition of the orbitals in discrete domains. |
electron_partition | Electron occupation number in each discrete domain. |
|
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).
domain_partition | The partition of the orbitals in discrete domains. |
electron_partition | Electron occupation number in each discrete domain. |
|
inline |
|
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.
orbital_index | The index of the orbital for which the single orbital entropy needs to be calculated. |
|
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.
orbital_index | The index of the orbital for which the single orbital entropy needs to be calculated. |
|
inline |
Calculate the spin-resolved one-electron density matrix for a full spin-resolved wave function expansion.
|
inline |
Calculate the spin-resolved one-electron density matrix for a seniority-zero wave function expansion.
|
inline |
Calculate the spin-resolved one-electron density matrix for a spin-resolved selected wave function expansion.
|
inline |
Calculate the spin-resolved two-electron density matrix for a full spin-resolved wave function expansion.
|
inline |
Calculate the spin-resolved two-electron density matrix for a seniority-zero wave function expansion.
|
inline |
Calculate the spin-resolved two-electron density matrix for a spin-resolved selected wave function expansion.
|
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).
domain_partition | The (discrete) domain partition used to partition the spin-resolved ONVs in this LinearExpansion . |
|
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).
domain_partition | The (discrete) domain partition used to partition the spin-unresolved ONVs in this LinearExpansion . |
|
inline |
Access a coefficient of the linear expansion.
i | The index (address) of the coefficient that should be obtained. |
|
inline |
|
inlinestatic |
Create a linear expansion with a normalized coefficient vector (i.e. all the coefficients are equal).
onv_basis | The ONV basis with respect to which the coefficients are defined. |
|
inline |
Iterate over all expansion coefficients and corresponding ONVs, and apply the given callback function.
callback | The function to be applied in every iteration. Its arguments are an expansion coefficient and the corresponding ONV. |
|
inline |
Iterate over all expansion coefficients and corresponding ONVs, and apply the given callback function.
callback | The function to be applied in every iteration. Its arguments are an expansion coefficient and the corresponding ONV. |
|
inlinestatic |
Create a linear expansion by reading in a GAMESS-US file.
GAMESSUS_filename | The name of the GAMESS-US file that contains the spin-resolved selected wave function expansion. |
|
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.
onv | A spin-resolved ONV expressed with respect to an unrestricted spin-orbital basis. |
r_spinor_basis | The restricted spin-orbital basis that is used to define the resulting linear expansion of ONVs against. |
u_spinor_basis | The unrestricted spin-orbital basis against which the given ONV is expressed. |
|
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.
onv_of | A spin-unresolved ONV expressed with respect to a general spinor basis. |
spinor_basis_on | The general spinor basis that is used to define the resulting linear expansion of ONVs against. |
spinor_basis_of | The general spinor basis against which the given ONV is expressed. |
|
inlinestatic |
Create a linear expansion that represents the Hartree-Fock wave function.
onv_basis | The ONV basis with respect to which the coefficients are defined. |
|
inline |
other | The other linear expansion for the comparison. |
tolerance | The tolerance for the comparison of coefficients. |
|
inlinestatic |
Create a normalized linear expansion inside a given ONV basis with possibly non-normalized coefficients.
onv_basis | The ONV basis with respect to which the coefficients are defined. |
coefficients | the expansion coefficients |
|
inline |
|
inlinestatic |
Create a linear expansion with a random, normalized coefficient vector, with coefficients uniformly distributed in [-1, +1] before any normalization.
onv_basis | the ONV basis with respect to which the coefficients are defined |
|
inline |
MARK: Entropy Construct the linear expansion in tensor form.
system_onvs | A vector of all ONVs of the system that is obtained after splitting an ONV basis into two subsystems. |
environment_onvs | A vector of all ONVs of the environment that is obtained after splitting an ONV basis into two subsystems. |