57 double energy_difference)
const {
59 throw std::runtime_error(
60 "Checking degeneracy not implemented for open-shell systems.");
62 std::vector<Index> result;
63 if (level >
mos_.eigenvalues().size()) {
64 throw std::runtime_error(
65 "Level for degeneracy is higher than maximum level");
67 double MOEnergyLevel =
mos_.eigenvalues()(level);
69 for (
Index i = 0; i <
mos_.eigenvalues().size(); ++i) {
70 if (std::abs(
mos_.eigenvalues()(i) - MOEnergyLevel) < energy_difference) {
76 result.push_back(level);
83 throw std::runtime_error(
84 "MO sorting not implemented for open-shell systems.");
86 std::vector<Index> index = std::vector<Index>(
mos_.eigenvalues().size());
87 std::iota(index.begin(), index.end(), 0);
88 std::stable_sort(index.begin(), index.end(), [
this](
Index i1,
Index i2) {
89 return this->MOs().eigenvalues()[i1] < this->MOs().eigenvalues()[i2];
100 if (this->
QMAtoms().size() == 0) {
101 throw std::runtime_error(
"Can't setup AOBasis without atoms");
109 if (this->
QMAtoms().size() == 0) {
110 throw std::runtime_error(
"Can't setup Aux AOBasis without atoms");
113 bs.
Load(aux_basis_name);
124 throw std::runtime_error(
125 "DensityMatrixWithoutGS not implemented for open-shell systems "
126 "except ExcitonUKS.");
130 return DMAT[1] - DMAT[0];
141 throw std::runtime_error(
142 "DensityMatrixWithoutGS does not yet implement QMStateType:" +
161 result = result - DMAT[0] + DMAT[1];
182 " requires an openshell calculation");
185 throw std::runtime_error(
186 "DensityMatrixFull does not yet implement QMStateType:" +
222 return spin[0] + spin[1];
234 throw std::runtime_error(
235 "DensityMatrixKSstate not implemented for open-shell systems.");
238 throw std::runtime_error(
"Orbitals file does not contain MO coefficients");
242 throw std::runtime_error(
"State:" + state.
ToString() +
243 " is not a Kohn Sham state");
245 Eigen::VectorXd KSstate =
mos_.eigenvectors().col(state.
StateIdx());
246 Eigen::MatrixXd dmatKS = KSstate * KSstate.transpose();
252 throw std::runtime_error(
"Orbitals file does not contain QP coefficients");
268 throw std::runtime_error(
269 "DensityMatrixQuasiParticle not implemented for open-shell systems.");
272 throw std::runtime_error(
"State:" + state.
ToString() +
273 " is not a quasiparticle state");
289 Eigen::Vector3d nuclei_dip = Eigen::Vector3d::Zero();
292 nuclei_dip += (atom.getPos() -
atoms_.getPos()) * atom.getNuccharge();
301 Eigen::Vector3d electronic_dip;
302 for (
Index i = 0; i < 3; ++i) {
303 electronic_dip(i) = dmat.cwiseProduct(dipole.
Matrix()[i]).sum();
305 return nuclei_dip - electronic_dip;
320 throw std::runtime_error(
321 "ExcitonUKS transition density requested, but no unrestricted "
322 "orbitals are present.");
325 const Eigen::MatrixXd& BSECoefs =
BSE_uks_.eigenvectors();
326 if (BSECoefs.cols() < state.
StateIdx() + 1 || BSECoefs.rows() < 2) {
327 throw std::runtime_error(
328 "Orbitals object has no information about state:" + state.
ToString());
331 Eigen::VectorXd coeffs = BSECoefs.col(state.
StateIdx());
341 const Index alpha_size = alpha_vtotal * alpha_ctotal;
342 const Index beta_size = beta_vtotal * beta_ctotal;
344 if (coeffs.size() != alpha_size + beta_size) {
345 throw std::runtime_error(
346 "ExcitonUKS coefficient vector size does not match expected "
347 "alpha+beta BSE space dimensions.");
350 Eigen::MatrixXd tdm = Eigen::MatrixXd::Zero(
mos_.eigenvectors().rows(),
351 mos_.eigenvectors().rows());
353 if (alpha_size > 0) {
354 const Eigen::VectorXd coeffs_alpha = coeffs.head(alpha_size);
355 const auto occ_alpha =
357 const auto virt_alpha =
359 const Eigen::Map<const Eigen::MatrixXd> mat_alpha(
360 coeffs_alpha.data(), alpha_ctotal, alpha_vtotal);
362 tdm += occ_alpha * mat_alpha.transpose() * virt_alpha.transpose();
366 const Eigen::VectorXd coeffs_beta = coeffs.tail(beta_size);
367 const auto occ_beta =
369 const auto virt_beta =
371 const Eigen::Map<const Eigen::MatrixXd> mat_beta(
372 coeffs_beta.data(), beta_ctotal, beta_vtotal);
374 tdm += occ_beta * mat_beta.transpose() * virt_beta.transpose();
381 throw std::runtime_error(
382 "TransitionDensityMatrix not implemented for open-shell systems "
383 "except ExcitonUKS.");
386 throw std::runtime_error(
387 "Spin type not known for transition density matrix. Available only for "
390 const Eigen::MatrixXd& BSECoefs =
BSE_singlet_.eigenvectors();
391 if (BSECoefs.cols() < state.
StateIdx() + 1 || BSECoefs.rows() < 2) {
392 throw std::runtime_error(
"Orbitals object has no information about state:" +
396 Eigen::VectorXd coeffs = BSECoefs.col(state.
StateIdx());
401 coeffs *= std::sqrt(2.0);
404 Eigen::Map<const Eigen::MatrixXd> mat(coeffs.data(),
bse_ctotal_,
407 return occlevels * mat.transpose() * virtlevels.transpose();
418 throw std::runtime_error(
419 "ExcitonUKS excited-state density requested, but no unrestricted "
420 "orbitals are present.");
423 const Eigen::MatrixXd& X =
BSE_uks_.eigenvectors();
424 if (X.cols() < state.
StateIdx() + 1 || X.rows() < 2) {
425 throw std::runtime_error(
426 "Orbitals object has no information about state:" + state.
ToString());
434 const Index alpha_size = alpha_vtotal * alpha_ctotal;
435 const Index beta_size = beta_vtotal * beta_ctotal;
437 if (X.rows() != alpha_size + beta_size) {
438 throw std::runtime_error(
439 "ExcitonUKS coefficient vector size does not match expected "
440 "alpha+beta BSE space dimensions.");
443 const Index nao =
mos_.eigenvectors().rows();
444 std::array<Eigen::MatrixXd, 2> dmat;
445 dmat[0] = Eigen::MatrixXd::Zero(nao, nao);
446 dmat[1] = Eigen::MatrixXd::Zero(nao, nao);
448 auto add_resonant = [&](
const Eigen::VectorXd& coeffs,
bool alpha_spin) {
449 if (coeffs.size() == 0) {
453 const Index vtotal = alpha_spin ? alpha_vtotal : beta_vtotal;
454 const Index ctotal = alpha_spin ? alpha_ctotal : beta_ctotal;
456 const auto& mos_spin =
460 const auto occlevels = mos_spin.middleCols(
bse_vmin_, vtotal);
461 const auto virtlevels = mos_spin.middleCols(lumo, ctotal);
463 const Eigen::Map<const Eigen::MatrixXd> mat(coeffs.data(), ctotal,
466 dmat[0] += occlevels * (mat.transpose() * mat) * occlevels.transpose();
467 dmat[1] += virtlevels * (mat * mat.transpose()) * virtlevels.transpose();
470 auto subtract_antiresonant = [&](
const Eigen::VectorXd& coeffs,
472 if (coeffs.size() == 0) {
476 const Index vtotal = alpha_spin ? alpha_vtotal : beta_vtotal;
477 const Index ctotal = alpha_spin ? alpha_ctotal : beta_ctotal;
479 const auto& mos_spin =
483 const auto occlevels = mos_spin.middleCols(
bse_vmin_, vtotal);
484 const auto virtlevels = mos_spin.middleCols(lumo, ctotal);
486 const Eigen::Map<const Eigen::MatrixXd> mat(coeffs.data(), ctotal,
492 dmat[0] -= virtlevels * (mat * mat.transpose()) * virtlevels.transpose();
493 dmat[1] -= occlevels * (mat.transpose() * mat) * occlevels.transpose();
496 const Eigen::VectorXd Xstate = X.col(state.
StateIdx());
497 add_resonant(Xstate.head(alpha_size),
true);
498 add_resonant(Xstate.tail(beta_size),
false);
501 const Eigen::MatrixXd& Y =
BSE_uks_.eigenvectors2();
502 if (Y.cols() < state.
StateIdx() + 1 || Y.rows() != X.rows()) {
503 throw std::runtime_error(
504 "Orbitals object has inconsistent anti-resonant ExcitonUKS "
505 "coefficients for state:" +
509 const Eigen::VectorXd Ystate = Y.col(state.
StateIdx());
510 subtract_antiresonant(Ystate.head(alpha_size),
true);
511 subtract_antiresonant(Ystate.tail(beta_size),
false);
518 throw std::runtime_error(
519 "DensityMatrixExcitedState not implemented for open-shell systems "
520 "except ExcitonUKS.");
525 std::array<Eigen::MatrixXd, 2> dmat_AR =
527 dmat[0] -= dmat_AR[0];
528 dmat[1] -= dmat_AR[1];
538 throw std::runtime_error(
539 "Spin type not known for density matrix. Available are singlet and "
546 if (BSECoefs.cols() < state.
StateIdx() + 1 || BSECoefs.rows() < 2) {
547 throw std::runtime_error(
"Orbitals object has no information about state:" +
562 Eigen::VectorXd coeffs = BSECoefs.col(state.
StateIdx());
564 std::array<Eigen::MatrixXd, 2> dmatEX;
566 Eigen::MatrixXd occlevels =
568 dmatEX[0] = occlevels *
CalcAuxMat_vv(coeffs) * occlevels.transpose();
571 Eigen::MatrixXd virtlevels =
573 dmatEX[1] = virtlevels *
CalcAuxMat_cc(coeffs) * virtlevels.transpose();
579 const Eigen::Map<const Eigen::MatrixXd> mat(coeffs.data(),
bse_ctotal_,
581 return mat.transpose() * mat;
585 const Eigen::Map<const Eigen::MatrixXd> mat(coeffs.data(),
bse_ctotal_,
587 return mat * mat.transpose();
594 throw std::runtime_error(
595 "Spin type not known for density matrix. Available are singlet and "
602 if (BSECoefs_AR.cols() < state.
StateIdx() + 1 || BSECoefs_AR.rows() < 2) {
603 throw std::runtime_error(
"Orbitals object has no information about state:" +
629 Eigen::VectorXd coeffs = BSECoefs_AR.col(state.
StateIdx());
631 std::array<Eigen::MatrixXd, 2> dmatAR;
632 Eigen::MatrixXd virtlevels =
634 dmatAR[0] = virtlevels *
CalcAuxMat_cc(coeffs) * virtlevels.transpose();
636 Eigen::MatrixXd occlevels =
638 dmatAR[1] = occlevels *
CalcAuxMat_vv(coeffs) * occlevels.transpose();
656 throw std::runtime_error(
657 "Orbitals::Oscillatorstrengths only implemented for "
658 "restricted singlets and combined UKS excitons.");
666 Eigen::VectorXd oscs = Eigen::VectorXd::Zero(size);
667 for (
Index i = 0; i < size; ++i) {
689 throw std::runtime_error(
690 "Total Energy does not exist for transition state");
695 throw std::runtime_error(
"Orbitals::getTotalEnergy You want " +
697 " which has not been calculated");
702 throw std::runtime_error(
"Orbitals::getTotalEnergy You want " +
704 " which has not been calculated");
709 throw std::runtime_error(
"Orbitals::getTotalEnergy You want " +
711 " which has not been calculated");
716 throw std::runtime_error(
"Orbitals::getTotalEnergy You want " +
718 " which has not been calculated");
723 throw std::runtime_error(
"Orbitals::getTotalEnergy You want " +
725 " which has not been calculated");
730 throw std::runtime_error(
731 "Orbitals::getTotalEnergy You want " + state.
ToString() +
732 " which is a LMO for virtual orbitals. Not implemented.");
736 throw std::runtime_error(
737 "GetTotalEnergy only knows states:singlet,triplet,KS,DQP,PQP,LMOs");
743 const Eigen::MatrixXd& dft_orbitals =
mos_.eigenvectors();
747 dft_dipole.
Fill(basis);
750 std::array<Eigen::MatrixXd, 3> interlevel_dipoles;
754 for (
Index i = 0; i < 3; i++) {
755 interlevel_dipoles[i] = empty.transpose() * dft_dipole.
Matrix()[i] * occ;
757 return interlevel_dipoles;
769 std::array<Eigen::MatrixXd, 3> interlevel_dipoles =
775 const double sqrt2 = std::sqrt(2.0);
777 for (
Index i_exc = 0; i_exc < numofstates; ++i_exc) {
778 Eigen::VectorXd coeffs =
BSE_singlet_.eigenvectors().col(i_exc);
785 Eigen::Vector3d tdipole = Eigen::Vector3d::Zero();
786 for (
Index i = 0; i < 3; ++i) {
787 tdipole[i] = mat.cwiseProduct(interlevel_dipoles[i]).sum();
800 throw std::runtime_error(
801 "Orbitals::CalcCoupledTransition_Dipoles(ExcitonUKS) requires "
802 "unrestricted alpha/beta orbitals.");
810 const Index alpha_size = alpha_vtotal * alpha_ctotal;
814 const Index beta_size = beta_vtotal * beta_ctotal;
816 if (alpha_vtotal < 0 || alpha_ctotal < 0 || beta_vtotal < 0 ||
818 throw std::runtime_error(
819 "Orbitals::CalcCoupledTransition_Dipoles(ExcitonUKS): "
820 "invalid UKS BSE window.");
825 dft_dipole.
Fill(basis);
827 std::array<Eigen::MatrixXd, 3> interlevel_dipoles_alpha;
828 std::array<Eigen::MatrixXd, 3> interlevel_dipoles_beta;
830 const Eigen::MatrixXd virt_alpha =
831 mos_.eigenvectors().middleCols(alpha_homo + 1, alpha_ctotal);
832 const Eigen::MatrixXd occ_alpha =
835 const Eigen::MatrixXd virt_beta =
836 mos_beta_.eigenvectors().middleCols(beta_homo + 1, beta_ctotal);
837 const Eigen::MatrixXd occ_beta =
840 for (
Index i = 0; i < 3; ++i) {
841 interlevel_dipoles_alpha[i] =
842 virt_alpha.transpose() * dft_dipole.
Matrix()[i] * occ_alpha;
843 interlevel_dipoles_beta[i] =
844 virt_beta.transpose() * dft_dipole.
Matrix()[i] * occ_beta;
850 for (
Index i_exc = 0; i_exc < numofstates; ++i_exc) {
851 Eigen::VectorXd coeffs_x =
BSE_uks_.eigenvectors().col(i_exc);
852 Eigen::VectorXd coeffs = coeffs_x;
854 coeffs +=
BSE_uks_.eigenvectors2().col(i_exc);
857 if (coeffs.size() != alpha_size + beta_size) {
858 throw std::runtime_error(
859 "Orbitals::CalcCoupledTransition_Dipoles(ExcitonUKS): "
860 "exciton vector size does not match alpha+beta sector sizes.");
863 Eigen::Map<const Eigen::MatrixXd> mat_alpha(coeffs.data(), alpha_ctotal,
865 Eigen::Map<const Eigen::MatrixXd> mat_beta(coeffs.data() + alpha_size,
866 beta_ctotal, beta_vtotal);
868 Eigen::Vector3d tdipole = Eigen::Vector3d::Zero();
869 for (
Index i = 0; i < 3; ++i) {
870 tdipole[i] = mat_alpha.cwiseProduct(interlevel_dipoles_alpha[i]).sum() +
871 mat_beta.cwiseProduct(interlevel_dipoles_beta[i]).sum();
882 throw std::runtime_error(
883 "Orbitals::CalcCoupledTransition_Dipoles only implemented for "
884 "restricted singlets and combined UKS excitons.");
891 for (
Index i = 0; i < size; ++i) {
894 for (
Index i = 0; i < size; ++i) {
914 throw std::runtime_error(
915 "PrepareDimerGuess currently supports only restricted orbitals.");
919 throw std::runtime_error(
920 "PrepareDimerGuess currently supports only closed-shell singlets.");
932 mos_.eigenvectors() = Eigen::MatrixXd::Zero(basisA + basisB, basisA + basisB);
937 throw std::runtime_error(
"Basissets of Orbitals A and B differ " +
944 throw std::runtime_error(
"ECPs of Orbitals A and B differ " +
962 this->
MOs().
eigenvalues() = Eigen::VectorXd::Zero(basisA + basisB);
971 std::lock_guard<std::recursive_mutex> lock(
1011 atoms_.WriteToCpt(molgroup);
1041 w(tmp,
"use_Hqp_offdiag");
1064 std::lock_guard<std::recursive_mutex> lock(
1088 r(version,
"version");
1090 auto r_optional = [&r](
auto& obj,
const std::string& key) {
1093 }
catch (std::runtime_error&) {
1100 atoms_.ReadFromCpt(molgroup);
1107 }
catch (std::runtime_error&
e) {
1111 r(version,
"version");
1131 std::array<Index, 49> votcaOrder_old = {
1135 0, -1, 1, -2, 2, -3, 3,
1136 0, -1, 1, -2, 2, -3, 3, -4, 4,
1137 0, -1, 1, -2, 2, -3, 3, -4, 4,-5,5,
1138 0, -1, 1, -2, 2, -3, 3, -4, 4,-5,5,-6,6
1142 std::array<Index, 49> multiplier;
1150 std::string dft_basis_name;
1151 std::string aux_basis_name;
1152 r(dft_basis_name,
"dftbasis");
1153 r(aux_basis_name,
"auxbasis");
1168 }
catch (std::runtime_error&
e) {
1197 std::uint8_t tmp = 0;
1198 r(tmp,
"use_Hqp_offdiag");
1234 throw std::runtime_error(
"Orbitals file does not contain MO coefficients");
1237 std::array<Eigen::MatrixXd, 2> result;
1238 result[0] = Eigen::MatrixXd::Zero(
mos_.eigenvectors().rows(),
1239 mos_.eigenvectors().rows());
1240 result[1] = Eigen::MatrixXd::Zero(
mos_.eigenvectors().rows(),
1241 mos_.eigenvectors().rows());
1245 const Eigen::MatrixXd occ_a =
1247 result[0] = occ_a * occ_a.transpose();
1250 const Eigen::MatrixXd occ_b =
1252 result[1] = occ_b * occ_b.transpose();
1268 const Index n_docc = std::min(n_alpha, n_beta);
1269 const Index n_socc_alpha = n_alpha - n_docc;
1270 const Index n_socc_beta = n_beta - n_docc;
1273 const Eigen::MatrixXd docc =
mos_.eigenvectors().leftCols(n_docc);
1274 const Eigen::MatrixXd d_docc = docc * docc.transpose();
1275 result[0] += d_docc;
1276 result[1] += d_docc;
1279 if (n_socc_alpha > 0) {
1280 const Eigen::MatrixXd socc_a =
1281 mos_.eigenvectors().middleCols(n_docc, n_socc_alpha);
1282 result[0] += socc_a * socc_a.transpose();
1285 if (n_socc_beta > 0) {
1286 const Eigen::MatrixXd socc_b =
1287 mos_.eigenvectors().middleCols(n_docc + n_socc_alpha, n_socc_beta);
1288 result[1] += socc_b * socc_b.transpose();
Container to hold Basisfunctions for all atoms.
void setCenter(const Eigen::Vector3d &r)
const std::array< Eigen::MatrixXd, 3 > & Matrix() const
void Fill(const AOBasis &aobasis) final
void Load(const std::string &name)
CheckpointReader getReader()
CheckpointWriter getWriter()
CheckpointReader openChild(const std::string &childName) const
CheckpointWriter openChild(const std::string &childName) const
void reorderOrbitals(Eigen::MatrixXd &moCoefficients, const AOBasis &basis)
tools::EigenSystem QPdiag_alpha_
Index number_beta_electrons_
void CalcCoupledTransition_Dipoles()
Index getCharge() const
Return the stored total charge.
Eigen::MatrixXd occupations_
Eigen::VectorXd rpa_inputenergies_
Index getHomo() const
Return the default HOMO index used by spin-agnostic callers.
Eigen::VectorXd BSE_uks_energies_dynamic_
Eigen::MatrixXd TransitionDensityMatrix(const QMState &state) const
double getDFTTotalEnergy() const
Return the stored total DFT energy.
Index getSpin() const
Return the stored spin multiplicity.
Eigen::MatrixXd CalculateQParticleAORepresentation() const
Transform quasiparticle amplitudes into the AO representation.
std::array< Eigen::MatrixXd, 2 > DensityMatrixExcitedState_R(const QMState &state) const
bool hasUnrestrictedOrbitals() const
Report whether separate beta-spin orbitals are present.
Eigen::VectorXd lmos_energies_
tools::EigenSystem BSE_singlet_
tools::EigenSystem QPdiag_beta_
void PrepareDimerGuess(const Orbitals &orbitalsA, const Orbitals &orbitalsB)
Guess for a dimer based on monomer orbitals.
tools::EigenSystem mos_beta_
std::string grid_quality_
bool hasMOs() const
Report whether alpha/restricted molecular orbitals are available.
double getTotalStateEnergy(const QMState &state) const
Return the absolute total energy of the requested state in Hartree.
Eigen::VectorXd BSE_triplet_energies_dynamic_
void ReadBasisSetsFromCpt(CheckpointReader &r)
Deserialize attached AO basis sets from an already-open checkpoint reader.
std::array< Eigen::MatrixXd, 2 > DensityMatrixGroundStateSpinResolved() const
Eigen::MatrixXd QPpert_energies_beta_
void WriteBasisSetsToCpt(CheckpointWriter &w) const
std::vector< Index > CheckDegeneracy(Index level, double energy_difference) const
Eigen::MatrixXd inactivedensity_
std::string getCalculationType() const
Return the stored calculation-type tag.
std::array< Eigen::MatrixXd, 3 > CalcFreeTransition_Dipoles() const
Eigen::MatrixXd CalcAuxMat_cc(const Eigen::VectorXd &coeffs) const
Eigen::MatrixXd expandedMOs_
void setNumberOfAlphaElectrons(Index electrons)
Store the total number of alpha electrons.
Eigen::VectorXd Oscillatorstrengths() const
std::vector< Eigen::Vector3d > transition_dipoles_
static constexpr int orbitals_version()
std::string functionalname_
Eigen::MatrixXd DensityMatrixWithoutGS(const QMState &state) const
Eigen::MatrixXd DensityMatrixFull(const QMState &state) const
Eigen::MatrixXd CalcAuxMat_vv(const Eigen::VectorXd &coeffs) const
void SetupAuxBasis(std::string aux_basis_name)
Index getLumoAlpha() const
Return the alpha-spin LUMO index inferred from the stored electron counts.
void setNumberOfBetaElectrons(Index electrons)
Store the total number of beta electrons.
tools::EigenSystem BSE_triplet_
void setBSEindices(Index vmin, Index cmax)
const Eigen::MatrixXd & getInactiveDensity() const
Return the inactive-region density matrix used in embedding workflows.
std::vector< Index > SortEnergies()
Index getHomoBeta() const
Return the beta-spin HOMO index.
std::array< Eigen::MatrixXd, 2 > DensityMatrixExcitedState_AR(const QMState &state) const
double getExcitedStateEnergy(const QMState &state) const
Return the excitation energy of the requested state in Hartree.
void setECPName(const std::string &ECP)
Store the effective core potential label.
void setNumberOfOccupiedLevels(Index occupied_levels)
Index occupied_levels_beta_
Orbitals()
Construct an empty orbital container with default metadata.
tools::EigenSystem QPdiag_
Eigen::VectorXd rpa_inputenergies_beta_
Eigen::MatrixXd DensityMatrixKSstate(const QMState &state) const
Build the AO density matrix for a single KS orbital state.
Eigen::MatrixXd DensityMatrixQuasiParticle(const QMState &state) const
Build the AO density matrix for a quasiparticle state.
Index getBasisSetSize() const
Return the number of AO basis functions in the DFT basis.
Eigen::MatrixXd QPpert_energies_alpha_
Eigen::VectorXd BSE_singlet_energies_dynamic_
Index getGWAmin() const
Return the lower GW orbital index.
const tools::EigenSystem & MOs() const
Return read-only access to alpha/restricted molecular orbitals.
Eigen::MatrixXd DensityMatrixGroundState() const
Build the ground-state AO density matrix from the stored orbitals.
Index getLumoBeta() const
const QMMolecule & QMAtoms() const
Return read-only access to the molecular geometry.
tools::EigenSystem mos_embedding_
Eigen::VectorXd rpa_inputenergies_alpha_
void ReadFromCpt(const std::string &filename)
Read the orbital container from a checkpoint file on disk.
tools::EigenSystem BSE_uks_
void setNumberOfOccupiedLevelsBeta(Index occupied_levels_beta)
Store the number of occupied beta-spin orbitals.
void setChargeAndSpin(Index charge, Index spin)
Eigen::VectorXd QPpert_energies_
void WriteToCpt(const std::string &filename) const
Write the orbital container to a checkpoint file on disk.
const std::string & getECPName() const
Return the effective core potential label.
const std::string & getDFTbasisName() const
Return the DFT basis-set name.
void SetupDftBasis(std::string basis_name)
Build and attach the DFT AO basis from the stored molecular geometry.
std::array< Eigen::MatrixXd, 2 > DensityMatrixExcitedState(const QMState &state) const
Build separate hole and electron AO densities for an excited state.
Index number_alpha_electrons_
Eigen::Vector3d CalcElDipole(const QMState &state) const
Compute the electronic dipole moment associated with a state density.
Index getHomoAlpha() const
Return the alpha-spin HOMO index.
const AOBasis & getDftBasis() const
Return the DFT AO basis, throwing if it has not been initialized.
Index getLumo() const
Return the default LUMO index used by spin-agnostic callers.
std::string ToLongString() const
Identifier for QMstates. Strings like S1 are converted into enum +zero indexed int.
std::string ToString() const
bool isTransition() const
const QMStateType & Type() const
std::recursive_mutex & Hdf5Mutex()
Charge transport classes.
Provides a means for comparing floating point numbers.