Psi4
rhf.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 RHF_H
29 #define RHF_H
30 
31 #include "psi4/libpsio/psio.hpp"
32 #include "hf.h"
33 
34 namespace psi {
35 
36 class TwoBodySOInt;
37 class PSIO;
38 class Chkpt;
39 class Matrix;
40 class Vector;
41 
42 namespace scf {
43 
44 class RHF : public HF {
45 protected:
46 
47  // Temporary matrices
54 
55  void form_C();
56  void form_D();
57  virtual void damp_update();
58  double compute_initial_E();
59  virtual double compute_E();
60  virtual bool stability_analysis();
61 
62  virtual void form_F();
63  virtual void form_G();
64  virtual void form_V();
65  virtual void compute_orbital_gradient(bool save_fock);
66 
67  bool diis();
68 
69  bool test_convergency();
70  void save_information();
71 
72  void common_init();
73 
74  // Finalize memory/files
75  virtual void finalize();
76 
78 
79  // Second-order convergence code
80  void Hx(SharedMatrix x, SharedMatrix IFock, SharedMatrix Cocc, SharedMatrix Cvir, SharedMatrix ret);
81  virtual int soscf_update(void);
82 
83 public:
84  RHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional);
85  RHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional,
86  Options& options, std::shared_ptr<PSIO> psio);
87  virtual ~RHF();
88 
89 
90  virtual SharedMatrix Da() const;
91 
92  virtual bool same_a_b_orbs() const { return true; }
93  virtual bool same_a_b_dens() const { return true; }
94 };
95 
96 }}
97 
98 #endif
Options & options() const
Definition: wavefunction.cc:400
bool diis()
Definition: rhf.cc:248
bool test_convergency()
Definition: rhf.cc:253
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:395
SharedMatrix D_
Definition: rhf.h:48
virtual bool same_a_b_dens() const
Definition: rhf.h:93
virtual void finalize()
Definition: rhf.cc:106
virtual bool same_a_b_orbs() const
Definition: rhf.h:92
SharedMatrix Dold_
Definition: rhf.h:49
virtual int soscf_update(void)
Definition: rhf.cc:426
double ** scf
Definition: dx_write.cc:56
std::shared_ptr< SuperFunctional > functional() const
The DFT Functional object (or null if it has been deleted)
Definition: hf.h:239
virtual void compute_orbital_gradient(bool save_fock)
Definition: rhf.cc:227
void save_density_and_energy()
Save the current density and energy.
Definition: rhf.cc:135
void save_information()
Definition: rhf.cc:223
virtual void form_F()
Definition: rhf.cc:267
SharedMatrix G_
Definition: rhf.h:50
virtual void form_G()
Definition: rhf.cc:174
double compute_initial_E()
Definition: rhf.cc:321
RHF(SharedWavefunction ref_wfn, std::shared_ptr< SuperFunctional > functional)
Definition: rhf.cc:61
SharedMatrix wK_
Definition: rhf.h:53
SharedMatrix J_
Definition: rhf.h:51
virtual void form_V()
Computes the density matrix (V_)
Definition: rhf.cc:159
virtual bool stability_analysis()
Check the stability of the wavefunction, and correct (if requested)
Definition: rhf.cc:569
virtual SharedMatrix Da() const
Definition: rhf.cc:130
void form_D()
Computes the density matrix (D_)
Definition: rhf.cc:290
void form_C()
Compute the MO coefficients (C_)
Definition: rhf.cc:284
Definition: liboptions.h:359
virtual double compute_E()
Compute energy for the iteration.
Definition: rhf.cc:327
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
void Hx(SharedMatrix x, SharedMatrix IFock, SharedMatrix Cocc, SharedMatrix Cvir, SharedMatrix ret)
Definition: rhf.cc:368
SharedMatrix K_
Definition: rhf.h:52
Definition: hf.h:54
virtual void damp_update()
Definition: rhf.cc:315
void common_init()
Definition: rhf.cc:78
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:50
Definition: rhf.h:44
virtual ~RHF()
Definition: rhf.cc:74