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