Psi4
cuhf.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2018 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef __math_test_cuhf_h__
30 #define __math_test_cuhf_h__
31 
32 #include "hf.h"
33 #include "psi4/libpsio/psio.hpp"
34 
35 namespace psi {
36 namespace scf {
37 
38 /*
39 
40  Constrained Unrestricted Hartree-Fock
41 
42  Reference: T. Tsuchimochi and G.E. Scuseria, J. Chem. Phys. 133,
43  141102 (2010)
44 
45  This is an alternative formulation of ROHF as a contrained UHF. A
46  Lagrangian constraint is placed on the usual UHF procedure to remove
47  the spin contamination. The result is an ROHF energy and semicanonical
48  ROHF orbitals. The need to pick coupling coefficients is removed.
49  Koopmans' theorem is valid for CUHF orbital energes.
50 
51  It is claimed that CUHF does not suffer from the convergence problems
52  of certain ROHF implementations (not sure how PSI's ROHF code does).
53  CUHF retains the UHF-like trait that Ca != Cb. Also, the converged CUHF
54  wavefunction yields the correct value for <S^2>, however, this is only
55  true at convergence. It is possible that this increased flexibility
56  improves convergence.
57 
58  -- EGH, August 15th, 2011
59 
60  TODO:
61 
62  Probably can't handle NSO != NMO right now, should either fix this code
63  or the transform functions from Matrix.
64 
65  Using the UHF form for the Lagrangian, this is probably correct, but
66  should be checked.
67 
68 */
69 
70 class CUHF : public HF {
71  protected:
75  // Contributions to the Fock matrix from charge and spin density
77  // Charge denisty and natural orbitals (eigenvectors of charge density)
79  // Natural orbital occupations
81 
82  void form_initialF();
83  double compute_initial_E();
84 
86 
87  void common_init();
88 
89  public:
90  CUHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional);
91  CUHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional, Options& options,
92  std::shared_ptr<PSIO> psio);
93  virtual ~CUHF();
94 
95  bool diis();
97  double compute_orbital_gradient(bool save_diis, int max_diis_vectors);
98 
99  void form_C();
100  void form_D();
101  void form_F();
102  void form_G();
103  double compute_E();
104  void finalize();
105 
106  void damping_update(double);
107  bool stability_analysis();
108 
109  std::shared_ptr<CUHF> c1_deep_copy(std::shared_ptr<BasisSet> basis);
110 };
111 } // namespace scf
112 } // namespace psi
113 
114 #endif
SharedMatrix Da_old_
Definition: cuhf.h:73
Options & options() const
Definition: wavefunction.cc:572
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:570
std::shared_ptr< BasisSet > basis
Definition: dx_write.cc:59
void form_F()
Definition: cuhf.cc:217
SharedMatrix Fp_
Definition: cuhf.h:76
SharedMatrix J_
Definition: cuhf.h:74
double compute_E()
Compute energy for the iteration.
Definition: cuhf.cc:337
void form_C()
Compute the MO coefficients (C_)
Definition: cuhf.cc:293
SharedMatrix Cno_temp_
Definition: cuhf.h:78
double ** scf
Definition: dx_write.cc:57
SharedMatrix Dt_
Definition: cuhf.h:72
double compute_initial_E()
Definition: cuhf.cc:335
std::shared_ptr< SuperFunctional > functional() const
The DFT Functional object (or null if it has been deleted)
Definition: hf.h:296
void form_initialF()
Definition: cuhf.cc:205
void save_density_and_energy()
Save the current density and energy.
Definition: cuhf.cc:145
SharedMatrix Kb_
Definition: cuhf.h:74
SharedMatrix Dp_
Definition: cuhf.h:78
SharedVector No_
Definition: cuhf.h:80
void compute_spin_contamination()
Definition: cuhf.cc:170
Definition: cuhf.h:70
void common_init()
Definition: cuhf.cc:70
void form_G()
Definition: cuhf.cc:151
bool diis()
Definition: cuhf.cc:378
SharedMatrix Dt_old_
Definition: cuhf.h:72
std::shared_ptr< CUHF > c1_deep_copy(std::shared_ptr< BasisSet > basis)
Definition: cuhf.cc:385
SharedMatrix Cno_
Definition: cuhf.h:78
SharedMatrix Fm_
Definition: cuhf.h:76
bool stability_analysis()
Check the stability of the wavefunction, and correct (if requested)
Definition: cuhf.cc:380
void form_D()
Computes the density matrix (D_)
Definition: cuhf.cc:303
Definition: liboptions.h:353
double compute_orbital_gradient(bool save_diis, int max_diis_vectors)
Definition: cuhf.cc:357
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
virtual ~CUHF()
Definition: cuhf.cc:68
Definition: hf.h:48
SharedMatrix Ka_
Definition: cuhf.h:74
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:54
SharedMatrix Db_old_
Definition: cuhf.h:73
CUHF(SharedWavefunction ref_wfn, std::shared_ptr< SuperFunctional > functional)
Definition: cuhf.cc:57
std::shared_ptr< Vector > SharedVector
Definition: adc.h:51
void finalize()
Definition: cuhf.cc:113
void damping_update(double)
Definition: cuhf.cc:104