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