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