Psi4
mintshelper.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 #ifndef _psi_src_lib_libmints_helper_h
30 #define _psi_src_lib_libmints_helper_h
31 
32 #include <vector>
35 
36 namespace psi {
37 
38 class CdSalcList;
39 class CorrelationFactor;
40 class TwoBodyAOInt;
41 class PetiteList;
42 class ThreeCenterOverlapInt;
43 class OneBodyAOInt;
44 
49 class MintsHelper {
50 
51 private:
54  std::shared_ptr<PSIO> psio_;
55  std::shared_ptr<MatrixFactory> factory_;
56  std::shared_ptr<Molecule> molecule_;
57  std::shared_ptr<IntegralFactory> integral_;
58  std::shared_ptr<BasisSet> basisset_;
59  std::shared_ptr<SOBasisSet> sobasis_;
60  std::shared_ptr<TwoBodyAOInt> eriInts_;
61  std::shared_ptr<BasisSet> rel_basisset_;
62  int print_;
63  int nthread_;
64 
66  double cutoff_;
67 
68  // In-core O(N^5) transqt
70  // In-core O(N^5) transqt
72  SharedMatrix C3, SharedMatrix C4);
74  SharedMatrix mo_spin_eri_helper(SharedMatrix Iso, int n1, int n2);
75 
76 
77  SharedMatrix ao_helper(const std::string& label, std::shared_ptr<TwoBodyAOInt> ints);
78  SharedMatrix ao_shell_getter(const std::string& label, std::shared_ptr<TwoBodyAOInt> ints, int M, int N, int P, int Q);
79 
80  SharedMatrix ao_3coverlap_helper(const std::string &label, std::shared_ptr<ThreeCenterOverlapInt> ints);
81 
82  void common_init();
83 
84  void one_body_ao_computer(std::vector<std::shared_ptr<OneBodyAOInt>> obv, SharedMatrix out, bool symm);
85 
86 public:
87 
88  void init_helper(std::shared_ptr<Wavefunction> wavefunction = std::shared_ptr<Wavefunction>());
89  void init_helper(std::shared_ptr<BasisSet> basis);
90 
92  MintsHelper(std::shared_ptr<BasisSet> basis,
93  Options& options = Process::environment.options,
94  int print = 0);
95 
97  MintsHelper(std::shared_ptr<Wavefunction> wavefunction);
99  ~MintsHelper();
100 
102  return OperatorSymmetry(order, molecule_, integral_, factory_);
103  }
104 
106  int nbf() const;
107 
109  void set_print(int print) {print_ = print; }
110  void set_nthread(int nthread) {nthread_ = nthread; }
111 
113  std::shared_ptr<PetiteList> petite_list() const;
114 
115  enum {
117  kFromBF = false
118  };
122  std::shared_ptr<PetiteList> petite_list(bool include_pure_transform) const;
124  std::shared_ptr<BasisSet> basisset() const;
126  std::shared_ptr<SOBasisSet> sobasisset() const;
128  std::shared_ptr<MatrixFactory> factory() const;
130  std::shared_ptr<IntegralFactory> integral() const;
131 
132  void set_rel_basisset(std::shared_ptr<BasisSet> rel_basis) { rel_basisset_ = rel_basis; }
133 
135  void integrals();
136  void integrals_erf(double w = -1.0);
137  void integrals_erfc(double w = -1.0);
138 
140  void one_electron_integrals();
142  void integral_gradients();
144  void integral_hessians();
145 
148  SharedMatrix ao_eri(std::shared_ptr<BasisSet> bs1,
149  std::shared_ptr<BasisSet> bs2,
150  std::shared_ptr<BasisSet> bs3,
151  std::shared_ptr<BasisSet> bs4);
153  SharedMatrix ao_eri_shell(int M, int N, int P, int Q);
155  SharedMatrix ao_erf_eri(double omega);
157  SharedMatrix ao_erfc_eri(double omega);
159  SharedMatrix ao_f12(std::shared_ptr<CorrelationFactor> corr);
160  SharedMatrix ao_f12(std::shared_ptr<CorrelationFactor> corr,
161  std::shared_ptr<BasisSet> bs1,
162  std::shared_ptr<BasisSet> bs2,
163  std::shared_ptr<BasisSet> bs3,
164  std::shared_ptr<BasisSet> bs4);
166  SharedMatrix ao_f12_scaled(std::shared_ptr<CorrelationFactor> corr);
167  SharedMatrix ao_f12_scaled(std::shared_ptr<CorrelationFactor> corr,
168  std::shared_ptr<BasisSet> bs1,
169  std::shared_ptr<BasisSet> bs2,
170  std::shared_ptr<BasisSet> bs3,
171  std::shared_ptr<BasisSet> bs4);
173  SharedMatrix ao_f12_squared(std::shared_ptr<CorrelationFactor> corr);
174  SharedMatrix ao_f12_squared(std::shared_ptr<CorrelationFactor> corr,
175  std::shared_ptr<BasisSet> bs1,
176  std::shared_ptr<BasisSet> bs2,
177  std::shared_ptr<BasisSet> bs3,
178  std::shared_ptr<BasisSet> bs4);
180  SharedMatrix ao_f12g12(std::shared_ptr<CorrelationFactor> corr);
182  SharedMatrix ao_f12_double_commutator(std::shared_ptr<CorrelationFactor> corr);
185  SharedMatrix ao_3coverlap(std::shared_ptr<BasisSet> bs1,
186  std::shared_ptr<BasisSet> bs2,
187  std::shared_ptr<BasisSet> bs3);
188 
199  SharedMatrix mo_f12(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
201  SharedMatrix mo_f12_squared(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
203  SharedMatrix mo_f12g12(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
205  SharedMatrix mo_f12_double_commutator(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
206 
209  SharedMatrix mo_erf_eri(double omega, SharedMatrix Cocc, SharedMatrix Cvir);
210 
215 
218  // JWM 4/3/2015
219  SharedMatrix ao_overlap(std::shared_ptr<BasisSet>, std::shared_ptr<BasisSet>);
222  SharedMatrix ao_kinetic(std::shared_ptr<BasisSet>, std::shared_ptr<BasisSet>);
225  SharedMatrix ao_potential(std::shared_ptr<BasisSet>, std::shared_ptr<BasisSet>);
228  SharedMatrix ao_ecp(std::shared_ptr<BasisSet>, std::shared_ptr<BasisSet>);
232  SharedMatrix ao_dkh(int dkh_order = -1);
234  SharedMatrix so_dkh(int dkh_order = -1);
236  std::vector<SharedMatrix> ao_dipole();
238  std::vector<SharedMatrix > ao_quadrupole();
240  std::vector<SharedMatrix > ao_traceless_quadrupole();
242  std::vector<SharedMatrix > ao_angular_momentum();
244  std::vector<SharedMatrix > ao_nabla();
252  SharedMatrix so_potential(bool include_perturbations = true);
254  std::vector<SharedMatrix > so_dipole();
256  std::vector<SharedMatrix > so_nabla();
258  std::vector<SharedMatrix > so_angular_momentum();
260  std::vector<SharedMatrix > so_quadrupole();
262  std::vector<SharedMatrix > so_traceless_quadrupole();
263 
265  std::shared_ptr<CdSalcList> cdsalcs(int needed_irreps=0xF,
266  bool project_out_translations=true,
267  bool project_out_rotations=true);
268 
271  SharedMatrix C3, SharedMatrix C4);
273  void play();
274 };
275 
276 }
277 
278 #endif
void common_init()
Definition: mintshelper.cc:159
std::vector< SharedMatrix > so_dipole()
Vector SO Dipole Integrals.
Definition: mintshelper.cc:1296
OperatorSymmetry operator_symmetry(int order)
Definition: mintshelper.h:101
void play()
Play function.
Definition: mintshelper.cc:1617
std::shared_ptr< Molecule > molecule_
Definition: mintshelper.h:56
std::shared_ptr< CdSalcList > cdsalcs(int needed_irreps=0xF, bool project_out_translations=true, bool project_out_rotations=true)
Returns a CdSalcList object.
Definition: mintshelper.cc:1442
SharedMatrix ao_erfc_eri(double omega)
MO ERFC Omega Integrals.
Definition: mintshelper.cc:784
SharedMatrix ao_helper(const std::string &label, std::shared_ptr< TwoBodyAOInt > ints)
Definition: mintshelper.cc:677
std::shared_ptr< BasisSet > basis
Definition: dx_write.cc:59
void set_rel_basisset(std::shared_ptr< BasisSet > rel_basis)
Definition: mintshelper.h:132
SharedMatrix ao_potential()
AO Potential Integrals.
Definition: mintshelper.cc:550
SharedMatrix mo_spin_eri(SharedMatrix Co, SharedMatrix Cv)
Definition: mintshelper.cc:1122
std::shared_ptr< IntegralFactory > integral_
Definition: mintshelper.h:57
std::vector< SharedMatrix > ao_dipole()
Vector AO Dipole Integrals.
Definition: mintshelper.cc:1376
std::vector< SharedMatrix > ao_quadrupole()
Vector AO Quadrupole Integrals.
Definition: mintshelper.cc:1391
SharedMatrix mo_f12(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12 Integrals.
Definition: mintshelper.cc:933
std::shared_ptr< PSIO > psio_
Definition: mintshelper.h:54
int print_
Definition: mintshelper.h:62
void set_print(int print)
Sets the print level.
Definition: mintshelper.h:109
void set_nthread(int nthread)
Definition: mintshelper.h:110
std::shared_ptr< TwoBodyAOInt > eriInts_
Definition: mintshelper.h:60
SharedMatrix ao_f12_squared(std::shared_ptr< CorrelationFactor > corr)
MO F12 squared Integrals.
Definition: mintshelper.cc:824
SharedMatrix ao_dkh(int dkh_order=-1)
AO DKH Integrals.
Definition: mintshelper.cc:607
void integral_hessians()
Hessian integrals (not implemented)
Definition: mintshelper.cc:427
SharedMatrix mo_f12g12(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12G12 Integrals.
Definition: mintshelper.cc:947
void integrals_erf(double w=-1.0)
Definition: mintshelper.cc:287
std::shared_ptr< BasisSet > basisset() const
Basis set being used.
Definition: mintshelper.cc:204
SharedMatrix so_ecp()
SO ECP Integrals.
Definition: mintshelper.cc:1191
SharedMatrix ao_kinetic()
AO Kinetic Integrals.
Definition: mintshelper.cc:527
std::vector< SharedMatrix > ao_nabla()
Vector AO Nabla Integrals.
Definition: mintshelper.cc:1427
std::shared_ptr< SOBasisSet > sobasisset() const
SO basis set being used.
Definition: mintshelper.cc:209
SharedMatrix mo_f12_squared(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12 squared Integrals.
Definition: mintshelper.cc:940
void integrals_erfc(double w=-1.0)
Definition: mintshelper.cc:319
void integrals()
Molecular integrals (just like cints used to do)
Definition: mintshelper.cc:229
Options & options_
The Options reference for basis sets and things.
Definition: mintshelper.h:53
SharedMatrix mo_spin_eri_helper(SharedMatrix Iso, int n1, int n2)
In-core builds spin eri&#39;s.
Definition: mintshelper.cc:1133
SharedMatrix so_dkh(int dkh_order=-1)
SO DKH Integrals.
Definition: mintshelper.cc:670
SharedMatrix ao_erf_eri(double omega)
AO ERF Integrals.
Definition: mintshelper.cc:755
void one_electron_integrals()
Standard one electron integrals (just like oeints used to do)
Definition: mintshelper.cc:352
SharedMatrix ao_3coverlap()
3Center overlap integrals
Definition: mintshelper.cc:882
std::vector< SharedMatrix > ao_traceless_quadrupole()
Vector AO Traceless Quadrupole Integrals.
Definition: mintshelper.cc:1409
static Environment environment
Definition: process.h:138
SharedMatrix ao_eri_shell(int M, int N, int P, int Q)
AO ERI Shell.
Definition: mintshelper.cc:776
int nbf() const
Returns the number of basis functions.
Definition: mintshelper.cc:224
std::vector< SharedMatrix > so_angular_momentum()
Vector SO Angular Momentum Integrals.
Definition: mintshelper.cc:1348
int nthread_
Definition: mintshelper.h:63
Definition: mintshelper.h:117
std::vector< SharedMatrix > so_nabla()
Vector SO Nabla Integrals.
Definition: mintshelper.cc:1335
SharedMatrix ao_overlap()
AO Overlap Integrals.
Definition: mintshelper.cc:498
SharedMatrix mo_f12_double_commutator(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12 double commutator Integrals.
Definition: mintshelper.cc:954
SharedMatrix ao_f12_double_commutator(std::shared_ptr< CorrelationFactor > corr)
MO F12 double commutator Integrals.
Definition: mintshelper.cc:912
MintsHelper(std::shared_ptr< BasisSet > basis, Options &options=Process::environment.options, int print=0)
Constructor, using basisset.
Definition: mintshelper.cc:113
SharedMatrix mo_erf_eri(double omega, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO ERI Omega Integrals (Full matrix, not recommended for large systems)
Definition: mintshelper.cc:918
Definition: liboptions.h:360
SharedMatrix ao_f12(std::shared_ptr< CorrelationFactor > corr)
MO F12 Integrals.
Definition: mintshelper.cc:790
void init_helper(std::shared_ptr< Wavefunction > wavefunction=std::shared_ptr< Wavefunction >())
Definition: mintshelper.cc:129
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
SharedMatrix so_potential(bool include_perturbations=true)
SO Potential Integrals.
Definition: mintshelper.cc:1211
SharedMatrix ao_pvp()
AO pVp Integrals.
Definition: mintshelper.cc:596
SharedMatrix mo_eri(SharedMatrix Cocc, SharedMatrix Cvir)
Definition: mintshelper.cc:976
SharedMatrix ao_f12_scaled(std::shared_ptr< CorrelationFactor > corr)
MO F12 Integrals.
Definition: mintshelper.cc:807
std::shared_ptr< BasisSet > rel_basisset_
Definition: mintshelper.h:61
Definition: mintshelper.h:49
std::shared_ptr< MatrixFactory > factory() const
Matrix factory being used.
Definition: mintshelper.cc:214
SharedMatrix ao_ecp()
AO ECP Integrals.
Definition: mintshelper.cc:573
std::vector< SharedMatrix > ao_angular_momentum()
Vector AO Angular Momentum Integrals.
Definition: mintshelper.cc:1361
SharedMatrix mo_erfc_eri(double omega, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO ERFC Omega Integrals.
Definition: mintshelper.cc:926
SharedMatrix mo_transform(SharedMatrix Iso, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
N^5 ao-&gt;mo transform, in memory, smart indexing.
Definition: mintshelper.cc:1452
SharedMatrix ao_f12g12(std::shared_ptr< CorrelationFactor > corr)
MO F12G12 Integrals.
Definition: mintshelper.cc:906
SharedMatrix ao_shell_getter(const std::string &label, std::shared_ptr< TwoBodyAOInt > ints, int M, int N, int P, int Q)
Definition: mintshelper.cc:726
~MintsHelper()
Destructor, does nothing.
Definition: mintshelper.cc:125
SharedMatrix ao_eri()
AO ERI Integrals (Full matrix, not recommended for large systems)
Definition: mintshelper.cc:760
Definition: pointgrp.h:113
Definition: multipolesymmetry.h:42
std::shared_ptr< PetiteList > petite_list() const
Returns petite list that is capable of transforming basis functions (nbf) to SO&#39;s.
Definition: mintshelper.cc:192
std::shared_ptr< MatrixFactory > factory_
Definition: mintshelper.h:55
std::vector< SharedMatrix > so_quadrupole()
Vector SO Quadrupole Integrals.
Definition: mintshelper.cc:1309
std::shared_ptr< SOBasisSet > sobasis_
Definition: mintshelper.h:59
SharedMatrix mo_eri_helper(SharedMatrix Iso, SharedMatrix Co, SharedMatrix Cv)
Definition: mintshelper.cc:1055
double cutoff_
Value which any two-electron integral is below is discarded.
Definition: mintshelper.h:66
Definition: mintshelper.h:116
std::vector< SharedMatrix > so_traceless_quadrupole()
Vector SO Traceless Quadrupole Integrals.
Definition: mintshelper.cc:1322
SharedMatrix so_kinetic()
SO Kinetic Integrals.
Definition: mintshelper.cc:1178
void integral_gradients()
Derivative integrals (not implemented)
Definition: mintshelper.cc:422
void one_body_ao_computer(std::vector< std::shared_ptr< OneBodyAOInt >> obv, SharedMatrix out, bool symm)
Definition: mintshelper.cc:432
SharedMatrix ao_3coverlap_helper(const std::string &label, std::shared_ptr< ThreeCenterOverlapInt > ints)
Definition: mintshelper.cc:841
std::shared_ptr< BasisSet > basisset_
Definition: mintshelper.h:58
std::shared_ptr< IntegralFactory > integral() const
Integral factory being used.
Definition: mintshelper.cc:219
SharedMatrix so_overlap()
SO Overlap Integrals.
Definition: mintshelper.cc:1165