Psi4
uhf.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_uhf_h__
29 #define __math_test_uhf_h__
30 
31 #include "psi4/libpsio/psio.hpp"
32 #include "hf.h"
33 
34 namespace psi {
35 class Matrix;
36 class Vector;
37 namespace scf {
38 
39 class UHF : public HF {
40 protected:
44 
45  void form_initialF();
46  void form_C();
47  void form_V();
48  void form_D();
49  double compute_initial_E();
50  virtual double compute_E();
51  virtual bool stability_analysis();
52  bool stability_analysis_pk();
53 
54  virtual void form_G();
55  virtual void form_F();
56 
57  virtual void compute_orbital_gradient(bool save_diis);
58  bool diis();
59 
60  bool test_convergency();
61  void save_information();
62 
63  void common_init();
64 
66 
67  // Finalize memory/files
68  virtual void finalize();
69 
70  // Scaling factor for orbital rotation
71  double step_scale_;
72  // Increment to explore different scaling factors
74  // Stability eigenvalue, for doing smart eigenvector following
75  double stab_val;
76 
77  // Compute UHF NOs
78  void compute_nos();
79 
80  // Damp down the density update
81  virtual void damp_update();
82 
83  // Second-order convergence code
84  void Hx(SharedMatrix x_a, SharedMatrix IFock_a, SharedMatrix Cocc_a,
85  SharedMatrix Cvir_a, SharedMatrix ret_a,
86  SharedMatrix x_b, SharedMatrix IFock_b, SharedMatrix Cocc_b,
87  SharedMatrix Cvir_b, SharedMatrix ret_b);
88  virtual int soscf_update(void);
89 
90 public:
91  UHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional);
92  UHF(SharedWavefunction ref_wfn, std::shared_ptr<SuperFunctional> functional,
93  Options& options, std::shared_ptr<PSIO> psio);
94  virtual ~UHF();
95 
96  virtual bool same_a_b_orbs() const { return false; }
97  virtual bool same_a_b_dens() const { return false; }
98 };
99 
100 }}
101 
102 #endif
void compute_nos()
Definition: uhf.cc:735
void form_D()
Computes the density matrix (D_)
Definition: uhf.cc:283
Options & options() const
Definition: wavefunction.cc:400
virtual void damp_update()
Definition: uhf.cc:465
std::shared_ptr< PSIO > psio() const
Definition: wavefunction.cc:395
void common_init()
Definition: uhf.cc:72
SharedMatrix J_
Definition: uhf.h:43
virtual bool same_a_b_dens() const
Definition: uhf.h:97
SharedMatrix Ga_
Definition: uhf.h:43
void form_C()
Compute the MO coefficients (C_)
Definition: uhf.cc:263
virtual void finalize()
Definition: uhf.cc:106
double step_scale_
Definition: uhf.h:71
double ** scf
Definition: dx_write.cc:56
SharedMatrix wKa_
Definition: uhf.h:43
std::shared_ptr< SuperFunctional > functional() const
The DFT Functional object (or null if it has been deleted)
Definition: hf.h:239
void save_density_and_energy()
Save the current density and energy.
Definition: uhf.cc:137
SharedMatrix wKb_
Definition: uhf.h:43
SharedMatrix Gb_
Definition: uhf.h:43
virtual void form_G()
Definition: uhf.cc:160
double stab_val
Definition: uhf.h:75
bool diis()
Definition: uhf.cc:685
virtual void compute_orbital_gradient(bool save_diis)
Definition: uhf.cc:663
SharedMatrix Da_old_
Definition: uhf.h:42
double compute_initial_E()
Definition: uhf.cc:319
double step_increment_
Definition: uhf.h:73
SharedMatrix Kb_
Definition: uhf.h:43
void Hx(SharedMatrix x_a, SharedMatrix IFock_a, SharedMatrix Cocc_a, SharedMatrix Cvir_a, SharedMatrix ret_a, SharedMatrix x_b, SharedMatrix IFock_b, SharedMatrix Cocc_b, SharedMatrix Cvir_b, SharedMatrix ret_b)
Definition: uhf.cc:368
virtual void form_F()
Definition: uhf.cc:249
void save_information()
Definition: uhf.cc:221
bool stability_analysis_pk()
SharedMatrix Dt_
Definition: uhf.h:41
UHF(SharedWavefunction ref_wfn, std::shared_ptr< SuperFunctional > functional)
Definition: uhf.cc:55
void form_initialF()
Definition: uhf.cc:236
SharedMatrix Dt_old_
Definition: uhf.h:41
Definition: liboptions.h:359
virtual int soscf_update(void)
Definition: uhf.cc:474
SharedMatrix Db_old_
Definition: uhf.h:42
SharedMatrix Ka_
Definition: uhf.h:43
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
void form_V()
Computes the density matrix (V_)
Definition: uhf.cc:144
virtual bool stability_analysis()
Check the stability of the wavefunction, and correct (if requested)
Definition: uhf.cc:690
virtual double compute_E()
Compute energy for the iteration.
Definition: uhf.cc:326
Definition: hf.h:54
virtual bool same_a_b_orbs() const
Definition: uhf.h:96
virtual ~UHF()
Definition: uhf.cc:68
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:50
bool test_convergency()
Definition: uhf.cc:225
Definition: uhf.h:39