Class containing utility functions for excites-states calculations such as (NDDO-)CIS or TD-DFT(B).This class contains static functions to calculate occupied-virtual energy difference vectors, generate excitation labels (occ -> vir) for restricted and unrestricted reference calculations.
More...
|
static Eigen::VectorXd | generateEnergyDifferenceVector (int nOccupiedOrbitals, int nVirtualOrbitals, const Utils::SingleParticleEnergies &energies) |
| Calculates the occupied->virtual energy difference vector. More...
|
|
template<Utils::Reference restrictedness> |
static std::vector< std::string > | generateExcitationsLabels (const Utils::SpinAdaptedContainer< restrictedness, std::vector< Utils::Excitation >> &excitations) |
| Function generating a vector of "occ->vir" excitation labels. More...
|
|
static std::vector< std::string > | generateExcitationsLabels (const std::vector< Utils::Excitation > &excitations, const Eigen::Matrix< bool,-1, 1 > &isBeta={}) |
| Function generating a vector of "occ->vir" excitation labels. More...
|
|
template<Utils::Reference restrictedness> |
static void | generateEnergyDifferenceVector (const Utils::SingleParticleEnergies &energies, const Utils::LcaoUtils::ElectronicOccupation &occupation, Utils::SpinAdaptedContainer< restrictedness, Eigen::VectorXd > &energyDifferenceVector) |
| Calculated the occupied->virtual energy difference vector. More...
|
|
static void | generateVirtualOrbitalIndices (const std::vector< int > &occupiedOrbitalsIndices, std::vector< int > &virtualOrbitalsIndices) |
| Fills a vector of virtual orbital indices having just size and occupied indices. More...
|
|
static std::vector
< Utils::Excitation > | generateExcitations (const std::vector< int > &occupiedOrbitalsIndices, const std::vector< int > &virtualOrbitalsIndices) |
| Given occupied and virtual orbital indices, generates a vector of occ->vir excitations. More...
|
|
template<Utils::Reference restrictedness> |
static
Utils::SpinAdaptedContainer
< restrictedness, std::vector
< Utils::Excitation > > | generateExcitations (const Utils::MolecularOrbitals &mos, const Utils::LcaoUtils::ElectronicOccupation &occupation) |
| Given occupied and virtual orbital indices, generates a vector of occ->vir excitations. More...
|
|
template<Utils::Reference restrictedness> |
static std::vector< int > | generateEnergyOrderMap (const Utils::SpinAdaptedContainer< restrictedness, Eigen::VectorXd > &energyDifferenceVector) |
| Generates a mapping from the "standard" excitation order to increasing energy order. More...
|
|
template<typename Derived , typename DerivedResult > |
static void | transformOrder (const Eigen::MatrixBase< Derived > &toTransform, const Eigen::MatrixBase< DerivedResult > &result, const std::vector< int > &orderVector, Direction direction) |
| Transforms a vector or matrix from one ordering to another, or back. More...
|
|
template<typename Type > |
static void | transformOrder (const std::vector< Type > &toTransform, std::vector< Type > &result, const std::vector< int > &orderVector, Direction direction) |
| Transforms a std::vector from one ordering to another, or back.
|
|
static auto | flatten (const Utils::SpinAdaptedContainer< Utils::Reference::Restricted, Eigen::VectorXd > &in) -> Eigen::VectorXd |
| Transforms the SpinAdaptedContainer to a Eigen::VectorXd by extracting its "restricted" member.
|
|
static auto | flatten (const Utils::SpinAdaptedContainer< Utils::Reference::Unrestricted, Eigen::VectorXd > &in) -> Eigen::VectorXd |
| Transforms the SpinAdaptedContainer to a Eigen::VectorXd by concatenating its "alpha" and "beta" member.
|
|
template<typename T > |
static auto | flatten (Utils::SpinAdaptedContainer< Utils::Reference::Restricted, std::vector< T >> in) -> std::vector< T > |
| Transforms the SpinAdaptedContainer to a std::vector<T> by extracting its "restricted" member.
|
|
template<typename T > |
static auto | flatten (Utils::SpinAdaptedContainer< Utils::Reference::Unrestricted, std::vector< T >> in) -> std::vector< T > |
| Transforms the SpinAdaptedContainer to a std::vector<T> by concatenating its "alpha" and "beta" member.
|
|
Class containing utility functions for excites-states calculations such as (NDDO-)CIS or TD-DFT(B).
This class contains static functions to calculate occupied-virtual energy difference vectors, generate excitation labels (occ -> vir) for restricted and unrestricted reference calculations.
template<Utils::Reference restrictedness>
static std::vector<int> Scine::Sparrow::TimeDependentUtils::generateEnergyOrderMap |
( |
const Utils::SpinAdaptedContainer< restrictedness, Eigen::VectorXd > & |
energyDifferenceVector | ) |
|
|
static |
Generates a mapping from the "standard" excitation order to increasing energy order.
- Returns
- A vector with the indices in the new order. For example, let's assume there is an orbital energy difference vector en with elements: en[0] = 3.5 en[1] = 2.2 en[2] = 6.4 en[3] = 1.0
then the resulting vector res will contain res[0] = 3 res[1] = 1 res[2] = 0 res[3] = 2
So, to map an arbitrary vector standardV FROM the "standard" order TO the increasing energy ordering in a resut vector increasingEnergyV:
for (int i = 0; i < res.size(); ++i) increasingEnergyV[i] = standardV[res[i]];
And, to map an arbitrary vector increasingEnergyV FROM the increasing energy order TO the "standard" ordering in a resut vector standardV:
for (int i = 0; i < res.size(); ++i) standardV[res[i]] = increasingEnergyV[i];
template<typename Derived , typename DerivedResult >
void Scine::Sparrow::TimeDependentUtils::transformOrder |
( |
const Eigen::MatrixBase< Derived > & |
toTransform, |
|
|
const Eigen::MatrixBase< DerivedResult > & |
result, |
|
|
const std::vector< int > & |
orderVector, |
|
|
Direction |
direction |
|
) |
| |
|
inlinestatic |
Transforms a vector or matrix from one ordering to another, or back.
- Parameters
-
toTransform | The vector or matrix whose rows to transform. |
orderVector | The vector with the ordering. For example, let's assume there is an orbital energy difference vector en with elements: en[0] = 3.5 en[1] = 2.2 en[2] = 6.4 en[3] = 1.0 |
then the resulting mapping vector res will contain res[0] = 3 res[1] = 1 res[2] = 0 res[3] = 2 This is also the vector returned by TimeDependentUtils::generateEnergyOrderMap()
- Parameters
-
direction | The direction of the transformation.
- Direction::To : transform a vector as implied by orderVector, i.e. in an the ordering according to energy difference, from the "standard" order to the order of increasing energy.
- Direction::From : The opposite direction of transformation.
|
- Returns
- A vector transformed into the new order defined in the argument.
So, to map an arbitrary vector standardV FROM the "standard" order TO the increasing energy ordering in a resut vector increasingEnergyV:
Eigen::VectorXd increasingEnergyV = transformOrder(standardV, orderVec, Direction::To); and to transform it back: Eigen::VectorXd standardV2 = transformOrder(increasingEnergyV, orderVec, Direction::From); Then standardV and standardV2 should be equal.