Psi4
deriv.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 /*
29  * deriv.h
30  *
31  * Created on: Feb 24, 2009
32  * Author: jturney
33  */
34 
35 #ifndef _psi_src_lib_libmints_deriv_h_
36 #define _psi_src_lib_libmints_deriv_h_
37 
38 #include <vector>
39 #include "matrix.h"
41 
42 namespace psi {
43 
44 class Wavefunction;
45 class IntegralFactory;
46 class BasisSet;
47 class SOBasisSet;
48 class Molecule;
49 class CdSalcList;
50 
51 class Deriv
52 {
53  const std::shared_ptr<Wavefunction> wfn_;
54  std::shared_ptr<IntegralFactory> integral_;
55  std::shared_ptr<BasisSet> basis_;
56  std::shared_ptr<SOBasisSet> sobasis_;
57  std::shared_ptr<MatrixFactory> factory_;
58  std::shared_ptr<Molecule> molecule_;
59 
61 
65 
66  int natom_;
70 
71  std::vector<SharedMatrix> dH_;
72  std::vector<SharedMatrix> dS_;
73 
74  // Results go here.
89 public:
98  Deriv(const std::shared_ptr<Wavefunction>& wave,
99  char needed_irreps=0x1,
100  bool project_out_translations=false,
101  bool project_out_rotations=false);
102 
103  // Is the TPDM already presorted? Default: False
104  void set_tpdm_presorted(bool val) { tpdm_presorted_ = val; }
105 
106  // Ignore reference contributions to the gradient? Default: False
107  void set_ignore_reference(bool val) { ignore_reference_ = val; }
108 
109  // Is the deriv_density already backtransformed? Default: False
111 
113 
115  return opdm_contr_;
116  }
117 
119  return x_contr_;
120  }
121 
123  return tpdm_contr_;
124  }
125 
127  return gradient_;
128  }
129 };
130 
131 }
132 
133 #endif /* DERIV_H_ */
bool tpdm_presorted_
Definition: deriv.h:67
SharedMatrix compute()
Definition: deriv.cc:461
std::shared_ptr< BasisSet > basis_
Definition: deriv.h:55
Deriv(const std::shared_ptr< Wavefunction > &wave, char needed_irreps=0x1, bool project_out_translations=false, bool project_out_rotations=false)
Definition: deriv.cc:431
const SharedMatrix & gradient()
Definition: deriv.h:126
Definition: cdsalclist.h:124
std::vector< SharedMatrix > dH_
Definition: deriv.h:71
std::vector< SharedMatrix > dS_
Definition: deriv.h:72
SharedMatrix opdm_contr_
One-electron contribution to the gradient.
Definition: deriv.h:76
SharedMatrix gradient_
Final gradient.
Definition: deriv.h:88
std::shared_ptr< IntegralFactory > integral_
Definition: deriv.h:54
void set_ignore_reference(bool val)
Definition: deriv.h:107
void set_deriv_density_backtransformed(bool val)
Definition: deriv.h:110
const SharedMatrix & two_body()
Definition: deriv.h:122
SharedMatrix x_ref_contr_
Reference overlap contribution to the gradient.
Definition: deriv.h:82
SharedMatrix P_2_
Definition: deriv.h:62
std::shared_ptr< Molecule > molecule_
Definition: deriv.h:58
SharedMatrix x_contr_
Overlap contribution to the gradient.
Definition: deriv.h:80
const SharedMatrix & one_electron()
Definition: deriv.h:114
std::shared_ptr< MatrixFactory > factory_
Definition: deriv.h:57
SharedMatrix W_2_
Definition: deriv.h:63
Definition: deriv.h:51
std::shared_ptr< SOBasisSet > sobasis_
Definition: deriv.h:56
SharedMatrix SCF_D_
Definition: deriv.h:64
SharedMatrix tpdm_ref_contr_
Reference two-electron contribution to the gradient.
Definition: deriv.h:86
void set_tpdm_presorted(bool val)
Definition: deriv.h:104
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
int natom_
Definition: deriv.h:66
CdSalcList cdsalcs_
Definition: deriv.h:60
SharedMatrix opdm_ref_contr_
Reference one-electron contribution to the gradient.
Definition: deriv.h:78
bool ignore_reference_
Definition: deriv.h:69
bool deriv_density_backtransformed_
Definition: deriv.h:68
const std::shared_ptr< Wavefunction > wfn_
Definition: deriv.h:53
const SharedMatrix & lagrangian()
Definition: deriv.h:118
SharedMatrix tpdm_contr_
Two-electron contribution to the gradient.
Definition: deriv.h:84