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>> ints, SharedMatrix out, bool symm);
87  void grad_two_center_computer(std::vector<std::shared_ptr<OneBodyAOInt>> ints, SharedMatrix D, SharedMatrix out);
88 
89  public:
90 
91  void init_helper(std::shared_ptr<Wavefunction> wavefunction = std::shared_ptr<Wavefunction>());
92  void init_helper(std::shared_ptr<BasisSet> basis);
93 
95  MintsHelper(std::shared_ptr<BasisSet> basis,
96  Options& options = Process::environment.options,
97  int print = 0);
98 
100  MintsHelper(std::shared_ptr<Wavefunction> wavefunction);
102  ~MintsHelper();
103 
105  return OperatorSymmetry(order, molecule_, integral_, factory_);
106  }
107 
109  int nbf() const;
110 
112  void set_print(int print) {print_ = print; }
113  void set_nthread(int nthread) {nthread_ = nthread; }
114 
116  std::shared_ptr<PetiteList> petite_list() const;
117 
118  enum {
120  kFromBF = false
121  };
125  std::shared_ptr<PetiteList> petite_list(bool include_pure_transform) const;
127  std::shared_ptr<BasisSet> basisset() const;
129  std::shared_ptr<SOBasisSet> sobasisset() const;
131  std::shared_ptr<MatrixFactory> factory() const;
133  std::shared_ptr<IntegralFactory> integral() const;
134 
135  void set_rel_basisset(std::shared_ptr<BasisSet> rel_basis) { rel_basisset_ = rel_basis; }
136 
138  void integrals();
139  void integrals_erf(double w = -1.0);
140  void integrals_erfc(double w = -1.0);
141 
143  void one_electron_integrals();
145  void integral_gradients();
147  void integral_hessians();
148 
151  SharedMatrix ao_eri(std::shared_ptr<BasisSet> bs1,
152  std::shared_ptr<BasisSet> bs2,
153  std::shared_ptr<BasisSet> bs3,
154  std::shared_ptr<BasisSet> bs4);
156  SharedMatrix ao_eri_shell(int M, int N, int P, int Q);
158  SharedMatrix ao_erf_eri(double omega);
160  SharedMatrix ao_erfc_eri(double omega);
162  SharedMatrix ao_f12(std::shared_ptr<CorrelationFactor> corr);
163  SharedMatrix ao_f12(std::shared_ptr<CorrelationFactor> corr,
164  std::shared_ptr<BasisSet> bs1,
165  std::shared_ptr<BasisSet> bs2,
166  std::shared_ptr<BasisSet> bs3,
167  std::shared_ptr<BasisSet> bs4);
169  SharedMatrix ao_f12_scaled(std::shared_ptr<CorrelationFactor> corr);
170  SharedMatrix ao_f12_scaled(std::shared_ptr<CorrelationFactor> corr,
171  std::shared_ptr<BasisSet> bs1,
172  std::shared_ptr<BasisSet> bs2,
173  std::shared_ptr<BasisSet> bs3,
174  std::shared_ptr<BasisSet> bs4);
176  SharedMatrix ao_f12_squared(std::shared_ptr<CorrelationFactor> corr);
177  SharedMatrix ao_f12_squared(std::shared_ptr<CorrelationFactor> corr,
178  std::shared_ptr<BasisSet> bs1,
179  std::shared_ptr<BasisSet> bs2,
180  std::shared_ptr<BasisSet> bs3,
181  std::shared_ptr<BasisSet> bs4);
183  SharedMatrix ao_f12g12(std::shared_ptr<CorrelationFactor> corr);
185  SharedMatrix ao_f12_double_commutator(std::shared_ptr<CorrelationFactor> corr);
188  SharedMatrix ao_3coverlap(std::shared_ptr<BasisSet> bs1,
189  std::shared_ptr<BasisSet> bs2,
190  std::shared_ptr<BasisSet> bs3);
191 
202  SharedMatrix mo_f12(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
204  SharedMatrix mo_f12_squared(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
206  SharedMatrix mo_f12g12(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
208  SharedMatrix mo_f12_double_commutator(std::shared_ptr<CorrelationFactor> corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4);
209 
212  SharedMatrix mo_erf_eri(double omega, SharedMatrix Cocc, SharedMatrix Cvir);
213 
218 
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_efp_multipole_potential(const std::vector<double>& origin={0., 0., 0.}, int deriv=0);
246  std::vector<SharedMatrix> electric_field(const std::vector<double>& origin={0., 0., 0.}, int deriv=0);
248  std::vector<SharedMatrix > ao_angular_momentum();
250  std::vector<SharedMatrix > ao_nabla();
258  SharedMatrix so_potential(bool include_perturbations = true);
260  std::vector<SharedMatrix > so_dipole();
262  std::vector<SharedMatrix > so_nabla();
264  std::vector<SharedMatrix > so_angular_momentum();
266  std::vector<SharedMatrix > so_quadrupole();
268  std::vector<SharedMatrix > so_traceless_quadrupole();
269 
271  std::shared_ptr<CdSalcList> cdsalcs(int needed_irreps=0xF,
272  bool project_out_translations=true,
273  bool project_out_rotations=true);
274 
277  SharedMatrix C3, SharedMatrix C4);
278 
281 
282  // Computes all "core" gradient terms T + V + perturb
284 
288  SharedMatrix perturb_grad(SharedMatrix D, double xlambda, double ylambda, double zlambda);
289 
291  void play();
292 };
293 
294 }
295 
296 #endif
void common_init()
Definition: mintshelper.cc:153
std::vector< SharedMatrix > so_dipole()
Vector SO Dipole Integrals.
Definition: mintshelper.cc:1328
OperatorSymmetry operator_symmetry(int order)
Definition: mintshelper.h:104
void play()
Play function.
Definition: mintshelper.cc:1995
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:1513
SharedMatrix ao_erfc_eri(double omega)
MO ERFC Omega Integrals.
Definition: mintshelper.cc:848
SharedMatrix ao_helper(const std::string &label, std::shared_ptr< TwoBodyAOInt > ints)
Definition: mintshelper.cc:752
void one_body_ao_computer(std::vector< std::shared_ptr< OneBodyAOInt >> ints, SharedMatrix out, bool symm)
Definition: mintshelper.cc:407
std::shared_ptr< BasisSet > basis
Definition: dx_write.cc:59
void set_rel_basisset(std::shared_ptr< BasisSet > rel_basis)
Definition: mintshelper.h:135
SharedMatrix ao_potential()
AO Potential Integrals.
Definition: mintshelper.cc:634
SharedMatrix mo_spin_eri(SharedMatrix Co, SharedMatrix Cv)
Definition: mintshelper.cc:1161
std::shared_ptr< IntegralFactory > integral_
Definition: mintshelper.h:59
std::vector< SharedMatrix > ao_dipole()
Vector AO Dipole Integrals.
Definition: mintshelper.cc:1402
std::vector< SharedMatrix > ao_quadrupole()
Vector AO Quadrupole Integrals.
Definition: mintshelper.cc:1416
SharedMatrix mo_f12(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12 Integrals.
Definition: mintshelper.cc:974
std::shared_ptr< PSIO > psio_
Definition: mintshelper.h:56
std::vector< SharedMatrix > ao_efp_multipole_potential(const std::vector< double > &origin={0., 0., 0.}, int deriv=0)
AO EFP Multipole Potential Integrals.
Definition: mintshelper.cc:1450
int print_
Definition: mintshelper.h:64
void set_print(int print)
Sets the print level.
Definition: mintshelper.h:112
void set_nthread(int nthread)
Definition: mintshelper.h:113
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:879
SharedMatrix ao_dkh(int dkh_order=-1)
AO DKH Integrals.
Definition: mintshelper.cc:687
void integral_hessians()
Hessian integrals (not implemented)
Definition: mintshelper.cc:403
SharedMatrix kinetic_grad(SharedMatrix D)
Definition: mintshelper.cc:1756
SharedMatrix mo_f12g12(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12G12 Integrals.
Definition: mintshelper.cc:988
void integrals_erf(double w=-1.0)
Definition: mintshelper.cc:265
std::shared_ptr< BasisSet > basisset() const
Basis set being used.
Definition: mintshelper.cc:193
SharedMatrix so_ecp()
SO ECP Integrals.
Definition: mintshelper.cc:1226
SharedMatrix ao_kinetic()
AO Kinetic Integrals.
Definition: mintshelper.cc:613
std::vector< SharedMatrix > ao_nabla()
Vector AO Nabla Integrals.
Definition: mintshelper.cc:1499
std::shared_ptr< SOBasisSet > sobasisset() const
SO basis set being used.
Definition: mintshelper.cc:195
SharedMatrix mo_f12_squared(std::shared_ptr< CorrelationFactor > corr, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO F12 squared Integrals.
Definition: mintshelper.cc:981
void integrals_erfc(double w=-1.0)
Definition: mintshelper.cc:296
void integrals()
Molecular integrals (just like cints used to do)
Definition: mintshelper.cc:203
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:1171
SharedMatrix so_dkh(int dkh_order=-1)
SO DKH Integrals.
Definition: mintshelper.cc:746
SharedMatrix ao_erf_eri(double omega)
AO ERF Integrals.
Definition: mintshelper.cc:825
void one_electron_integrals()
Standard one electron integrals (just like oeints used to do)
Definition: mintshelper.cc:328
SharedMatrix ao_3coverlap()
3Center overlap integrals
Definition: mintshelper.cc:930
std::vector< SharedMatrix > ao_traceless_quadrupole()
Vector AO Traceless Quadrupole Integrals.
Definition: mintshelper.cc:1433
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:841
int nbf() const
Returns the number of basis functions.
Definition: mintshelper.cc:201
SharedMatrix core_hamiltonian_grad(SharedMatrix D)
Definition: mintshelper.cc:1984
std::vector< SharedMatrix > so_angular_momentum()
Vector SO Angular Momentum Integrals.
Definition: mintshelper.cc:1376
int nthread_
Definition: mintshelper.h:65
SharedMatrix potential_grad(SharedMatrix D)
Definition: mintshelper.cc:1686
Definition: mintshelper.h:120
std::vector< SharedMatrix > so_nabla()
Vector SO Nabla Integrals.
Definition: mintshelper.cc:1364
SharedMatrix ao_overlap()
AO Overlap Integrals.
Definition: mintshelper.cc:585
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:995
SharedMatrix ao_f12_double_commutator(std::shared_ptr< CorrelationFactor > corr)
MO F12 double commutator Integrals.
Definition: mintshelper.cc:956
MintsHelper(std::shared_ptr< BasisSet > basis, Options &options=Process::environment.options, int print=0)
Constructor, using basisset.
Definition: mintshelper.cc:114
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:961
Definition: liboptions.h:355
SharedMatrix overlap_grad(SharedMatrix D)
Gradient Integrals.
Definition: mintshelper.cc:1766
SharedMatrix ao_f12(std::shared_ptr< CorrelationFactor > corr)
MO F12 Integrals.
Definition: mintshelper.cc:853
void init_helper(std::shared_ptr< Wavefunction > wavefunction=std::shared_ptr< Wavefunction >())
Definition: mintshelper.cc:126
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
SharedMatrix so_potential(bool include_perturbations=true)
SO Potential Integrals.
Definition: mintshelper.cc:1245
SharedMatrix ao_pvp()
AO pVp Integrals.
Definition: mintshelper.cc:677
SharedMatrix mo_eri(SharedMatrix Cocc, SharedMatrix Cvir)
Definition: mintshelper.cc:1014
SharedMatrix ao_f12_scaled(std::shared_ptr< CorrelationFactor > corr)
MO F12 Integrals.
Definition: mintshelper.cc:866
std::vector< SharedMatrix > electric_field(const std::vector< double > &origin={0., 0., 0.}, int deriv=0)
Electric Field Integrals.
Definition: mintshelper.cc:1483
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:197
SharedMatrix ao_ecp()
AO ECP Integrals.
Definition: mintshelper.cc:656
std::vector< SharedMatrix > ao_angular_momentum()
Vector AO Angular Momentum Integrals.
Definition: mintshelper.cc:1388
SharedMatrix mo_erfc_eri(double omega, SharedMatrix C1, SharedMatrix C2, SharedMatrix C3, SharedMatrix C4)
MO ERFC Omega Integrals.
Definition: mintshelper.cc:967
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:1519
SharedMatrix ao_f12g12(std::shared_ptr< CorrelationFactor > corr)
MO F12G12 Integrals.
Definition: mintshelper.cc:951
SharedMatrix ao_shell_getter(const std::string &label, std::shared_ptr< TwoBodyAOInt > ints, int M, int N, int P, int Q)
Definition: mintshelper.cc:796
~MintsHelper()
Destructor, does nothing.
Definition: mintshelper.cc:124
SharedMatrix ao_eri()
AO ERI Integrals (Full matrix, not recommended for large systems)
Definition: mintshelper.cc:829
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:183
std::shared_ptr< MatrixFactory > factory_
Definition: mintshelper.h:57
SharedMatrix perturb_grad(SharedMatrix D)
Definition: mintshelper.cc:1776
std::vector< SharedMatrix > so_quadrupole()
Vector SO Quadrupole Integrals.
Definition: mintshelper.cc:1340
std::shared_ptr< SOBasisSet > sobasis_
Definition: mintshelper.h:61
SharedMatrix mo_eri_helper(SharedMatrix Iso, SharedMatrix Co, SharedMatrix Cv)
Definition: mintshelper.cc:1093
double cutoff_
Value which any two-electron integral is below is discarded.
Definition: mintshelper.h:68
Definition: mintshelper.h:119
std::vector< SharedMatrix > so_traceless_quadrupole()
Vector SO Traceless Quadrupole Integrals.
Definition: mintshelper.cc:1352
SharedMatrix so_kinetic()
SO Kinetic Integrals.
Definition: mintshelper.cc:1214
void integral_gradients()
Derivative integrals (not implemented)
Definition: mintshelper.cc:399
SharedMatrix ao_3coverlap_helper(const std::string &label, std::shared_ptr< ThreeCenterOverlapInt > ints)
Definition: mintshelper.cc:892
void grad_two_center_computer(std::vector< std::shared_ptr< OneBodyAOInt >> ints, SharedMatrix D, SharedMatrix out)
Definition: mintshelper.cc:472
std::shared_ptr< BasisSet > basisset_
Definition: mintshelper.h:60
std::shared_ptr< IntegralFactory > integral() const
Integral factory being used.
Definition: mintshelper.cc:199
SharedMatrix so_overlap()
SO Overlap Integrals.
Definition: mintshelper.cc:1202