Psi4
stability.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 STABILITY_H
29 #define STABILITY_H
30 
31 #endif // STABILITY_H
32 
34 
35 namespace psi {
36 
37 class BasisSet;
38 class Matrix;
39 class TwoBodyAOInt;
40 class JK;
41 class VBase;
42 
43 namespace scf {
44 
45 class UStab {
46 
47 protected:
48 
49  std::vector<std::pair<SharedMatrix,SharedMatrix> > vecs_;
50  std::vector<double> vals_;
51 
52  bool unstable = false;
53  double unstable_val = 0.0;
54  std::pair<SharedMatrix,SharedMatrix> unstable_vec;
55 
56  int print_;
57  int bench_;
58  int debug_;
59  long int memory_;
60 
61  //SharedMatrix C_;
62 
69 
70  std::shared_ptr<Vector> eps_occa_;
71  std::shared_ptr<Vector> eps_vira_;
72  std::shared_ptr<Vector> eps_occb_;
73  std::shared_ptr<Vector> eps_virb_;
74 
75  std::shared_ptr<Wavefunction> reference_wavefunction_;
76  std::shared_ptr<Molecule> molecule_;
77  std::shared_ptr<BasisSet> basis_;
78 
80 
82 
84  double convergence_;
86  std::shared_ptr<JK> jk_;
87  std::shared_ptr<VBase> v_;
88 
89  double Eref_;
90 
91  void common_init();
92  void print_header();
93  void preiterations();
94 
95 public:
96 
97  UStab(SharedWavefunction ref_wfn, Options& options);
98  virtual ~UStab();
99 
101  std::shared_ptr<JK> jk() const { return jk_;}
103  void set_jk(std::shared_ptr<JK> jk) { jk_ = jk; }
105  std::shared_ptr<VBase> v() const { return v_;}
107  void set_jk(std::shared_ptr<VBase> v) { v_ = v; }
109  bool is_unstable() const { return unstable;}
110 
112  double get_eigval() const {return unstable_val;}
113 
115 
117  void set_convergence(double convergence) { convergence_ = convergence; }
118 
120  void set_reference(std::shared_ptr<Wavefunction> reference);
121 
122  virtual double compute_energy();
124  void rotate_orbs(double scale);
125 };
126 
127 } // namespace scf
128 
129 
130 } // namespace psi
std::shared_ptr< Wavefunction > reference_wavefunction_
Definition: stability.h:75
Definition: stability.h:45
SharedMatrix Cvira_
Definition: stability.h:65
int print_
Definition: stability.h:56
SharedMatrix Ca_
Definition: stability.h:67
SharedMatrix analyze()
Definition: stability.cc:216
bool unstable
Definition: stability.h:52
void set_convergence(double convergence)
=&gt; Setters &lt;= ///
Definition: stability.h:117
virtual double compute_energy()
Definition: stability.cc:136
double ** scf
Definition: dx_write.cc:56
void print_header()
Definition: stability.cc:109
SharedMatrix Cvirb_
Definition: stability.h:66
void set_jk(std::shared_ptr< JK > jk)
Set the JK object, say from SCF.
Definition: stability.h:103
std::shared_ptr< Molecule > molecule_
Definition: stability.h:76
int bench_
Definition: stability.h:57
std::shared_ptr< VBase > v_
Definition: stability.h:87
std::shared_ptr< JK > jk_
Global JK object, built in preiterations, destroyed in postiterations.
Definition: stability.h:86
void preiterations()
Definition: stability.cc:295
Options & options_
Definition: stability.h:81
double get_eigval() const
Get the eigenvalue for storage and comparison.
Definition: stability.h:112
void set_jk(std::shared_ptr< VBase > v)
Set the VBase object, say from SCF (except that wouldn&#39;t work, right?)
Definition: stability.h:107
void reference(void)
Definition: reference.cc:48
double unstable_val
Definition: stability.h:53
std::shared_ptr< Vector > eps_occb_
Definition: stability.h:72
void set_reference(std::shared_ptr< Wavefunction > reference)
Update reference info.
Definition: stability.cc:81
std::shared_ptr< JK > jk() const
Gets a handle to the JK object, if built by preiterations.
Definition: stability.h:101
long int memory_
Definition: stability.h:59
void common_init()
Definition: stability.cc:70
SharedMatrix Cocca_
Definition: stability.h:63
std::shared_ptr< Vector > eps_occa_
Definition: stability.h:70
double convergence_
How far to converge the two-norm of the residual.
Definition: stability.h:84
std::shared_ptr< BasisSet > basis_
Definition: stability.h:77
std::vector< std::pair< SharedMatrix, SharedMatrix > > vecs_
Definition: stability.h:49
void rotate_orbs(double scale)
Definition: stability.cc:266
Definition: liboptions.h:359
SharedMatrix Cb_
Definition: stability.h:68
SharedMatrix AO2USO_
Definition: stability.h:79
bool is_unstable() const
Is the wavefunction stable ?
Definition: stability.h:109
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
std::shared_ptr< Vector > eps_virb_
Definition: stability.h:73
std::shared_ptr< VBase > v() const
Gets a handle to the VBase object, if built by preiterations.
Definition: stability.h:105
virtual ~UStab()
Definition: stability.cc:67
UStab(SharedWavefunction ref_wfn, Options &options)
Definition: stability.cc:60
SharedMatrix Coccb_
Definition: stability.h:64
int debug_
Definition: stability.h:58
std::pair< SharedMatrix, SharedMatrix > unstable_vec
Definition: stability.h:54
std::shared_ptr< Vector > eps_vira_
Definition: stability.h:71
std::shared_ptr< Wavefunction > SharedWavefunction
Definition: typedefs.h:50
std::vector< double > vals_
Definition: stability.h:50
double Eref_
Definition: stability.h:89