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 
35 
36 #include <vector>
37 
38 namespace psi {
39 
40 class CdSalcList;
41 class CorrelationFactor;
42 class TwoBodyAOInt;
43 class PetiteList;
44 class ThreeCenterOverlapInt;
45 class OneBodyAOInt;
46 
51 class MintsHelper {
52 
53 private:
56  std::shared_ptr<PSIO> psio_;
57  std::shared_ptr<MatrixFactory> factory_;
58  std::shared_ptr<Molecule> molecule_;
59  std::shared_ptr<IntegralFactory> integral_;
60  std::shared_ptr<BasisSet> basisset_;
61  std::shared_ptr<SOBasisSet> sobasis_;
62  std::shared_ptr<TwoBodyAOInt> eriInts_;
63  std::shared_ptr<BasisSet> rel_basisset_;
64  int print_;
65  int nthread_;
66 
68  double cutoff_;
69 
70  // In-core O(N^5) transqt
72  // In-core O(N^5) transqt
74  SharedMatrix C3, SharedMatrix C4);
76  SharedMatrix mo_spin_eri_helper(SharedMatrix Iso, int n1, int n2);
77 
78 
79  SharedMatrix ao_helper(const std::string& label, std::shared_ptr<TwoBodyAOInt> ints);
80  SharedMatrix ao_shell_getter(const std::string& label, std::shared_ptr<TwoBodyAOInt> ints, int M, int N, int P, int Q);
81 
82  SharedMatrix ao_3coverlap_helper(const std::string &label, std::shared_ptr<ThreeCenterOverlapInt> ints);
83 
84  void common_init();
85 
86  void one_body_ao_computer(std::vector<std::shared_ptr<OneBodyAOInt>> obv, SharedMatrix out, bool symm);
87 
88 public:
89 
90  void init_helper(std::shared_ptr<Wavefunction> wavefunction = std::shared_ptr<Wavefunction>());
91  void init_helper(std::shared_ptr<BasisSet> basis);
92 
94  MintsHelper(std::shared_ptr<BasisSet> basis,
95  Options& options = Process::environment.options,
96  int print = 0);
97 
99  MintsHelper(std::shared_ptr<Wavefunction> wavefunction);
101  ~MintsHelper();
102 
104  return OperatorSymmetry(order, molecule_, integral_, factory_);
105  }
106 
108  int nbf() const;
109 
111  void set_print(int print) {print_ = print; }
112  void set_nthread(int nthread) {nthread_ = nthread; }
113 
115  std::shared_ptr<PetiteList> petite_list() const;
116 
117  enum {
119  kFromBF = false
120  };
124  std::shared_ptr<PetiteList> petite_list(bool include_pure_transform) const;
126  std::shared_ptr<BasisSet> basisset() const;
128  std::shared_ptr<SOBasisSet> sobasisset() const;
130  std::shared_ptr<MatrixFactory> factory() const;
132  std::shared_ptr<IntegralFactory> integral() const;
133 
134  void set_rel_basisset(std::shared_ptr<BasisSet> rel_basis) { rel_basisset_ = rel_basis; }
135 
137  void integrals();
138  void integrals_erf(double w = -1.0);
139  void integrals_erfc(double w = -1.0);
140 
142  void one_electron_integrals();
144  void integral_gradients();
146  void integral_hessians();
147 
150  SharedMatrix ao_eri(std::shared_ptr<BasisSet> bs1,
151  std::shared_ptr<BasisSet> bs2,
152  std::shared_ptr<BasisSet> bs3,
153  std::shared_ptr<BasisSet> bs4);
155  SharedMatrix ao_eri_shell(int M, int N, int P, int Q);
157  SharedMatrix ao_erf_eri(double omega);
159  SharedMatrix ao_erfc_eri(double omega);
161  SharedMatrix ao_f12(std::shared_ptr<CorrelationFactor> corr);
162  SharedMatrix ao_f12(std::shared_ptr<CorrelationFactor> corr,
163  std::shared_ptr<BasisSet> bs1,
164  std::shared_ptr<BasisSet> bs2,
165  std::shared_ptr<BasisSet> bs3,
166  std::shared_ptr<BasisSet> bs4);
168  SharedMatrix ao_f12_scaled(std::shared_ptr<CorrelationFactor> corr);
169  SharedMatrix ao_f12_scaled(std::shared_ptr<CorrelationFactor> corr,
170  std::shared_ptr<BasisSet> bs1,
171  std::shared_ptr<BasisSet> bs2,
172  std::shared_ptr<BasisSet> bs3,
173  std::shared_ptr<BasisSet> bs4);
175  SharedMatrix ao_f12_squared(std::shared_ptr<CorrelationFactor> corr);
176  SharedMatrix ao_f12_squared(std::shared_ptr<CorrelationFactor> corr,
177  std::shared_ptr<BasisSet> bs1,
178  std::shared_ptr<BasisSet> bs2,
179  std::shared_ptr<BasisSet> bs3,
180  std::shared_ptr<BasisSet> bs4);
182  SharedMatrix ao_f12g12(std::shared_ptr<CorrelationFactor> corr);
184  SharedMatrix ao_f12_double_commutator(std::shared_ptr<CorrelationFactor> corr);
187  SharedMatrix ao_3coverlap(std::shared_ptr<BasisSet> bs1,
188  std::shared_ptr<BasisSet> bs2,
189  std::shared_ptr<BasisSet> bs3);
190 
201  SharedMatrix mo_f12(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
203  SharedMatrix mo_f12_squared(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
205  SharedMatrix mo_f12g12(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
207  SharedMatrix mo_f12_double_commutator(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
208 
211  SharedMatrix mo_erf_eri(double omega, SharedMatrix Cocc, SharedMatrix Cvir);
212 
217 
220  // JWM 4/3/2015
221  SharedMatrix ao_overlap(std::shared_ptr<BasisSet>, std::shared_ptr<BasisSet>);
224  SharedMatrix ao_kinetic(std::shared_ptr<BasisSet>, std::shared_ptr<BasisSet>);
227  SharedMatrix ao_potential(std::shared_ptr<BasisSet>, std::shared_ptr<BasisSet>);
230  SharedMatrix ao_ecp(std::shared_ptr<BasisSet>, std::shared_ptr<BasisSet>);
234  SharedMatrix ao_dkh(int dkh_order = -1);
236  SharedMatrix so_dkh(int dkh_order = -1);
238  std::vector<SharedMatrix> ao_dipole();
240  std::vector<SharedMatrix > ao_quadrupole();
242  std::vector<SharedMatrix > ao_traceless_quadrupole();
244  std::vector<SharedMatrix > ao_angular_momentum();
246  std::vector<SharedMatrix > ao_nabla();
254  SharedMatrix so_potential(bool include_perturbations = true);
256  std::vector<SharedMatrix > so_dipole();
258  std::vector<SharedMatrix > so_nabla();
260  std::vector<SharedMatrix > so_angular_momentum();
262  std::vector<SharedMatrix > so_quadrupole();
264  std::vector<SharedMatrix > so_traceless_quadrupole();
265 
267  std::shared_ptr<CdSalcList> cdsalcs(int needed_irreps=0xF,
268  bool project_out_translations=true,
269  bool project_out_rotations=true);
270 
273  SharedMatrix C3, SharedMatrix C4);
275  void play();
276 };
277 
278 }
279 
280 #endif
void common_init()
Definition: mintshelper.cc:165
std::vector< SharedMatrix > so_dipole()
Vector SO Dipole Integrals.
Definition: mintshelper.cc:1301
OperatorSymmetry operator_symmetry(int order)
Definition: mintshelper.h:103
void play()
Play function.
Definition: mintshelper.cc:1622
std::shared_ptr< Molecule > molecule_
Definition: mintshelper.h:58
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:1447
SharedMatrix ao_erfc_eri(double omega)
MO ERFC Omega Integrals.
Definition: mintshelper.cc:789
SharedMatrix ao_helper(const std::string &label, std::shared_ptr< TwoBodyAOInt > ints)
Definition: mintshelper.cc:682
std::shared_ptr< BasisSet > basis
Definition: dx_write.cc:59
void set_rel_basisset(std::shared_ptr< BasisSet > rel_basis)
Definition: mintshelper.h:134
SharedMatrix ao_potential()
AO Potential Integrals.
Definition: mintshelper.cc:556
SharedMatrix mo_spin_eri(SharedMatrix Co, SharedMatrix Cv)
Definition: mintshelper.cc:1127
std::shared_ptr< IntegralFactory > integral_
Definition: mintshelper.h:59
std::vector< SharedMatrix > ao_dipole()
Vector AO Dipole Integrals.
Definition: mintshelper.cc:1381
std::vector< SharedMatrix > ao_quadrupole()
Vector AO Quadrupole Integrals.
Definition: mintshelper.cc:1396
SharedMatrix mo_f12(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12 Integrals.
Definition: mintshelper.cc:938
std::shared_ptr< PSIO > psio_
Definition: mintshelper.h:56
int print_
Definition: mintshelper.h:64
void set_print(int print)
Sets the print level.
Definition: mintshelper.h:111
void set_nthread(int nthread)
Definition: mintshelper.h:112
std::shared_ptr< TwoBodyAOInt > eriInts_
Definition: mintshelper.h:62
SharedMatrix ao_f12_squared(std::shared_ptr< CorrelationFactor > corr)
MO F12 squared Integrals.
Definition: mintshelper.cc:829
SharedMatrix ao_dkh(int dkh_order=-1)
AO DKH Integrals.
Definition: mintshelper.cc:613
void integral_hessians()
Hessian integrals (not implemented)
Definition: mintshelper.cc:433
SharedMatrix mo_f12g12(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12G12 Integrals.
Definition: mintshelper.cc:952
void integrals_erf(double w=-1.0)
Definition: mintshelper.cc:293
std::shared_ptr< BasisSet > basisset() const
Basis set being used.
Definition: mintshelper.cc:210
SharedMatrix so_ecp()
SO ECP Integrals.
Definition: mintshelper.cc:1196
SharedMatrix ao_kinetic()
AO Kinetic Integrals.
Definition: mintshelper.cc:533
std::vector< SharedMatrix > ao_nabla()
Vector AO Nabla Integrals.
Definition: mintshelper.cc:1432
std::shared_ptr< SOBasisSet > sobasisset() const
SO basis set being used.
Definition: mintshelper.cc:215
SharedMatrix mo_f12_squared(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12 squared Integrals.
Definition: mintshelper.cc:945
void integrals_erfc(double w=-1.0)
Definition: mintshelper.cc:325
void integrals()
Molecular integrals (just like cints used to do)
Definition: mintshelper.cc:235
Options & options_
The Options reference for basis sets and things.
Definition: mintshelper.h:55
SharedMatrix mo_spin_eri_helper(SharedMatrix Iso, int n1, int n2)
In-core builds spin eri&#39;s.
Definition: mintshelper.cc:1138
SharedMatrix so_dkh(int dkh_order=-1)
SO DKH Integrals.
Definition: mintshelper.cc:675
SharedMatrix ao_erf_eri(double omega)
AO ERF Integrals.
Definition: mintshelper.cc:760
void one_electron_integrals()
Standard one electron integrals (just like oeints used to do)
Definition: mintshelper.cc:358
SharedMatrix ao_3coverlap()
3Center overlap integrals
Definition: mintshelper.cc:887
std::vector< SharedMatrix > ao_traceless_quadrupole()
Vector AO Traceless Quadrupole Integrals.
Definition: mintshelper.cc:1414
static Environment environment
Definition: process.h:136
SharedMatrix ao_eri_shell(int M, int N, int P, int Q)
AO ERI Shell.
Definition: mintshelper.cc:781
int nbf() const
Returns the number of basis functions.
Definition: mintshelper.cc:230
std::vector< SharedMatrix > so_angular_momentum()
Vector SO Angular Momentum Integrals.
Definition: mintshelper.cc:1353
int nthread_
Definition: mintshelper.h:65
Definition: mintshelper.h:119
std::vector< SharedMatrix > so_nabla()
Vector SO Nabla Integrals.
Definition: mintshelper.cc:1340
SharedMatrix ao_overlap()
AO Overlap Integrals.
Definition: mintshelper.cc:504
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:959
SharedMatrix ao_f12_double_commutator(std::shared_ptr< CorrelationFactor > corr)
MO F12 double commutator Integrals.
Definition: mintshelper.cc:917
MintsHelper(std::shared_ptr< BasisSet > basis, Options &options=Process::environment.options, int print=0)
Constructor, using basisset.
Definition: mintshelper.cc:119
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:923
Definition: liboptions.h:355
SharedMatrix ao_f12(std::shared_ptr< CorrelationFactor > corr)
MO F12 Integrals.
Definition: mintshelper.cc:795
void init_helper(std::shared_ptr< Wavefunction > wavefunction=std::shared_ptr< Wavefunction >())
Definition: mintshelper.cc:135
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
SharedMatrix so_potential(bool include_perturbations=true)
SO Potential Integrals.
Definition: mintshelper.cc:1216
SharedMatrix ao_pvp()
AO pVp Integrals.
Definition: mintshelper.cc:602
SharedMatrix mo_eri(SharedMatrix Cocc, SharedMatrix Cvir)
Definition: mintshelper.cc:981
SharedMatrix ao_f12_scaled(std::shared_ptr< CorrelationFactor > corr)
MO F12 Integrals.
Definition: mintshelper.cc:812
std::shared_ptr< BasisSet > rel_basisset_
Definition: mintshelper.h:63
Definition: mintshelper.h:51
std::shared_ptr< MatrixFactory > factory() const
Matrix factory being used.
Definition: mintshelper.cc:220
SharedMatrix ao_ecp()
AO ECP Integrals.
Definition: mintshelper.cc:579
std::vector< SharedMatrix > ao_angular_momentum()
Vector AO Angular Momentum Integrals.
Definition: mintshelper.cc:1366
SharedMatrix mo_erfc_eri(double omega, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO ERFC Omega Integrals.
Definition: mintshelper.cc:931
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:1457
SharedMatrix ao_f12g12(std::shared_ptr< CorrelationFactor > corr)
MO F12G12 Integrals.
Definition: mintshelper.cc:911
SharedMatrix ao_shell_getter(const std::string &label, std::shared_ptr< TwoBodyAOInt > ints, int M, int N, int P, int Q)
Definition: mintshelper.cc:731
~MintsHelper()
Destructor, does nothing.
Definition: mintshelper.cc:131
SharedMatrix ao_eri()
AO ERI Integrals (Full matrix, not recommended for large systems)
Definition: mintshelper.cc:765
Definition: pointgrp.h:113
Definition: multipolesymmetry.h:44
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:198
std::shared_ptr< MatrixFactory > factory_
Definition: mintshelper.h:57
std::vector< SharedMatrix > so_quadrupole()
Vector SO Quadrupole Integrals.
Definition: mintshelper.cc:1314
std::shared_ptr< SOBasisSet > sobasis_
Definition: mintshelper.h:61
SharedMatrix mo_eri_helper(SharedMatrix Iso, SharedMatrix Co, SharedMatrix Cv)
Definition: mintshelper.cc:1060
double cutoff_
Value which any two-electron integral is below is discarded.
Definition: mintshelper.h:68
Definition: mintshelper.h:118
std::vector< SharedMatrix > so_traceless_quadrupole()
Vector SO Traceless Quadrupole Integrals.
Definition: mintshelper.cc:1327
SharedMatrix so_kinetic()
SO Kinetic Integrals.
Definition: mintshelper.cc:1183
void integral_gradients()
Derivative integrals (not implemented)
Definition: mintshelper.cc:428
void one_body_ao_computer(std::vector< std::shared_ptr< OneBodyAOInt >> obv, SharedMatrix out, bool symm)
Definition: mintshelper.cc:438
SharedMatrix ao_3coverlap_helper(const std::string &label, std::shared_ptr< ThreeCenterOverlapInt > ints)
Definition: mintshelper.cc:846
std::shared_ptr< BasisSet > basisset_
Definition: mintshelper.h:60
std::shared_ptr< IntegralFactory > integral() const
Integral factory being used.
Definition: mintshelper.cc:225
SharedMatrix so_overlap()
SO Overlap Integrals.
Definition: mintshelper.cc:1170