Psi4
heff.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 _psi_src_bin_psimrcc_heff_h_
29 #define _psi_src_bin_psimrcc_heff_h_
30 
31 #include <vector>
32 
33 namespace psi{ namespace psimrcc{
34 
36 {
37 public:
38  // Constructor and destructor
39  Hamiltonian();
40  ~Hamiltonian();
41 
42  double get_eigenvalue() const {return eigenvalue;}
43  double get_matrix(int mu,int nu) const {return matrix[mu][nu];}
44  double get_left_eigenvector(int mu) const {return left_eigenvector[mu];}
45  double get_right_eigenvector(int mu) const {return right_eigenvector[mu];}
46  double get_zeroth_order_eigenvector(int mu) const {return zeroth_order_eigenvector[mu];}
47 
48  double expectation_value();
49  double diagonalize(int root = 0);
50 
51  double trace();
52 
53  void add_matrix(int mu,int nu,double value) {matrix[mu][nu] += value;}
54 
55  void set_eigenvalue(double eigenvalue_) {eigenvalue = eigenvalue_;}
56  void set_matrix(double** M,int ndets);
57  void set_zeroth_order_eigenvector(double* v,int ndets);
58  void set_left_eigenvector(double* v,int ndets);
59  void set_right_eigenvector(double* v,int ndets);
60  void print();
61  void print_matrix();
62 
63 private:
64  void startup();
65  void cleanup();
66 
67  int ndets;
68  double eigenvalue;
69  std::vector<std::vector<double> > matrix;
70  std::vector<double> right_eigenvector;
71  std::vector<double> left_eigenvector;
72  std::vector<double> zeroth_order_eigenvector;
73 };
74 
75 }} /* End Namespaces */
76 
77 #endif // _psi_src_bin_psimrcc_heff_h_
PsiReturnType psimrcc(SharedWavefunction, Options &)
Definition: psimrcc/main.cc:86
void set_eigenvalue(double eigenvalue_)
Definition: heff.h:55
double get_left_eigenvector(int mu) const
Definition: heff.h:44
Hamiltonian()
Definition: heff.cc:42
void startup()
Definition: heff.cc:52
std::vector< double > left_eigenvector
Definition: heff.h:71
void cleanup()
Definition: heff.cc:56
double get_eigenvalue() const
Definition: heff.h:42
void set_matrix(double **M, int ndets)
Definition: heff.cc:92
void print_matrix()
Definition: heff.cc:60
std::vector< double > zeroth_order_eigenvector
Definition: heff.h:72
std::vector< std::vector< double > > matrix
Definition: heff.h:69
double diagonalize(int root=0)
Definition: heff_diagonalize.cc:48
double eigenvalue
Definition: heff.h:68
Definition: heff.h:35
void set_zeroth_order_eigenvector(double *v, int ndets)
Definition: heff.cc:127
double trace()
Definition: heff.cc:147
std::vector< double > right_eigenvector
Definition: heff.h:70
void print()
Definition: heff.cc:72
void set_left_eigenvector(double *v, int ndets)
Definition: heff.cc:109
double get_matrix(int mu, int nu) const
Definition: heff.h:43
~Hamiltonian()
Definition: heff.cc:47
int ndets
Definition: heff.h:67
void set_right_eigenvector(double *v, int ndets)
Definition: heff.cc:118
double get_zeroth_order_eigenvector(int mu) const
Definition: heff.h:46
void add_matrix(int mu, int nu, double value)
Definition: heff.h:53
double expectation_value()
Definition: heff.cc:136
double get_right_eigenvector(int mu) const
Definition: heff.h:45