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