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-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 /*
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  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 
90  public:
99  Deriv(const std::shared_ptr<Wavefunction>& wave, char needed_irreps = 0x1, bool project_out_translations = false,
100  bool project_out_rotations = false);
101 
102  // Is the TPDM already presorted? Default: False
103  void set_tpdm_presorted(bool val) { tpdm_presorted_ = val; }
104 
105  // Ignore reference contributions to the gradient? Default: False
106  void set_ignore_reference(bool val) { ignore_reference_ = val; }
107 
108  // Is the deriv_density already backtransformed? Default: False
110 
112 
113  const SharedMatrix& one_electron() { return opdm_contr_; }
114 
115  const SharedMatrix& lagrangian() { return x_contr_; }
116 
117  const SharedMatrix& two_body() { return tpdm_contr_; }
118 
119  const SharedMatrix& gradient() { return gradient_; }
120 };
121 
122 } // namespace psi
123 
124 #endif /* DERIV_H_ */
bool tpdm_presorted_
Definition: deriv.h:67
SharedMatrix compute()
Definition: deriv.cc:396
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:374
const SharedMatrix & gradient()
Definition: deriv.h:119
Definition: cdsalclist.h:121
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:106
void set_deriv_density_backtransformed(bool val)
Definition: deriv.h:109
const SharedMatrix & two_body()
Definition: deriv.h:117
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:113
std::shared_ptr< MatrixFactory > factory_
Definition: deriv.h:57
SharedMatrix W_2_
Definition: deriv.h:63
Definition: deriv.h:52
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:103
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
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:115
SharedMatrix tpdm_contr_
Two-electron contribution to the gradient.
Definition: deriv.h:84