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 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 #ifndef _psi_src_lib_libmints_helper_h
29 #define _psi_src_lib_libmints_helper_h
30 
31 #include <vector>
34 
35 namespace psi {
36 
37 class Options;
38 class CdSalcList;
39 class CorrelationFactor;
40 class TwoBodyAOInt;
41 class PetiteList;
42 class ThreeCenterOverlapInt;
43 class OneBodyAOInt;
44 class OneBodySOInt;
45 
50 class MintsHelper {
51 
52 private:
55  std::shared_ptr<PSIO> psio_;
56  std::shared_ptr<MatrixFactory> factory_;
57  std::shared_ptr<Molecule> molecule_;
58  std::shared_ptr<IntegralFactory> integral_;
59  std::shared_ptr<BasisSet> basisset_;
60  std::shared_ptr<SOBasisSet> sobasis_;
61  std::shared_ptr<TwoBodyAOInt> eriInts_;
62  std::shared_ptr<BasisSet> rel_basisset_;
63  int print_;
64  int nthread_;
65 
67  double cutoff_;
68 
69  // In-core O(N^5) transqt
71  // In-core O(N^5) transqt
73  SharedMatrix C3, SharedMatrix C4);
75  SharedMatrix mo_spin_eri_helper(SharedMatrix Iso, int n1, int n2);
76 
77 
78  SharedMatrix ao_helper(const std::string& label, std::shared_ptr<TwoBodyAOInt> ints);
79  SharedMatrix ao_shell_getter(const std::string& label, std::shared_ptr<TwoBodyAOInt> ints, int M, int N, int P, int Q);
80 
81  SharedMatrix ao_3coverlap_helper(const std::string &label, std::shared_ptr<ThreeCenterOverlapInt> ints);
82 
83  void common_init();
84 
85  void one_body_ao_computer(std::vector<std::shared_ptr<OneBodyAOInt>> obv, SharedMatrix out, bool symm);
86 
87 public:
88 
89  void init_helper(std::shared_ptr<Wavefunction> wavefunction = std::shared_ptr<Wavefunction>());
90  void init_helper(std::shared_ptr<BasisSet> basis);
91 
93  MintsHelper(std::shared_ptr<BasisSet> basis,
94  Options& options = Process::environment.options,
95  int print = 0);
96 
98  MintsHelper(std::shared_ptr<Wavefunction> wavefunction);
100  ~MintsHelper();
101 
103  return OperatorSymmetry(order, molecule_, integral_, factory_);
104  }
105 
107  int nbf() const;
108 
110  void set_print(int print) {print_ = print; }
111  void set_nthread(int nthread) {nthread_ = nthread; }
112 
114  std::shared_ptr<PetiteList> petite_list() const;
115 
116  enum {
118  kFromBF = false
119  };
123  std::shared_ptr<PetiteList> petite_list(bool include_pure_transform) const;
125  std::shared_ptr<BasisSet> basisset() const;
127  std::shared_ptr<SOBasisSet> sobasisset() const;
129  std::shared_ptr<MatrixFactory> factory() const;
131  std::shared_ptr<IntegralFactory> integral() const;
132 
133  void set_rel_basisset(std::shared_ptr<BasisSet> rel_basis) { rel_basisset_ = rel_basis; }
134 
136  void integrals();
137  void integrals_erf(double w = -1.0);
138  void integrals_erfc(double w = -1.0);
139 
141  void one_electron_integrals();
143  void integral_gradients();
145  void integral_hessians();
146 
149  SharedMatrix ao_eri(std::shared_ptr<BasisSet> bs1,
150  std::shared_ptr<BasisSet> bs2,
151  std::shared_ptr<BasisSet> bs3,
152  std::shared_ptr<BasisSet> bs4);
154  SharedMatrix ao_eri_shell(int M, int N, int P, int Q);
156  SharedMatrix ao_erf_eri(double omega);
158  SharedMatrix ao_erfc_eri(double omega);
160  SharedMatrix ao_f12(std::shared_ptr<CorrelationFactor> corr);
161  SharedMatrix ao_f12(std::shared_ptr<CorrelationFactor> corr,
162  std::shared_ptr<BasisSet> bs1,
163  std::shared_ptr<BasisSet> bs2,
164  std::shared_ptr<BasisSet> bs3,
165  std::shared_ptr<BasisSet> bs4);
167  SharedMatrix ao_f12_scaled(std::shared_ptr<CorrelationFactor> corr);
168  SharedMatrix ao_f12_scaled(std::shared_ptr<CorrelationFactor> corr,
169  std::shared_ptr<BasisSet> bs1,
170  std::shared_ptr<BasisSet> bs2,
171  std::shared_ptr<BasisSet> bs3,
172  std::shared_ptr<BasisSet> bs4);
174  SharedMatrix ao_f12_squared(std::shared_ptr<CorrelationFactor> corr);
175  SharedMatrix ao_f12_squared(std::shared_ptr<CorrelationFactor> corr,
176  std::shared_ptr<BasisSet> bs1,
177  std::shared_ptr<BasisSet> bs2,
178  std::shared_ptr<BasisSet> bs3,
179  std::shared_ptr<BasisSet> bs4);
181  SharedMatrix ao_f12g12(std::shared_ptr<CorrelationFactor> corr);
183  SharedMatrix ao_f12_double_commutator(std::shared_ptr<CorrelationFactor> corr);
186  SharedMatrix ao_3coverlap(std::shared_ptr<BasisSet> bs1,
187  std::shared_ptr<BasisSet> bs2,
188  std::shared_ptr<BasisSet> bs3);
189 
200  SharedMatrix mo_f12(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
202  SharedMatrix mo_f12_squared(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
204  SharedMatrix mo_f12g12(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
206  SharedMatrix mo_f12_double_commutator(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
207 
210  SharedMatrix mo_erf_eri(double omega, SharedMatrix Cocc, SharedMatrix Cvir);
211 
216 
219  // JWM 4/3/2015
220  SharedMatrix ao_overlap(std::shared_ptr<BasisSet>, std::shared_ptr<BasisSet>);
223  SharedMatrix ao_kinetic(std::shared_ptr<BasisSet>, std::shared_ptr<BasisSet>);
226  SharedMatrix ao_potential(std::shared_ptr<BasisSet>, std::shared_ptr<BasisSet>);
230  SharedMatrix ao_dkh(int dkh_order = -1);
232  SharedMatrix so_dkh(int dkh_order = -1);
234  std::vector<SharedMatrix> ao_dipole();
236  std::vector<SharedMatrix > ao_angular_momentum();
238  std::vector<SharedMatrix > ao_nabla();
244  SharedMatrix so_potential(bool include_perturbations = true);
246  std::vector<SharedMatrix > so_dipole();
248  std::vector<SharedMatrix > so_nabla();
250  std::vector<SharedMatrix > so_angular_momentum();
252  std::vector<SharedMatrix > so_quadrupole();
254  std::vector<SharedMatrix > so_traceless_quadrupole();
255 
257  std::shared_ptr<CdSalcList> cdsalcs(int needed_irreps=0xF,
258  bool project_out_translations=true,
259  bool project_out_rotations=true);
260 
263  SharedMatrix C3, SharedMatrix C4);
265  void play();
266 };
267 
268 }
269 
270 #endif
void common_init()
Definition: mintshelper.cc:158
std::vector< SharedMatrix > so_dipole()
Vector SO Dipole Integrals.
Definition: mintshelper.cc:1233
OperatorSymmetry operator_symmetry(int order)
Definition: mintshelper.h:102
void play()
Play function.
Definition: mintshelper.cc:1518
std::shared_ptr< Molecule > molecule_
Definition: mintshelper.h:57
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:1343
SharedMatrix ao_erfc_eri(double omega)
MO ERFC Omega Integrals.
Definition: mintshelper.cc:745
SharedMatrix ao_helper(const std::string &label, std::shared_ptr< TwoBodyAOInt > ints)
Definition: mintshelper.cc:638
std::shared_ptr< BasisSet > basis
Definition: dx_write.cc:58
void set_rel_basisset(std::shared_ptr< BasisSet > rel_basis)
Definition: mintshelper.h:133
SharedMatrix ao_potential()
AO Potential Integrals.
Definition: mintshelper.cc:549
SharedMatrix mo_spin_eri(SharedMatrix Co, SharedMatrix Cv)
Definition: mintshelper.cc:1084
std::shared_ptr< IntegralFactory > integral_
Definition: mintshelper.h:58
std::vector< SharedMatrix > ao_dipole()
Vector AO Dipole Integrals.
Definition: mintshelper.cc:1313
SharedMatrix mo_f12(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12 Integrals.
Definition: mintshelper.cc:895
std::shared_ptr< PSIO > psio_
Definition: mintshelper.h:55
int print_
Definition: mintshelper.h:63
void set_print(int print)
Sets the print level.
Definition: mintshelper.h:110
void set_nthread(int nthread)
Definition: mintshelper.h:111
std::shared_ptr< TwoBodyAOInt > eriInts_
Definition: mintshelper.h:61
SharedMatrix ao_f12_squared(std::shared_ptr< CorrelationFactor > corr)
MO F12 squared Integrals.
Definition: mintshelper.cc:785
SharedMatrix ao_dkh(int dkh_order=-1)
AO DKH Integrals.
Definition: mintshelper.cc:583
void integral_hessians()
Hessian integrals (not implemented)
Definition: mintshelper.cc:426
SharedMatrix mo_f12g12(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12G12 Integrals.
Definition: mintshelper.cc:909
void integrals_erf(double w=-1.0)
Definition: mintshelper.cc:286
std::shared_ptr< BasisSet > basisset() const
Basis set being used.
Definition: mintshelper.cc:203
SharedMatrix ao_kinetic()
AO Kinetic Integrals.
Definition: mintshelper.cc:526
std::vector< SharedMatrix > ao_nabla()
Vector AO Nabla Integrals.
Definition: mintshelper.cc:1328
std::shared_ptr< SOBasisSet > sobasisset() const
SO basis set being used.
Definition: mintshelper.cc:208
SharedMatrix mo_f12_squared(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12 squared Integrals.
Definition: mintshelper.cc:902
void integrals_erfc(double w=-1.0)
Definition: mintshelper.cc:318
void integrals()
Molecular integrals (just like cints used to do)
Definition: mintshelper.cc:228
Options & options_
The Options reference for basis sets and things.
Definition: mintshelper.h:54
SharedMatrix mo_spin_eri_helper(SharedMatrix Iso, int n1, int n2)
In-core builds spin eri&#39;s.
Definition: mintshelper.cc:1095
SharedMatrix so_dkh(int dkh_order=-1)
SO DKH Integrals.
Definition: mintshelper.cc:631
SharedMatrix ao_erf_eri(double omega)
AO ERF Integrals.
Definition: mintshelper.cc:716
void one_electron_integrals()
Standard one electron integrals (just like oeints used to do)
Definition: mintshelper.cc:351
SharedMatrix ao_3coverlap()
3Center overlap integrals
Definition: mintshelper.cc:843
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:737
int nbf() const
Returns the number of basis functions.
Definition: mintshelper.cc:223
std::vector< SharedMatrix > so_angular_momentum()
Vector SO Angular Momentum Integrals.
Definition: mintshelper.cc:1285
int nthread_
Definition: mintshelper.h:64
Definition: mintshelper.h:118
std::vector< SharedMatrix > so_nabla()
Vector SO Nabla Integrals.
Definition: mintshelper.cc:1272
SharedMatrix ao_overlap()
AO Overlap Integrals.
Definition: mintshelper.cc:497
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:916
SharedMatrix ao_f12_double_commutator(std::shared_ptr< CorrelationFactor > corr)
MO F12 double commutator Integrals.
Definition: mintshelper.cc:874
MintsHelper(std::shared_ptr< BasisSet > basis, Options &options=Process::environment.options, int print=0)
Constructor, using basisset.
Definition: mintshelper.cc:112
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:880
Definition: liboptions.h:359
SharedMatrix ao_f12(std::shared_ptr< CorrelationFactor > corr)
MO F12 Integrals.
Definition: mintshelper.cc:751
void init_helper(std::shared_ptr< Wavefunction > wavefunction=std::shared_ptr< Wavefunction >())
Definition: mintshelper.cc:128
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
SharedMatrix so_potential(bool include_perturbations=true)
SO Potential Integrals.
Definition: mintshelper.cc:1153
SharedMatrix ao_pvp()
AO pVp Integrals.
Definition: mintshelper.cc:572
SharedMatrix mo_eri(SharedMatrix Cocc, SharedMatrix Cvir)
Definition: mintshelper.cc:938
SharedMatrix ao_f12_scaled(std::shared_ptr< CorrelationFactor > corr)
MO F12 Integrals.
Definition: mintshelper.cc:768
std::shared_ptr< BasisSet > rel_basisset_
Definition: mintshelper.h:62
Definition: mintshelper.h:50
std::shared_ptr< MatrixFactory > factory() const
Matrix factory being used.
Definition: mintshelper.cc:213
std::vector< SharedMatrix > ao_angular_momentum()
Vector AO Angular Momentum Integrals.
Definition: mintshelper.cc:1298
SharedMatrix mo_erfc_eri(double omega, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO ERFC Omega Integrals.
Definition: mintshelper.cc:888
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:1353
SharedMatrix ao_f12g12(std::shared_ptr< CorrelationFactor > corr)
MO F12G12 Integrals.
Definition: mintshelper.cc:868
SharedMatrix ao_shell_getter(const std::string &label, std::shared_ptr< TwoBodyAOInt > ints, int M, int N, int P, int Q)
Definition: mintshelper.cc:687
~MintsHelper()
Destructor, does nothing.
Definition: mintshelper.cc:124
SharedMatrix ao_eri()
AO ERI Integrals (Full matrix, not recommended for large systems)
Definition: mintshelper.cc:721
Definition: pointgrp.h:112
Definition: multipolesymmetry.h:41
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:191
std::shared_ptr< MatrixFactory > factory_
Definition: mintshelper.h:56
std::vector< SharedMatrix > so_quadrupole()
Vector SO Quadrupole Integrals.
Definition: mintshelper.cc:1246
std::shared_ptr< SOBasisSet > sobasis_
Definition: mintshelper.h:60
SharedMatrix mo_eri_helper(SharedMatrix Iso, SharedMatrix Co, SharedMatrix Cv)
Definition: mintshelper.cc:1017
double cutoff_
Value which any two-electron integral is below is discarded.
Definition: mintshelper.h:67
Definition: mintshelper.h:117
std::vector< SharedMatrix > so_traceless_quadrupole()
Vector SO Traceless Quadrupole Integrals.
Definition: mintshelper.cc:1259
SharedMatrix so_kinetic()
SO Kinetic Integrals.
Definition: mintshelper.cc:1140
void integral_gradients()
Derivative integrals (not implemented)
Definition: mintshelper.cc:421
void one_body_ao_computer(std::vector< std::shared_ptr< OneBodyAOInt >> obv, SharedMatrix out, bool symm)
Definition: mintshelper.cc:431
SharedMatrix ao_3coverlap_helper(const std::string &label, std::shared_ptr< ThreeCenterOverlapInt > ints)
Definition: mintshelper.cc:802
std::shared_ptr< BasisSet > basisset_
Definition: mintshelper.h:59
std::shared_ptr< IntegralFactory > integral() const
Integral factory being used.
Definition: mintshelper.cc:218
SharedMatrix so_overlap()
SO Overlap Integrals.
Definition: mintshelper.cc:1127