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 "psi4/libpsio/psio.hpp"
33 #include "hf.h"
34 
35 namespace psi { namespace scf {
36 
37 /*
38 
39  Constrained Unrestricted Hartree-Fock
40 
41  Reference: T. Tsuchimochi and G.E. Scuseria, J. Chem. Phys. 133,
42  141102 (2010)
43 
44  This is an alternative formulation of ROHF as a contrained UHF. A
45  Lagrangian constraint is placed on the usual UHF procedure to remove
46  the spin contamination. The result is an ROHF energy and semicanonical
47  ROHF orbitals. The need to pick coupling coefficients is removed.
48  Koopmans' theorem is valid for CUHF orbital energes.
49 
50  It is claimed that CUHF does not suffer from the convergence problems
51  of certain ROHF implementations (not sure how PSI's ROHF code does).
52  CUHF retains the UHF-like trait that Ca != Cb. Also, the converged CUHF
53  wavefunction yields the correct value for <S^2>, however, this is only
54  true at convergence. It is possible that this increased flexibility
55  improves convergence.
56 
57  -- EGH, August 15th, 2011
58 
59  TODO:
60 
61  Probably can't handle NSO != NMO right now, should either fix this code
62  or the transform functions from Matrix.
63 
64  Using the UHF form for the Lagrangian, this is probably correct, but
65  should be checked.
66 
67 */
68 
69 class CUHF : public HF {
70 protected:
74  // Contributions to the Fock matrix from charge and spin density
76  // Charge denisty and natural orbitals (eigenvectors of charge density)
78  // Natural orbital occupations
80 
81  void form_initialF();
82  void form_C();
83  void form_D();
84  double compute_initial_E();
85  virtual bool stability_analysis();
86  virtual double compute_E();
87 
88  virtual void form_G();
89  virtual void form_F();
90 
91  virtual void compute_orbital_gradient(bool save_diis);
92 
93  bool diis();
94 
95  bool test_convergency();
96  void save_information();
98 
99  void common_init();
100 
102 
103  virtual void damp_update();
104 
105  // Finalize memory/files
106  virtual void finalize();
107 
108 public:
109  CUHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional);
110  CUHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional,
111  Options& options, std::shared_ptr<PSIO> psio);
112  virtual ~CUHF();
113  std::shared_ptr<CUHF> c1_deep_copy(std::shared_ptr<BasisSet> basis);
114 };
115 
116 }}
117 
118 #endif
SharedMatrix Da_old_
Definition: cuhf.h:72
std::shared_ptr< BasisSet > basis
Definition: dx_write.cc:59
virtual void form_F()
Definition: cuhf.cc:230
SharedMatrix Fp_
Definition: cuhf.h:75
SharedMatrix J_
Definition: cuhf.h:73
virtual double compute_E()
Compute energy for the iteration.
Definition: cuhf.cc:350
void form_C()
Compute the MO coefficients (C_)
Definition: cuhf.cc:306
SharedMatrix Cno_temp_
Definition: cuhf.h:77
double ** scf
Definition: dx_write.cc:57
SharedMatrix Dt_
Definition: cuhf.h:71
double compute_initial_E()
Definition: cuhf.cc:348
std::shared_ptr< SuperFunctional > functional() const
The DFT Functional object (or null if it has been deleted)
Definition: hf.h:234
void save_information()
Definition: cuhf.cc:171
std::shared_ptr< PSIO > psio() const
void form_initialF()
Definition: cuhf.cc:218
void save_density_and_energy()
Save the current density and energy.
Definition: cuhf.cc:145
SharedMatrix Kb_
Definition: cuhf.h:73
virtual void compute_orbital_gradient(bool save_diis)
Definition: cuhf.cc:370
SharedMatrix Dp_
Definition: cuhf.h:77
SharedVector No_
Definition: cuhf.h:79
void compute_spin_contamination()
Definition: cuhf.cc:173
Definition: cuhf.h:69
void common_init()
Definition: cuhf.cc:70
virtual void form_G()
Definition: cuhf.cc:152
bool diis()
Definition: cuhf.cc:390
SharedMatrix Dt_old_
Definition: cuhf.h:71
std::shared_ptr< CUHF > c1_deep_copy(std::shared_ptr< BasisSet > basis)
Definition: cuhf.cc:398
SharedMatrix Cno_
Definition: cuhf.h:77
SharedMatrix Fm_
Definition: cuhf.h:75
Options & options() const
bool test_convergency()
Definition: cuhf.cc:208
virtual bool stability_analysis()
Check the stability of the wavefunction, and correct (if requested)
Definition: cuhf.cc:392
void form_D()
Computes the density matrix (D_)
Definition: cuhf.cc:316
Definition: liboptions.h:355
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
virtual ~CUHF()
Definition: cuhf.cc:68
Definition: hf.h:48
SharedMatrix Ka_
Definition: cuhf.h:73
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:54
SharedMatrix Db_old_
Definition: cuhf.h:72
CUHF(SharedWavefunction ref_wfn, std::shared_ptr< SuperFunctional > functional)
Definition: cuhf.cc:57
virtual void damp_update()
Definition: cuhf.cc:104
std::shared_ptr< Vector > SharedVector
Definition: adc.h:51
virtual void finalize()
Definition: cuhf.cc:113