36 <<
"Using overlap filter with no threshold " << std::flush;
39 <<
"Using overlap filter with threshold " <<
threshold_ << std::flush;
54 Eigen::VectorXd overlap = Eigen::VectorXd::Zero(coeffs.cols());
55#pragma omp parallel for schedule(dynamic)
56 for (
Index i = 0; i < coeffs.cols(); i++) {
58 Eigen::VectorXd state = coeffs.col(i).head(basis * basis);
59 Eigen::Map<const Eigen::MatrixXd> mat(state.data(), basis, basis);
61 Eigen::Map<const Eigen::MatrixXd> lastmat(laststate.data(), basis,
64 overlap(i) = (mat * S_ao.
Matrix() * lastmat.transpose())
65 .cwiseProduct(S_ao.
Matrix())
69 Eigen::VectorXd state = coeffs.col(i).tail(basis * basis);
70 Eigen::Map<const Eigen::MatrixXd> mat(state.data(), basis, basis);
72 Eigen::Map<const Eigen::MatrixXd> lastmat(laststate.data(), basis,
75 overlap(i) -= (mat * S_ao.
Matrix() * lastmat.transpose())
76 .cwiseProduct(S_ao.
Matrix())
80 return overlap.cwiseAbs();
86 Eigen::MatrixXd coeffs;
92 Index bse_vtotal = bse_vmax - bse_vmin + 1;
93 Index bse_ctotal = bse_cmax - bse_cmin + 1;
95 Index bse_size_ao = basis * basis;
96 auto occlevels = orb.
MOs().
eigenvectors().middleCols(bse_vmin, bse_vtotal);
97 auto virtlevels = orb.
MOs().
eigenvectors().middleCols(bse_cmin, bse_ctotal);
100 coeffs.resize(bse_size_ao, nostates);
102 coeffs.resize(2 * bse_size_ao, nostates);
104#pragma omp parallel for schedule(dynamic)
105 for (
Index i = 0; i < nostates; i++) {
107 Eigen::VectorXd exciton;
113 Eigen::Map<const Eigen::MatrixXd> mat(exciton.data(), bse_ctotal,
115 const Eigen::MatrixXd aomatrix =
116 occlevels * mat.transpose() * virtlevels.transpose();
117 coeffs.col(i).head(bse_size_ao) =
118 Eigen::Map<const Eigen::VectorXd>(aomatrix.data(), bse_size_ao);
121 Eigen::VectorXd exciton;
127 Eigen::Map<const Eigen::MatrixXd> mat(exciton.data(), bse_ctotal,
129 const Eigen::MatrixXd aomatrix =
130 occlevels * mat.transpose() * virtlevels.transpose();
131 coeffs.col(i).tail(bse_size_ao) =
132 Eigen::Map<const Eigen::VectorXd>(aomatrix.data(), bse_size_ao);
140 Eigen::MatrixXd coeffs;
void Fill(const AOBasis &aobasis) final
const Eigen::MatrixXd & Matrix() const
Logger is used for thread-safe output of messages.
container for molecular orbitals
const tools::EigenSystem & BSETriplets() const
Eigen::MatrixXd CalculateQParticleAORepresentation() const
const tools::EigenSystem & BSESinglets() const
bool getTDAApprox() const
Index getBasisSetSize() const
const tools::EigenSystem & MOs() const
Index NumberofStates(QMStateType type) const
const AOBasis & getDftBasis() const
void WriteToCpt(CheckpointWriter &w) final
void UpdateHist(const Orbitals &orb, QMState state) final
void ReadFromCpt(CheckpointReader &r) final
Eigen::MatrixXd CalcExcitonAORepresentation(const Orbitals &orb, QMStateType type) const
void Initialize(const tools::Property &options) final
void Info(Logger &log) const final
Eigen::VectorXd CalculateOverlap(const Orbitals &orb, QMStateType type) const
Eigen::VectorXd laststatecoeff_
std::vector< Index > CalcIndeces(const Orbitals &orb, QMStateType type) const final
Eigen::MatrixXd CalcAOCoeffs(const Orbitals &orb, QMStateType type) const
bool isSingleParticleState() const
Identifier for QMstates. Strings like S1 are converted into enum +zero indexed int.
const QMStateType & Type() const
std::vector< Index > ReduceAndSortIndecesUp(const Eigen::VectorXd &overlap, Index offset, double threshold) const
#define XTP_LOG(level, log)
base class for all analysis tools