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