votca 2026-dev
Loading...
Searching...
No Matches
dftengine.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2023 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_DFTENGINE_H
22#define VOTCA_XTP_DFTENGINE_H
23
24// Standard includes
25#include <map>
26
27// VOTCA includes
29
30// Local VOTCA includes
31#include "ERIs.h"
32#include "convergenceacc.h"
33#include "dfttimings.h"
34#include "hirshfeldpartition.h"
35#include "uks_convergenceacc.h"
36
37#include "ecpaobasis.h"
38#include "extended_hueckel.h"
39#include "logger.h"
40#include "qmmolecule.h"
41#include "staticsite.h"
42#include "vxc_grid.h"
43#include "vxc_potential.h"
44
45namespace votca {
46namespace xtp {
47class Orbitals;
56 std::string eris_key;
57 bool has_eris = false;
59 std::string ewald_key;
60 Eigen::MatrixXd ewald_matrix;
61 // AO potential of the permanent moments of the external sites; the induced
62 // dipoles change between QM/MM iterations and are integrated every run.
63 std::string multipole_key;
64 Eigen::MatrixXd multipole_sites; // one row per site: pos, rank, Q
65 Eigen::MatrixXd multipole_matrix;
66};
67
68class DFTEngineTestAccess;
69
77
87
88class DFTEngine {
89 public:
91 void Initialize(tools::Property& options);
92
94 void setLogger(Logger* pLog) { pLog_ = pLog; }
95
99 std::vector<std::unique_ptr<StaticSite> >* externalsites) {
100 externalsites_ = externalsites;
101 }
102
103 void setEwaldgrid(const Vxc_Grid& ewaldgrid) {
104 external_ewaldgrid_ = ewaldgrid;
105 has_ewaldgrid_ = true;
106 }
107
108 // The nuclei's share of the external Ewald potential, sum_A Z_A
109 // phi(R_A). Added to E0 alongside the grid's contribution to H0 -- the
110 // grid integrates against the DENSITY and so reaches the electrons
111 // only, exactly as IntegrateExternalMultipoles pairs its AO matrix with
112 // ExternalRepulsion for the multipole route.
113 void setEwaldNuclearEnergy(double energy) { ewald_nuclear_energy_ = energy; }
114
119 void setWarmStart(bool warm_start) { warm_start_ = warm_start; }
120
124 void setSetupCache(DFTSetupCache* cache) { setup_cache_ = cache; }
125
128 void setSCFToleranceFloor(double energy, double error);
129 void ReturnSetupCache();
130
133 bool Evaluate(Orbitals& orb);
134
151 bool RunCDFT(Orbitals& orb, HirshfeldPartition::Constraint& constraint);
152
159
161 std::string getDFTBasisName() const { return dftbasis_name_; };
162
173 std::vector<Eigen::MatrixXd> StaticResponse(
174 const Orbitals& orb, const std::vector<Eigen::MatrixXd>& perturbations,
175 double tolerance = 1e-7, Index max_iterations = 100);
176
178 const std::string& getGridName() const { return grid_name_; }
179
186 void setExternalPotentialMatrix(const Eigen::MatrixXd& v) {
188 }
189
192 std::vector<HirshfeldPartition::AtomicReference> HirshfeldReferences(
193 const QMMolecule& mol) const;
196 struct SpinDensity {
197 Eigen::MatrixXd alpha;
198 Eigen::MatrixXd beta;
199
201 Eigen::MatrixXd total() const { return alpha + beta; }
202
204 Eigen::MatrixXd spin() const { return alpha - beta; }
205 };
206
212
218
222
226
227 // development path RKS vs UKS
228 void setForceUKSPath(bool force) { force_uks_path_ = force; }
229
230 private:
232
235 void Prepare(Orbitals& orb, Index numofelectrons = -1);
236
240
246 const Eigen::MatrixXd& H0, const Vxc_Potential<Vxc_Grid>& vxcpotential,
247 const Eigen::MatrixXd& alpha_new, const Eigen::MatrixXd& beta_new);
248 Eigen::MatrixXd RKSOrbitalHessian(const Vxc_Potential<Vxc_Grid>& vxc,
249 const tools::EigenSystem& mos,
250 const Eigen::MatrixXd& F,
251 const Eigen::MatrixXd& X);
252 Eigen::MatrixXd UKSOrbitalHessian(const Vxc_Potential<Vxc_Grid>& vxc,
253 const tools::EigenSystem& mos_alpha,
254 const tools::EigenSystem& mos_beta,
255 const Eigen::MatrixXd& F_alpha,
256 const Eigen::MatrixXd& F_beta,
257 const Eigen::MatrixXd& X);
258
259 std::vector<Eigen::MatrixXd> CoupledResponse(
260 const Vxc_Potential<Vxc_Grid>& vxc, const Eigen::MatrixXd& P0,
261 const Eigen::MatrixXd& C_occ, const Eigen::MatrixXd& C_virt,
262 const std::vector<Eigen::MatrixXd>& U);
263
265 Eigen::MatrixXd OrthogonalizeGuess(const Eigen::MatrixXd& GuessMOs) const;
267 void PrintMOs(const Eigen::VectorXd& MOEnergies, Log::Level level);
269 void PrintMOsUKS(const Eigen::VectorXd& alpha_energies,
270 const Eigen::VectorXd& beta_energies,
271 Log::Level level) const;
273 void CalcElDipole(const Orbitals& orb) const;
274
277 std::array<Eigen::MatrixXd, 2> CalcERIs_EXX(const Eigen::MatrixXd& MOCoeff,
278 const Eigen::MatrixXd& Dmat,
279 double error) const;
280
282 Eigen::MatrixXd CalcERIs(const Eigen::MatrixXd& Dmat, double error) const;
283
287
289 bool EvaluateAndTime(Orbitals& orb);
291 void ReportDimensionsAndMemory() const;
292
294 void ConfigOrbfile(Orbitals& orb);
299 Eigen::MatrixXd McWeenyPurification(Eigen::MatrixXd& Dmat_in,
300 AOOverlap& overlap);
301
303 Mat_p_Energy SetupH0(const QMMolecule& mol) const;
307 const QMMolecule& mol,
308 const std::vector<std::unique_ptr<StaticSite> >& multipoles) const;
312 const Orbitals& extdensity) const;
314 Eigen::MatrixXd IntegrateExternalField(const QMMolecule& mol) const;
315
321 const Mat_p_Energy& H0, const QMMolecule& mol,
322 const Vxc_Potential<Vxc_Grid>& vxcpotential) const;
323
325 Eigen::MatrixXd AtomicGuess(const QMMolecule& mol) const;
326
328 Eigen::VectorXd BuildEHTOrbitalEnergies(const QMMolecule& mol) const;
330 Eigen::MatrixXd BuildEHTHamiltonian(const QMMolecule& mol) const;
337 const Mat_p_Energy& H0, const QMMolecule& mol,
338 const Vxc_Potential<Vxc_Grid>& vxcpotential) const;
339
350
363 Eigen::MatrixXd RunAtomicDFT_unrestricted(
364 const QMAtom& uniqueAtom, bool use_hunds_rule_occupation = false) const;
365
372 std::map<std::string, Eigen::MatrixXd> ComputeHirshfeldReferenceDensities(
373 const QMMolecule& mol) const;
374
380 std::vector<Index> atom_indices;
381 // Charge relative to the neutral fragment (sum of its nuclear charges);
382 // +1.0 means one electron removed. BuildCDFTConstraint converts it to an
383 // absolute electron count (CP2K's TARGET convention).
384 double target_charge = 0.0;
385 double initial_lambda = 0.0;
386 // "warmstart" (default) or "fresh", see dftpackage.xml. Kept as a string
387 // so that invalid values are rejected by the XML choices validation.
388 std::string guess_strategy = "warmstart";
389 };
390
397 const QMMolecule& mol, const CDFTConstraintSpec& spec) const;
398
400 double NuclearRepulsion(const QMMolecule& mol) const;
403 double ExternalRepulsion(
404 const QMMolecule& mol,
405 const std::vector<std::unique_ptr<StaticSite> >& multipoles) const;
408 Eigen::MatrixXd SphericalAverageShells(const Eigen::MatrixXd& dmat,
409 const AOBasis& dftbasis) const;
410
413 void TruncateBasis(Orbitals& orb, std::vector<Index>& activeatoms,
414 Mat_p_Energy& H0,
415 Eigen::MatrixXd InitialActiveDensityMatrix,
416 Eigen::MatrixXd v_embedding,
417 Eigen::MatrixXd InitialInactiveMOs);
418
421 void TruncMOsFullBasis(Orbitals& orb, std::vector<Index> activeatoms,
422 std::vector<Index> numfuncpatom);
425 Eigen::MatrixXd InsertZeroCols(Eigen::MatrixXd MOsMatrix, Index startidx,
426 Index numofzerocols);
428 Eigen::MatrixXd InsertZeroRows(Eigen::MatrixXd MOsMatrix, Index startidx,
429 Index numofzerorows);
430
432 bool EvaluateClosedShell(Orbitals& orb, const Mat_p_Energy& H0,
433 const Vxc_Potential<Vxc_Grid>& vxcpotential);
434
437 bool EvaluateUKS(Orbitals& orb, const Mat_p_Energy& H0,
438 const Vxc_Potential<Vxc_Grid>& vxcpotential);
439
462 void ComputeAndStoreForces(Orbitals& orb, const Eigen::MatrixXd& Dmat,
463 const Vxc_Potential<Vxc_Grid>& vxcpotential) const;
464
471 Eigen::MatrixXd ComputeOverlapPulayGradientUKS(
472 const QMMolecule& mol, const tools::EigenSystem& MOs_alpha,
473 const tools::EigenSystem& MOs_beta) const;
474
478 Eigen::MatrixXd ComputeNonXCGradientUKS(
479 const QMMolecule& mol, const UKSConvergenceAcc::SpinDensity& Dspin,
480 const tools::EigenSystem& MOs_alpha,
481 const tools::EigenSystem& MOs_beta) const;
482
496 Orbitals& orb, const UKSConvergenceAcc::SpinDensity& Dspin,
497 const tools::EigenSystem& MOs_alpha, const tools::EigenSystem& MOs_beta,
498 const Vxc_Potential<Vxc_Grid>& vxcpotential) const;
499
501
502 // basis sets
503 std::string auxbasis_name_;
504 std::string dftbasis_name_;
505 std::string ecp_name_;
509
511 // Pre-screening
513 // Eigenvalues of the AO overlap below this are removed from S^-1/2
514 // (xtpdft.overlap_tolerance).
516 // Shell pairs whose RI three-centre integrals are bounded by less than this
517 // are not stored (xtpdft.ri_pair_threshold).
518 double ri_pair_threshold_ = 1e-10;
519
520 // numerical integration Vxc
521 std::string grid_name_;
522
523 // AO Matrices
525
526 std::string initial_guess_;
527
528 // Only used if initial_guess_ == "dimer_guess", see
529 // BuildDimerGuessFromMonomerFiles.
532
533 // Convergence
537 // DIIS variables
539 // Electron repulsion integrals
541 // Wall-clock accounting, reported at the end of Evaluate()
543 bool warm_start_ = false;
544 bool warm_started_ = false;
546 std::string eris_key_; // key of the RI integrals in ERIs_
549 std::string RISetupKey() const;
552 bool UsableAsWarmStart(const Orbitals& orb, const std::string& previous_basis,
553 std::string& reason) const;
554
555 // external charges
556 std::vector<std::unique_ptr<StaticSite> >* externalsites_ = nullptr;
557
558 // exchange and correlation
559 double ScaHFX_ = 0.0;
561
563 // integrate external density
564 std::string orbfilename_;
565 std::string gridquality_;
566 std::string state_;
567
569 QMMolecule("molecule made of atoms participating in Active region", 1);
570
571 Eigen::Vector3d extfield_ = Eigen::Vector3d::Zero();
573 // xtpdft.polarizability: static polarizability after the SCF
575 Eigen::MatrixXd ext_potential_matrix_;
576
580
581 // truncation
582 Eigen::MatrixXd H0_trunc_;
584 Eigen::MatrixXd v_embedding_trunc_;
588 double E_nuc_;
590 std::vector<Index> active_and_border_atoms_;
591 std::vector<Index> numfuncpatom_;
592
593 // QMEwald
595 bool has_ewaldgrid_ = false;
597 // Spin-DFT Extension
604 bool force_uks_path_ = false;
605 // xtpdft.compute_forces: compute the nuclear gradient after the SCF.
606 // Off by default because of its cost (one-electron and overlap
607 // derivatives, RI-J, XC and, for hybrids, RI-K gradients).
608 bool compute_forces_ = false;
609
610 // CDFT constraints added to the UKS Fock matrix; empty (no-op) for
611 // ordinary runs. Set by RunCDFT, which updates each lambda between
612 // warm-started EvaluateUKS calls.
613 std::vector<HirshfeldPartition::Constraint> constraints_;
614
615 // CDFT outer-loop control, used only by RunCDFT. Read from
616 // cdft.max_iterations/cdft.population_tolerance in Initialize() if
617 // cdft.enabled; the defaults apply when RunCDFT is called directly.
620
621 bool cdft_enabled_ = false;
623};
624
625} // namespace xtp
626} // namespace votca
627
628#endif // VOTCA_XTP_DFTENGINE_H
class to manage program options with xml serialization functionality
Definition property.h:55
Container to hold Basisfunctions for all atoms.
Definition aobasis.h:42
Electronic ground-state via Density-Functional Theory.
Definition dftengine.h:88
Eigen::MatrixXd CalcERIs(const Eigen::MatrixXd &Dmat, double error) const
Build the Coulomb matrix contribution from the current density matrix.
Definition dftengine.cc:730
void setWarmStart(bool warm_start)
Definition dftengine.h:119
Eigen::MatrixXd ComputeOverlapPulayGradientUKS(const QMMolecule &mol, const tools::EigenSystem &MOs_alpha, const tools::EigenSystem &MOs_beta) const
Definition dftengine.cc:541
void setExternalcharges(std::vector< std::unique_ptr< StaticSite > > *externalsites)
Definition dftengine.h:98
bool EvaluateTruncatedActiveRegion(Orbitals &trunc_orb)
std::string auxbasis_name_
Definition dftengine.h:503
std::string getDFTBasisName() const
Return the configured AO basis-set name for the DFT calculation.
Definition dftengine.h:161
std::string gridquality_
Definition dftengine.h:565
tools::EigenSystem ModelPotentialGuess(const Mat_p_Energy &H0, const QMMolecule &mol, const Vxc_Potential< Vxc_Grid > &vxcpotential) const
Definition dftengine.cc:787
Mat_p_Energy IntegrateExternalMultipoles(const QMMolecule &mol, const std::vector< std::unique_ptr< StaticSite > > &multipoles) const
void setEwaldgrid(const Vxc_Grid &ewaldgrid)
Definition dftengine.h:103
friend class DFTEngineTestAccess
Definition dftengine.h:231
tools::EigenSystem IndependentElectronGuess(const Mat_p_Energy &H0) const
Generate an initial guess by diagonalizing the core Hamiltonian only.
Definition dftengine.cc:776
void setSCFToleranceFloor(double energy, double error)
Eigen::MatrixXd InitialActiveDmat_trunc_
Definition dftengine.h:583
std::string eris_key_
Definition dftengine.h:546
void TruncMOsFullBasis(Orbitals &orb, std::vector< Index > activeatoms, std::vector< Index > numfuncpatom)
Orbitals BuildDimerGuessFromMonomerFiles(const QMMolecule &dimer_mol) const
void ComputePolarizability(Orbitals &orb)
Definition dftengine.cc:835
double cdft_population_tolerance_
Definition dftengine.h:619
Eigen::MatrixXd ext_potential_matrix_
Definition dftengine.h:575
void ComputeAndStoreForces(Orbitals &orb, const Eigen::MatrixXd &Dmat, const Vxc_Potential< Vxc_Grid > &vxcpotential) const
Definition dftengine.cc:388
bool EvaluateClosedShell(Orbitals &orb, const Mat_p_Energy &H0, const Vxc_Potential< Vxc_Grid > &vxcpotential)
Run the restricted closed-shell SCF loop and store the converged result.
void setLogger(Logger *pLog)
Attach the logger used for SCF progress and diagnostics.
Definition dftengine.h:94
void TruncateBasis(Orbitals &orb, std::vector< Index > &activeatoms, Mat_p_Energy &H0, Eigen::MatrixXd InitialActiveDensityMatrix, Eigen::MatrixXd v_embedding, Eigen::MatrixXd InitialInactiveMOs)
void PrintMOsUKS(const Eigen::VectorXd &alpha_energies, const Eigen::VectorXd &beta_energies, Log::Level level) const
Print separate alpha and beta orbital energies for a UKS calculation.
Definition dftengine.cc:304
void ReportDimensionsAndMemory() const
Basis dimensions and the memory of the large intermediates.
Definition dftengine.cc:741
std::string dftbasis_name_
Definition dftengine.h:504
DFTSetupCache * setup_cache_
Definition dftengine.h:545
bool EvaluateUKS(Orbitals &orb, const Mat_p_Energy &H0, const Vxc_Potential< Vxc_Grid > &vxcpotential)
Eigen::MatrixXd RunAtomicDFT_unrestricted(const QMAtom &uniqueAtom, bool use_hunds_rule_occupation=false) const
Mat_p_Energy IntegrateExternalDensity(const QMMolecule &mol, const Orbitals &extdensity) const
std::string ecp_name_
Definition dftengine.h:505
std::string grid_name_
Definition dftengine.h:521
bool EvaluateActiveRegion(Orbitals &orb)
void Prepare(Orbitals &orb, Index numofelectrons=-1)
Vxc_Grid external_ewaldgrid_
Definition dftengine.h:594
std::string initial_guess_
Definition dftengine.h:526
std::string orbfilename_
Definition dftengine.h:564
UKSConvergenceAcc::SpinFock BuildUKSFock(const Eigen::MatrixXd &H0, const Vxc_Potential< Vxc_Grid > &vxcpotential, const Eigen::MatrixXd &alpha_new, const Eigen::MatrixXd &beta_new)
Eigen::MatrixXd AtomicGuess(const QMMolecule &mol) const
Build an atomic-density based initial guess in the AO basis.
bool EvaluateAndTime(Orbitals &orb)
Evaluate() without the timing report.
Definition dftengine.cc:867
std::vector< HirshfeldPartition::AtomicReference > HirshfeldReferences(const QMMolecule &mol) const
Eigen::MatrixXd InsertZeroRows(Eigen::MatrixXd MOsMatrix, Index startidx, Index numofzerorows)
Insert zero rows into an MO coefficient matrix at the requested position.
Eigen::MatrixXd BuildEHTHamiltonian(const QMMolecule &mol) const
Build the extended-Hückel Hamiltonian for the current molecule.
Eigen::MatrixXd IntegrateExternalField(const QMMolecule &mol) const
Integrate a homogeneous external electric field into the AO basis.
std::vector< Eigen::MatrixXd > CoupledResponse(const Vxc_Potential< Vxc_Grid > &vxc, const Eigen::MatrixXd &P0, const Eigen::MatrixXd &C_occ, const Eigen::MatrixXd &C_virt, const std::vector< Eigen::MatrixXd > &U)
void setExternalPotentialMatrix(const Eigen::MatrixXd &v)
Definition dftengine.h:186
Eigen::Vector3d extfield_
Definition dftengine.h:571
std::array< Eigen::MatrixXd, 2 > CalcERIs_EXX(const Eigen::MatrixXd &MOCoeff, const Eigen::MatrixXd &Dmat, double error) const
Definition dftengine.cc:704
Eigen::MatrixXd UKSOrbitalHessian(const Vxc_Potential< Vxc_Grid > &vxc, const tools::EigenSystem &mos_alpha, const tools::EigenSystem &mos_beta, const Eigen::MatrixXd &F_alpha, const Eigen::MatrixXd &F_beta, const Eigen::MatrixXd &X)
Eigen::MatrixXd H0_trunc_
Definition dftengine.h:582
Index NumberOfRestrictedOccupiedOrbitals() const
Definition dftengine.h:215
HirshfeldPartition::Constraint BuildCDFTConstraint(const QMMolecule &mol, const CDFTConstraintSpec &spec) const
void Initialize(tools::Property &options)
Read DFT, grid, and SCF settings from the user options tree.
Definition dftengine.cc:99
const std::string & getGridName() const
Name of the integration grid of the SCF (xtpdft.integration_grid).
Definition dftengine.h:178
std::string xc_functional_name_
Definition dftengine.h:560
void CalcElDipole(const Orbitals &orb) const
Evaluate and print the electronic dipole moment from the final density.
Definition dftengine.cc:364
double ExternalRepulsion(const QMMolecule &mol, const std::vector< std::unique_ptr< StaticSite > > &multipoles) const
ConvergenceAcc::options conv_opt_
Definition dftengine.h:536
void SetupInvariantMatrices()
Precompute AO matrices that remain unchanged throughout the SCF procedure.
tools::EigenSystem ExtendedHuckelDFTGuess(const Mat_p_Energy &H0, const QMMolecule &mol, const Vxc_Potential< Vxc_Grid > &vxcpotential) const
std::map< std::string, Eigen::MatrixXd > ComputeHirshfeldReferenceDensities(const QMMolecule &mol) const
std::string active_atoms_as_string_
Definition dftengine.h:577
void ComputeAndStoreForcesUKS(Orbitals &orb, const UKSConvergenceAcc::SpinDensity &Dspin, const tools::EigenSystem &MOs_alpha, const tools::EigenSystem &MOs_beta, const Vxc_Potential< Vxc_Grid > &vxcpotential) const
Definition dftengine.cc:617
void ConfigOrbfile(Orbitals &orb)
Propagate basis-set, XC, and metadata settings into the orbital container.
Eigen::VectorXd BuildEHTOrbitalEnergies(const QMMolecule &mol) const
Build orbital energies used in the extended-Hückel starting guess.
std::vector< Eigen::MatrixXd > StaticResponse(const Orbitals &orb, const std::vector< Eigen::MatrixXd > &perturbations, double tolerance=1e-7, Index max_iterations=100)
std::vector< HirshfeldPartition::Constraint > constraints_
Definition dftengine.h:613
QMMolecule activemol_
Definition dftengine.h:568
bool UsableAsWarmStart(const Orbitals &orb, const std::string &previous_basis, std::string &reason) const
Definition dftengine.cc:987
void PrintMOs(const Eigen::VectorXd &MOEnergies, Log::Level level)
Print a one-spin list of orbital energies and occupations to the logger.
Definition dftengine.cc:284
Eigen::MatrixXd RKSOrbitalHessian(const Vxc_Potential< Vxc_Grid > &vxc, const tools::EigenSystem &mos, const Eigen::MatrixXd &F, const Eigen::MatrixXd &X)
void setForceUKSPath(bool force)
Definition dftengine.h:228
std::vector< Index > numfuncpatom_
Definition dftengine.h:591
AOOverlap dftAOoverlap_
Definition dftengine.h:524
std::vector< Index > active_and_border_atoms_
Definition dftengine.h:590
void setEwaldNuclearEnergy(double energy)
Definition dftengine.h:113
Mat_p_Energy SetupH0(const QMMolecule &mol) const
Assemble the one-electron core Hamiltonian for the current molecule.
tools::EigenSystem ExtendedHuckelGuess(const QMMolecule &mol) const
bool IsRestrictedOpenShell() const
Definition dftengine.h:209
Eigen::MatrixXd OrthogonalizeGuess(const Eigen::MatrixXd &GuessMOs) const
Orthonormalize an initial MO guess with respect to the AO overlap matrix.
Eigen::MatrixXd v_embedding_trunc_
Definition dftengine.h:584
Eigen::MatrixXd SphericalAverageShells(const Eigen::MatrixXd &dmat, const AOBasis &dftbasis) const
ConvergenceAcc::options BuildConvergenceOptions() const
bool Evaluate(Orbitals &orb)
Definition dftengine.cc:814
CDFTConstraintSpec cdft_constraint_spec_
Definition dftengine.h:622
Eigen::MatrixXd ComputeNonXCGradientUKS(const QMMolecule &mol, const UKSConvergenceAcc::SpinDensity &Dspin, const tools::EigenSystem &MOs_alpha, const tools::EigenSystem &MOs_beta) const
Definition dftengine.cc:574
bool RunCDFT(Orbitals &orb, HirshfeldPartition::Constraint &constraint)
std::string dimer_guess_orbB_name_
Definition dftengine.h:531
SpinDensity BuildSpinDensity(const tools::EigenSystem &MOs) const
std::vector< std::unique_ptr< StaticSite > > * externalsites_
Definition dftengine.h:556
Eigen::MatrixXd McWeenyPurification(Eigen::MatrixXd &Dmat_in, AOOverlap &overlap)
void setSetupCache(DFTSetupCache *cache)
Definition dftengine.h:124
Vxc_Potential< Vxc_Grid > SetupVxc(const QMMolecule &mol)
std::string RISetupKey() const
double NuclearRepulsion(const QMMolecule &mol) const
Compute the classical nucleus-nucleus repulsion energy.
ConvergenceAcc conv_accelerator_
Definition dftengine.h:538
Eigen::MatrixXd InsertZeroCols(Eigen::MatrixXd MOsMatrix, Index startidx, Index numofzerocols)
std::string dimer_guess_orbA_name_
Definition dftengine.h:530
Wall-clock accounting for the parts of a DFT run.
Definition dfttimings.h:45
Container to hold ECPs for all atoms.
Definition ecpaobasis.h:43
Takes a density matrix and and an auxiliary basis set and calculates the electron repulsion integrals...
Definition ERIs.h:35
Logger is used for thread-safe output of messages.
Definition logger.h:164
Container for molecular orbitals and derived one-particle data.
Definition orbitals.h:47
container for QM atoms
Definition qmatom.h:37
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26
Level
be loud and noisy
Definition globals.h:28
Eigen::MatrixXd spin() const
Return the spin density P^alpha - P^beta.
Definition dftengine.h:204
Eigen::MatrixXd total() const
Return the total density P = P^alpha + P^beta.
Definition dftengine.h:201
Parts of the DFT setup that stay the same between runs on the same molecule with the same basis sets,...
Definition dftengine.h:55
std::string multipole_key
Definition dftengine.h:63
Eigen::MatrixXd multipole_sites
Definition dftengine.h:64
Eigen::MatrixXd multipole_matrix
Definition dftengine.h:65
Eigen::MatrixXd ewald_matrix
Definition dftengine.h:60