Psi4
jk.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 JK_H
29 #define JK_H
30 
31 #include <vector>
32  #include "psi4/pragma.h"
33  PRAGMA_WARNING_PUSH
34  PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS
35  #include <memory>
37 #include "psi4/libmints/typedefs.h"
39 
40 namespace psi {
41 class MinimalInterface;
42 class GPUDFJKHelper;
43 class BasisSet;
44 class Matrix;
45 class IntegralFactory;
46 class ERISieve;
47 class TwoBodyAOInt;
48 class Options;
49 class FittingMetric;
50 class PSIO;
51 
52 namespace pk {
53 class PKManager;
54 }
55 
56 // => BASE CLASS <= //
57 
228 class JK {
229 
230 protected:
231 
232  // => Utility Variables <= //
233 
235  int print_;
237  int debug_;
239  int bench_;
241  unsigned long int memory_;
245  double cutoff_;
248 
249  // => Tasks <= //
250 
252  bool do_J_;
254  bool do_K_;
256  bool do_wK_;
257 
259  double omega_;
260 
263 
264  // => Architecture-Level State Variables (Spatial Symmetry) <= //
265 
267  std::vector<SharedMatrix > C_left_;
269  std::vector<SharedMatrix > C_right_;
271  std::vector<SharedMatrix > D_;
273  std::vector<SharedMatrix > J_;
275  std::vector<SharedMatrix > K_;
277  std::vector<SharedMatrix > wK_;
278 
279  // => Microarchitecture-Level State Variables (No Spatial Symmetry) <= //
280 
282  std::shared_ptr<BasisSet> primary_;
286  std::vector<SharedMatrix > C_left_ao_;
288  std::vector<SharedMatrix > C_right_ao_;
290  std::vector<SharedMatrix > D_ao_;
292  std::vector<SharedMatrix > J_ao_;
294  std::vector<SharedMatrix > K_ao_;
296  std::vector<SharedMatrix > wK_ao_;
297 
298  // => Per-Iteration Setup/Finalize Routines <= //
299 
301  void compute_D();
303  void USO2AO();
305  void AO2USO();
307  void allocate_JK();
319  void common_init();
320 
321  // => Required Algorithm-Specific Methods <= //
322 
324  virtual void preiterations() = 0;
326  virtual void compute_JK() = 0;
328  virtual void postiterations() = 0;
329 
330  // => Helper Routines <= //
331 
333  unsigned long int memory_overhead() const;
334 
335 public:
336  // => Constructors <= //
337 
351  JK(std::shared_ptr<BasisSet> primary);
352 
354  virtual ~JK();
355 
356 
364  static std::shared_ptr<JK> build_JK(std::shared_ptr<BasisSet> primary, std::shared_ptr<BasisSet> auxiliary,
365  Options& options);
366  static std::shared_ptr<JK> build_JK(std::shared_ptr<BasisSet> primary, std::shared_ptr<BasisSet> auxiliary,
367  Options& options, std::string jk_type);
368 
369 
371  virtual bool C1() const = 0;
372 
373 
374  // => Knobs <= //
375 
389  void set_cutoff(double cutoff) { cutoff_ = cutoff; }
395  void set_memory(unsigned long int memory) { memory_ = memory; }
405  void set_omp_nthread(int omp_nthread) { omp_nthread_ = omp_nthread; }
407  void set_print(int print) { print_ = print; }
409  void set_debug(int debug) { debug_ = debug; }
411  void set_bench(int bench) { bench_ = bench; }
417  void set_do_J(bool do_J) { do_J_ = do_J; }
423  void set_do_K(bool do_K) { do_K_ = do_K; }
429  void set_do_wK(bool do_wK) { do_wK_ = do_wK; }
434  void set_omega(double omega) { omega_ = omega; }
435 
436  // => Computers <= //
437 
443  void initialize();
451  void compute();
458  void finalize();
459 
467 
468  // => Accessors <= //
469 
474  std::vector<SharedMatrix >& C_left() { return C_left_; }
480  std::vector<SharedMatrix >& C_right() { return C_right_; }
481 
490  const std::vector<SharedMatrix >& J() const { return J_; }
499  const std::vector<SharedMatrix >& K() const { return K_; }
508  const std::vector<SharedMatrix >& wK() const { return wK_; }
517  const std::vector<SharedMatrix >& D() const { return D_; }
518 
523  virtual void print_header() const = 0;
524 };
525 
526 // => APPLIED CLASSES <= //
527 
534 class DiskJK : public JK {
535 
537  int* so2index_;
540 
543 
545  virtual bool C1() const { return false; }
547  virtual void preiterations();
549  virtual void compute_JK();
551  virtual void postiterations();
552 
554  void common_init();
555 
556 public:
557  // => Constructors < = //
558 
566  DiskJK(std::shared_ptr<BasisSet> primary, Options& options);
568  virtual ~DiskJK();
569 
570  // => Accessors <= //
571 
576  virtual void print_header() const;
577 };
578 
585 class PKJK : public JK {
586 
588  std::shared_ptr<PSIO> psio_;
589 
592 
594  int pk_file_;
595 
598 
600  std::shared_ptr<pk::PKManager> PKmanager_;
601 
603  virtual bool C1() const;
605  virtual void preiterations();
607  virtual void compute_JK();
609  virtual void postiterations();
610 
612  void common_init();
613 
615  int nso_;
617  int nirrep_;
620 
621 public:
622  // => Constructors < = //
623 
632  PKJK(std::shared_ptr<BasisSet> primary, Options& options);
634  virtual ~PKJK();
635 
636  // => Accessors <= //
637 
642  virtual void print_header() const;
643 };
644 
656 class DirectJK : public JK {
657 
658 protected:
659 
663  std::shared_ptr<ERISieve> sieve_;
664 
665  // => Required Algorithm-Specific Methods <= //
666 
668  virtual bool C1() const { return true; }
670  virtual void preiterations();
672  virtual void compute_JK();
674  virtual void postiterations();
675 
677  void build_JK(std::vector<std::shared_ptr<TwoBodyAOInt> >& ints,
678  std::vector<std::shared_ptr<Matrix> >& D,
679  std::vector<std::shared_ptr<Matrix> >& J,
680  std::vector<std::shared_ptr<Matrix> >& K);
681 
683  void common_init();
684 
685 public:
686  // => Constructors < = //
687 
695  DirectJK(std::shared_ptr<BasisSet> primary);
697  virtual ~DirectJK();
698 
699  // => Knobs <= //
700 
706 
707  // => Accessors <= //
708 
713  virtual void print_header() const;
714 };
715 
729 class GTFockJK: public JK{
730  private:
732  std::shared_ptr<MinimalInterface> Impl_;
733  int NMats_ = 0;
734 
735  protected:
737  virtual bool C1() const { return true; }
739  virtual void preiterations(){}
741  virtual void compute_JK();
743  virtual void postiterations(){}
745  virtual void print_header() const{}
746  public:
760  GTFockJK(std::shared_ptr<psi::BasisSet> Primary,
761  size_t NMats,
762  bool AreSymm);
767  GTFockJK(std::shared_ptr<psi::BasisSet> Primary);
768 };
769 
776 class DFJK : public JK {
777 
778 protected:
779 
780  // => DF-Specific stuff <= //
781 
783  std::shared_ptr<BasisSet> auxiliary_;
785  std::shared_ptr<PSIO> psio_;
787  std::string df_ints_io_;
791  double condition_;
793  unsigned int unit_;
795  bool is_core_;
801  std::shared_ptr<ERISieve> sieve_;
802 
809 
810  // => Temps (built/destroyed in compute_JK) <= //
811  std::shared_ptr<Vector> J_temp_;
812  std::shared_ptr<Vector> D_temp_;
813  std::shared_ptr<Vector> d_temp_;
814 
817  std::vector<SharedMatrix > C_temp_;
818  std::vector<SharedMatrix > Q_temp_;
819 
820  // => Required Algorithm-Specific Methods <= //
821 
823  virtual bool C1() const { return true; }
825  virtual void preiterations();
827  virtual void compute_JK();
829  virtual void postiterations();
830 
832  void common_init();
833 
834  bool is_core() const;
835  unsigned long int memory_temp() const;
836  int max_rows() const;
837  int max_nocc() const;
838  void initialize_temps();
839  void free_temps();
840  void initialize_w_temps();
841  void free_w_temps();
842 
843  // => J <= //
844  virtual void initialize_JK_core();
845  virtual void initialize_JK_disk();
846  virtual void manage_JK_core();
847  virtual void manage_JK_disk();
848  virtual void block_J(double** Qmnp, int naux);
849  virtual void block_K(double** Qmnp, int naux);
850 
851  // => wK <= //
852  virtual void initialize_wK_core();
853  virtual void initialize_wK_disk();
854  virtual void manage_wK_core();
855  virtual void manage_wK_disk();
856  virtual void block_wK(double** Qlmnp, double** Qrmnp, int naux);
857  virtual void rebuild_wK_disk();
858 
859 public:
860  // => Constructors < = //
861 
870  DFJK( std::shared_ptr<BasisSet> primary,
871  std::shared_ptr<BasisSet> auxiliary);
872 
874  virtual ~DFJK();
875 
883 
884  // => Knobs <= //
885 
893  void set_condition(double condition) { condition_ = condition; }
898  void set_unit(unsigned int unit) { unit_ = unit; }
903  void set_df_ints_io(const std::string& val) { df_ints_io_ = val; }
909 
910  // => Accessors <= //
911 
916  virtual void print_header() const;
917 };
924 class CDJK : public DFJK {
925 
926 protected:
927  // the number of cholesky vectors
928  long int ncholesky_;
929 
930  // => Required Algorithm-Specific Methods <= //
931 
932  virtual bool is_core() { return true; }
933 
934  // => J <= //
935  virtual void initialize_JK_core();
936  virtual void initialize_JK_disk();
937  virtual void manage_JK_core();
938 
940 
941  // => Accessors <= //
942 
947  virtual void print_header() const;
948 
949 public:
950  // => Constructors < = //
951 
960  CDJK( std::shared_ptr<BasisSet> primary, double cholesky_tolerance);
961 
963  virtual ~CDJK();
964 
965 };
966 
973 class FastDFJK : public JK {
974 
975 protected:
976 
977  // => DF-Specific stuff <= //
978 
980  std::shared_ptr<BasisSet> auxiliary_;
982  std::shared_ptr<PSIO> psio_;
984  std::string df_ints_io_;
988  double condition_;
990  unsigned int unit_;
992  bool is_core_;
994  std::shared_ptr<ERISieve> sieve_;
996  std::string metric_;
998  double theta_;
1000  std::string domains_;
1002  double bump_R0_;
1004  double bump_R1_;
1005 
1006  // => Required Algorithm-Specific Methods <= //
1007 
1009  virtual bool C1() const { return true; }
1011  virtual void preiterations();
1013  virtual void compute_JK();
1015  virtual void postiterations();
1016 
1018  void common_init();
1019 
1020  // => Local three-center integrals <= //
1021 
1023  std::vector<std::pair<int, int> > atom_pairs_;
1025  std::vector<std::vector<std::pair<int, int> > > shell_pairs_;
1027  std::vector<std::vector<int> > auxiliary_atoms_;
1029  std::vector<std::vector<double> > bump_atoms_;
1031  std::vector<std::shared_ptr<Matrix> > Bpq_;
1032 
1034  std::shared_ptr<Matrix> Z_;
1036  std::shared_ptr<Matrix> Z_LR_;
1037 
1038  std::shared_ptr<Matrix> build_Z(double omega);
1039  void build_atom_pairs();
1040  void build_shell_pairs();
1042  void build_Bpq();
1043  void bump(std::shared_ptr<Matrix> J,
1044  const std::vector<double>& bump_atoms,
1045  const std::vector<int>& auxiliary_atoms,
1046  bool bump_diagonal);
1047  void build_J(std::shared_ptr<Matrix> Z,
1048  const std::vector<std::shared_ptr<Matrix> >& D,
1049  const std::vector<std::shared_ptr<Matrix> >& J);
1050  void build_K(std::shared_ptr<Matrix> Z,
1051  const std::vector<std::shared_ptr<Matrix> >& D,
1052  const std::vector<std::shared_ptr<Matrix> >& K);
1053 
1054 public:
1055  // => Constructors < = //
1056 
1065  FastDFJK( std::shared_ptr<BasisSet> primary,
1066  std::shared_ptr<BasisSet> auxiliary);
1067 
1069  virtual ~FastDFJK();
1070 
1071  // => Knobs <= //
1072 
1080  void set_condition(double condition) { condition_ = condition; }
1086  void set_df_metric(const std::string& metric) { metric_ = metric; }
1092  void set_df_domains(const std::string domains) { domains_ = domains; }
1097  void set_df_bump_R0(double R0) { bump_R0_ = R0; }
1102  void set_df_bump_R1(double R1) { bump_R1_ = R1; }
1108  void set_df_theta(double theta) { theta_ = theta; }
1113  void set_unit(unsigned int unit) { unit_ = unit; }
1118  void set_df_ints_io(const std::string& val) { df_ints_io_ = val; }
1124 
1125  // => Accessors <= //
1126 
1131  virtual void print_header() const;
1132 };
1133 
1134 #if 0
1135 
1136  // ==> Deprecated codes <== //
1137 
1149 class DirectJK : public JK {
1150 
1151 protected:
1152 
1154  std::vector<std::shared_ptr<TwoBodyAOInt> > eri_;
1156  std::shared_ptr<IntegralFactory> factory_;
1158  std::shared_ptr<ERISieve> sieve_;
1159 
1160  // => Required Algorithm-Specific Methods <= //
1161 
1163  virtual bool C1() const { return allow_desymmetrization_; }
1165  virtual void preiterations();
1167  virtual void compute_JK();
1169  virtual void postiterations();
1170 
1172  void common_init();
1173 
1174 public:
1175  // => Constructors < = //
1176 
1184  DirectJK(std::shared_ptr<BasisSet> primary);
1186  virtual ~DirectJK();
1187 
1188  // => Accessors <= //
1189 
1194  virtual void print_header() const;
1195 };
1202 class PSJK : public JK {
1203 
1204 protected:
1205 
1207  Options& options_;
1209  std::shared_ptr<BasisSet> dealias_;
1211  int df_ints_num_threads_;
1213  unsigned int unit_;
1215  double theta_;
1217  std::string dealiasing_;
1219  std::shared_ptr<PSIO> psio_;
1221  std::shared_ptr<ERISieve> sieve_;
1223  SharedMatrix Q_;
1225  SharedMatrix R_;
1227  SharedMatrix grid_;
1229  std::vector<std::shared_ptr<TwoBodyAOInt> > ints_4c_;
1231  SharedVector d_;
1233  SharedMatrix V_;
1235  SharedMatrix W_;
1237  SharedVector J_temp_;
1238 
1239  // => Required Algorithm-Specific Methods <= //
1240 
1242  virtual bool C1() const { return true; }
1244  virtual void preiterations();
1246  virtual void compute_JK();
1248  virtual void postiterations();
1249 
1251  void common_init();
1252 
1253  // => Magic <= //
1254  void build_QR();
1255  void build_Amn_disk(double theta, const std::string& entry);
1256  void block_J(double** Qmnp, int Pstart, int nP, const std::vector<SharedMatrix>& J);
1257  void block_K(double** Qmnp, int Pstart, int nP, const std::vector<SharedMatrix>& K);
1258  void build_JK_SR();
1259  void build_JK_LR();
1260 
1261  void build_JK_debug(const std::string& op = "", double theta = 0.0);
1262 
1263  int max_rows();
1264 
1265 public:
1266 
1267  // => Constructors < = //
1268 
1277  PSJK(std::shared_ptr<BasisSet> primary,
1278  Options& options);
1279 
1281  virtual ~PSJK();
1282 
1283  // => Knobs <= //
1284 
1289  void set_df_ints_num_threads(int val) { df_ints_num_threads_ = val; }
1294  void set_theta(double theta) { theta_ = theta; }
1299  void set_dealiasing(const std::string& dealiasing) { dealiasing_ = dealiasing; }
1304  void set_dealias_basis(std::shared_ptr<BasisSet> dealias) { dealias_ = dealias; }
1309  void set_unit(unsigned int unit) { unit_ = unit; }
1310 
1311  // => Accessors <= //
1312 
1317  virtual void print_header() const;
1318 
1319 };
1320 
1321 #endif
1322 
1323 }
1324 #endif
virtual void initialize_JK_core()
Definition: CDJK.cc:72
virtual void compute_JK()
Compute J/K for current C/D.
Definition: PKJK.cc:136
std::shared_ptr< ERISieve > sieve_
Sieve, must be static throughout the life of the object.
Definition: jk.h:801
std::string metric_
Fitting metric (COULOMB or EWALD) [EWALD is SR].
Definition: jk.h:996
virtual void postiterations()
Delete integrals, files, etc.
Definition: FastDFJK.cc:183
int nso_
Total number of SOs.
Definition: jk.h:615
std::shared_ptr< BasisSet > primary_
Primary basis set.
Definition: jk.h:282
PKJK(std::shared_ptr< BasisSet > primary, Options &options)
Definition: PKJK.cc:62
int debug_
Debug flag, defaults to 0.
Definition: jk.h:237
void set_print(int print)
Print flag (defaults to 1)
Definition: jk.h:407
virtual SharedVector iaia(SharedMatrix Ci, SharedMatrix Ca)
Definition: DFJK.cc:82
double cholesky_tolerance_
Definition: jk.h:939
virtual void initialize_JK_disk()
Definition: CDJK.cc:67
Definition: jk.h:534
void common_init()
Definition: jk.cc:231
int * so2index_
Absolute AO index to relative SO index.
Definition: jk.h:537
unsigned long int memory_overhead() const
Memory (doubles) used to hold J/K/wK/C/D and ao versions, at current moment.
Definition: jk.cc:256
void common_init()
Common initialization.
Definition: FastDFJK.cc:73
Derived class extending the JK object to GTFock.
Definition: jk.h:729
int pk_file_
The pk file to use for storing the pk batches.
Definition: jk.h:594
void set_omega(double omega)
Definition: jk.h:434
void set_do_wK(bool do_wK)
Definition: jk.h:429
std::vector< SharedMatrix > & C_right()
Definition: jk.h:480
std::vector< SharedMatrix > Q_temp_
Definition: jk.h:818
std::shared_ptr< Matrix > Z_LR_
The DF long-range Z operator.
Definition: jk.h:1036
unsigned long int memory_temp() const
Definition: DFJK.cc:299
void set_memory(unsigned long int memory)
Definition: jk.h:395
void build_atom_pairs()
Definition: FastDFJK.cc:237
virtual void manage_JK_core()
Definition: CDJK.cc:135
const std::vector< SharedMatrix > & K() const
Definition: jk.h:499
int max_rows_
Maximum number of rows to handle at a time.
Definition: jk.h:797
virtual ~DirectJK()
Destructor.
Definition: DirectJK.cc:65
virtual ~JK()
Destructor.
Definition: jk.cc:65
virtual void postiterations()
Delete integrals, files, etc.
Definition: DiskJK.cc:604
virtual void print_header() const =0
int max_nocc_
Maximum number of nocc in C vectors.
Definition: jk.h:799
Dimension nsopi_
Number of so per irrep.
Definition: jk.h:619
std::string df_ints_io_
Cache action for three-index integrals.
Definition: jk.h:984
void set_omp_nthread(int omp_nthread)
Definition: jk.h:405
void set_df_domains(const std::string domains)
Definition: jk.h:1092
void build_Bpq()
Definition: FastDFJK.cc:404
std::vector< SharedMatrix > wK_ao_
wK matrices: wK_mn = (ml|w|ns) C_li^left C_si^right
Definition: jk.h:296
CDJK(std::shared_ptr< BasisSet > primary, double cholesky_tolerance)
Definition: CDJK.cc:60
std::vector< std::shared_ptr< Matrix > > Bpq_
Three-index tensors (pq|A)(A|B)^-1 for each atom pair.
Definition: jk.h:1031
virtual bool is_core()
Definition: jk.h:932
virtual void print_header() const
Definition: DiskJK.cc:72
DFJK(std::shared_ptr< BasisSet > primary, std::shared_ptr< BasisSet > auxiliary)
Definition: DFJK.cc:61
double omega_
Omega, defaults to 0.0.
Definition: jk.h:259
virtual void initialize_JK_core()
Definition: DFJK.cc:479
SharedMatrix E_left_
Definition: jk.h:815
std::vector< SharedMatrix > C_temp_
Definition: jk.h:817
void set_unit(unsigned int unit)
Definition: jk.h:898
void set_cutoff(double cutoff)
Definition: jk.h:389
int NMats_
Definition: jk.h:733
virtual bool C1() const
Do we need to backtransform to C1 under the hood?
Definition: jk.h:737
std::string domains_
Geometric atom domain selection algorithm.
Definition: jk.h:1000
bool do_wK_
Do wK matrices? Defaults to false.
Definition: jk.h:256
void set_df_bump_R0(double R0)
Definition: jk.h:1097
std::shared_ptr< Vector > D_temp_
Definition: jk.h:812
std::shared_ptr< pk::PKManager > PKmanager_
Class handling the PK integrals.
Definition: jk.h:600
const std::vector< SharedMatrix > & J() const
Definition: jk.h:490
void set_df_ints_num_threads(int val)
Definition: jk.h:1123
std::shared_ptr< MinimalInterface > Impl_
The actual instance that does the implementing.
Definition: jk.h:732
std::vector< SharedMatrix > J_
J matrices: .
Definition: jk.h:273
void set_bench(int bench)
Bench flag (defaults to 0)
Definition: jk.h:411
unsigned int unit_
File number for (Q|mn) tensor.
Definition: jk.h:793
virtual void compute_JK()
Compute J/K for current C/D.
std::vector< std::vector< std::pair< int, int > > > shell_pairs_
Significant shell pairs (reduced triangular indexing P &gt;= Q)
Definition: jk.h:1025
virtual void preiterations()
Setup integrals, files, etc.
Definition: DFJK.cc:419
Definition: PKmanagers.h:86
void allocate_JK()
Allocate J_/K_ should we be using SOs.
Definition: jk.cc:335
void common_init()
Common initialization.
Definition: DiskJK.cc:69
double condition_
Condition cutoff in fitting metric, defaults to 1.0E-12.
Definition: jk.h:988
std::shared_ptr< Vector > d_temp_
Definition: jk.h:813
double bump_R1_
Annihilation radius in MHG bump function.
Definition: jk.h:1004
std::shared_ptr< PSIO > psio_
PSIO object.
Definition: jk.h:785
void set_condition(double condition)
Definition: jk.h:1080
std::vector< SharedMatrix > wK_
wK matrices:
Definition: jk.h:277
int bench_
Bench flag, defaults to 0.
Definition: jk.h:239
double cutoff_
Integral cutoff (defaults to 0.0)
Definition: jk.h:245
virtual void rebuild_wK_disk()
Definition: DFJK.cc:1601
void bump(std::shared_ptr< Matrix > J, const std::vector< double > &bump_atoms, const std::vector< int > &auxiliary_atoms, bool bump_diagonal)
Definition: FastDFJK.cc:567
virtual bool C1() const =0
Do we need to backtransform to C1 under the hood?
std::vector< SharedMatrix > D_ao_
Pseudo-density matrices.
Definition: jk.h:290
std::vector< SharedMatrix > C_right_ao_
Pseudo-occupied C matrices, right side.
Definition: jk.h:288
virtual void manage_JK_core()
Definition: DFJK.cc:1728
virtual void compute_JK()=0
Compute J/K for current C/D.
void set_df_ints_num_threads(int val)
Definition: jk.h:705
int df_ints_num_threads_
Number of threads for DF integrals TODO: DF_INTS_NUM_THREADS.
Definition: jk.h:661
Definition: pointgrp.h:113
virtual bool C1() const
Do we need to backtransform to C1 under the hood?
Definition: jk.h:545
Definition: jk.h:776
void finalize()
Definition: jk.cc:607
std::vector< std::vector< double > > bump_atoms_
Modified MHG bump function, by atom pair and auxiliary basis center.
Definition: jk.h:1029
virtual bool C1() const
Do we need to backtransform to C1 under the hood?
Definition: PKJK.cc:82
const std::vector< SharedMatrix > & wK() const
Definition: jk.h:508
const std::vector< SharedMatrix > & D() const
Definition: jk.h:517
int print_
Print flag, defaults to 1.
Definition: jk.h:235
Options & options_
Options object.
Definition: jk.h:542
std::vector< SharedMatrix > C_left_ao_
Pseudo-occupied C matrices, left side.
Definition: jk.h:286
virtual bool C1() const
Do we need to backtransform to C1 under the hood?
Definition: jk.h:668
void set_condition(double condition)
Definition: jk.h:893
DiskJK(std::shared_ptr< BasisSet > primary, Options &options)
Definition: DiskJK.cc:61
SharedMatrix Qrmn_
(Q|w|mn) for wK (or chunk for disk-based)
Definition: jk.h:808
double theta_
Ewald metric range parameter.
Definition: jk.h:998
void compute()
Definition: jk.cc:554
virtual void initialize_wK_core()
Definition: DFJK.cc:1005
void common_init()
Common initialization.
Definition: DFJK.cc:70
void set_debug(int debug)
Debug flag (defaults to 0)
Definition: jk.h:409
unsigned long int memory_
Memory available, in doubles, defaults to 256 MB (32 M doubles)
Definition: jk.h:241
bool allow_desymmetrization_
Whether to all desymmetrization, for cases when it&#39;s already been performed elsewhere.
Definition: jk.h:247
virtual void preiterations()
Setup integrals, files, etc.
Definition: jk.h:739
void compute_D()
Build the pseudo-density D_, before compute_JK()
Definition: jk.cc:294
virtual void manage_wK_disk()
Definition: DFJK.cc:1783
int nthreads_
The number of threads to be used for integral computation.
Definition: jk.h:597
Options & options_
Options object.
Definition: jk.h:591
Definition: jk.h:585
virtual void compute_JK()
Compute J/K for current C/D.
Definition: DiskJK.cc:110
virtual ~DFJK()
Destructor.
Definition: DFJK.cc:67
int df_ints_num_threads_
Number of threads for DF integrals.
Definition: jk.h:986
std::vector< SharedMatrix > & C_left()
Definition: jk.h:474
Definition: jk.h:656
SharedMatrix AO2USO_
AO2USO transformation matrix.
Definition: jk.h:284
virtual void print_header() const
Definition: DirectJK.cc:75
virtual void preiterations()
Setup integrals, files, etc.
Definition: DirectJK.cc:90
virtual void block_J(double **Qmnp, int naux)
Definition: DFJK.cc:1813
void AO2USO()
Transform finished J_ao_/K_ao_ to J_/K_, after compute_JK()
Definition: jk.cc:505
SharedMatrix E_right_
Definition: jk.h:816
PRAGMA_WARNING_PUSH PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS PRAGMA_WARNING_POP
Definition: integraliter.cc:42
std::string df_ints_io_
Cache action for three-index integrals.
Definition: jk.h:787
virtual ~DiskJK()
Destructor.
Definition: DiskJK.cc:66
bool do_J_
Do J matrices? Defaults to true.
Definition: jk.h:252
bool is_core_
Core or disk?
Definition: jk.h:795
void set_df_theta(double theta)
Definition: jk.h:1108
void set_df_metric(const std::string &metric)
Definition: jk.h:1086
void build_J(std::shared_ptr< Matrix > Z, const std::vector< std::shared_ptr< Matrix > > &D, const std::vector< std::shared_ptr< Matrix > > &J)
Definition: FastDFJK.cc:598
Definition: dimension.h:39
void common_init()
Common initialization.
Definition: DirectJK.cc:68
virtual void print_header() const
I don&#39;t fell the need to further clutter the output...
Definition: jk.h:745
void initialize_w_temps()
Definition: DFJK.cc:375
std::shared_ptr< BasisSet > auxiliary_
Auxiliary basis set.
Definition: jk.h:783
void set_do_J(bool do_J)
Definition: jk.h:417
bool do_K_
Do K matrices? Defaults to true.
Definition: jk.h:254
std::shared_ptr< ERISieve > sieve_
ERI Sieve.
Definition: jk.h:663
std::shared_ptr< BasisSet > auxiliary_
Auxiliary basis set.
Definition: jk.h:980
int max_nocc() const
Definition: DFJK.cc:335
Definition: liboptions.h:359
void common_init()
Common initialization.
Definition: PKJK.cc:73
virtual void preiterations()
Setup integrals, files, etc.
Definition: PKJK.cc:102
void set_allow_desymmetrization(bool t_f)
Definition: jk.h:381
std::vector< SharedMatrix > K_ao_
K matrices: K_mn = (ml|ns) C_li^left C_si^right.
Definition: jk.h:294
void initialize()
Definition: jk.cc:550
static std::shared_ptr< JK > build_JK(std::shared_ptr< BasisSet > primary, std::shared_ptr< BasisSet > auxiliary, Options &options)
Definition: jk.cc:223
void build_JK(std::vector< std::shared_ptr< TwoBodyAOInt > > &ints, std::vector< std::shared_ptr< Matrix > > &D, std::vector< std::shared_ptr< Matrix > > &J, std::vector< std::shared_ptr< Matrix > > &K)
Build the J and K matrices for this integral class.
Definition: DirectJK.cc:146
virtual void postiterations()
Delete integrals, files, etc.
Definition: DFJK.cc:473
void build_auxiliary_partition()
Definition: FastDFJK.cc:285
int omp_nthread_
Number of OpenMP threads (defaults to 1 in no OpenMP, Process::environment.get_n_threads() otherwise)...
Definition: jk.h:243
virtual ~CDJK()
Destructor.
Definition: CDJK.cc:64
virtual bool C1() const
Do we need to backtransform to C1 under the hood?
Definition: jk.h:823
virtual void print_header() const
Definition: FastDFJK.cc:91
JK(std::shared_ptr< BasisSet > primary)
Definition: jk.cc:60
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
void set_unit(unsigned int unit)
Definition: jk.h:1113
FastDFJK(std::shared_ptr< BasisSet > primary, std::shared_ptr< BasisSet > auxiliary)
Definition: FastDFJK.cc:64
SharedMatrix Qlmn_
(Q|P)^-1 (P|mn) for wK (or chunk for disk-based)
Definition: jk.h:806
std::vector< std::pair< int, int > > atom_pairs_
Significant atom pairs (reduced triangular indexing A &gt;= B)
Definition: jk.h:1023
Definition: jk.h:924
void free_temps()
Definition: DFJK.cc:402
virtual void preiterations()=0
Setup integrals, files, etc.
GTFockJK(std::shared_ptr< psi::BasisSet > Primary, size_t NMats, bool AreSymm)
Your public interface to GTFock.
bool is_core() const
Definition: DFJK.cc:283
unsigned int unit_
File number for (Q|mn) tensor.
Definition: jk.h:990
virtual void preiterations()
Setup integrals, files, etc.
Definition: FastDFJK.cc:123
std::shared_ptr< Matrix > build_Z(double omega)
Definition: FastDFJK.cc:193
std::vector< SharedMatrix > K_
K matrices: .
Definition: jk.h:275
std::shared_ptr< Matrix > Z_
The DF Z operator.
Definition: jk.h:1034
std::vector< SharedMatrix > J_ao_
J matrices: J_mn = (mn|ls) C_li^left C_si^right.
Definition: jk.h:292
virtual void preiterations()
Setup integrals, files, etc.
Definition: DiskJK.cc:86
bool is_core_
Core or disk?
Definition: jk.h:992
virtual void initialize_JK_disk()
Definition: DFJK.cc:684
virtual bool C1() const
Do we need to backtransform to C1 under the hood?
Definition: jk.h:1009
int max_rows() const
Definition: DFJK.cc:310
Definition: jk.h:228
std::vector< SharedMatrix > D_
Pseudo-density matrices .
Definition: jk.h:271
virtual void postiterations()
Delete integrals, files, etc.
Definition: DirectJK.cc:142
Definition: pointgrp.h:112
virtual void initialize_wK_disk()
Definition: DFJK.cc:1172
std::vector< std::vector< int > > auxiliary_atoms_
Auxiliary basis centers for each atom pair.
Definition: jk.h:1027
virtual void postiterations()
Delete integrals, files, etc.
Definition: PKJK.cc:160
virtual void block_wK(double **Qlmnp, double **Qrmnp, int naux)
Definition: DFJK.cc:1941
std::vector< SharedMatrix > C_right_
Pseudo-occupied C matrices, right side.
Definition: jk.h:269
DirectJK(std::shared_ptr< BasisSet > primary)
Definition: DirectJK.cc:60
virtual void compute_JK()
Compute J/K for current C/D.
Definition: DFJK.cc:444
void build_K(std::shared_ptr< Matrix > Z, const std::vector< std::shared_ptr< Matrix > > &D, const std::vector< std::shared_ptr< Matrix > > &K)
Definition: FastDFJK.cc:780
virtual void block_K(double **Qmnp, int naux)
Definition: DFJK.cc:1846
void USO2AO()
Transform current C_left_/C_right_/D_ to C_left_ao_/C_right_ao_/D_ao_, before compute_JK() ...
Definition: jk.cc:376
void build_shell_pairs()
Definition: FastDFJK.cc:262
std::shared_ptr< PSIO > psio_
The PSIO instance to use for I/O.
Definition: jk.h:588
virtual ~PKJK()
Destructor.
Definition: PKJK.cc:68
int df_ints_num_threads_
Number of threads for DF integrals.
Definition: jk.h:789
int nirrep_
Number of irreps.
Definition: jk.h:617
virtual void print_header() const
Definition: PKJK.cc:86
virtual ~FastDFJK()
Destructor.
Definition: FastDFJK.cc:70
virtual SharedVector iaia(SharedMatrix Ci, SharedMatrix Ca)
Definition: jk.cc:227
virtual void postiterations()=0
Delete integrals, files, etc.
void set_df_ints_io(const std::string &val)
Definition: jk.h:903
void set_df_bump_R1(double R1)
Definition: jk.h:1102
void set_df_ints_num_threads(int val)
Definition: jk.h:908
virtual void print_header() const
Definition: DFJK.cc:261
virtual void manage_JK_disk()
Definition: DFJK.cc:1744
virtual void print_header() const
Definition: CDJK.cc:151
void set_df_ints_io(const std::string &val)
Definition: jk.h:1118
double condition_
Condition cutoff in fitting metric, defaults to 1.0E-12.
Definition: jk.h:791
int * so2symblk_
Absolute AO index to irrep.
Definition: jk.h:539
void set_do_K(bool do_K)
Definition: jk.h:423
SharedMatrix Qmn_
Main (Q|mn) Tensor (or chunk for disk-based)
Definition: jk.h:804
virtual void compute_JK()
Compute J/K for current C/D.
Definition: FastDFJK.cc:171
Definition: jk.h:973
std::vector< SharedMatrix > C_left_
Pseudo-occupied C matrices, left side.
Definition: jk.h:267
void initialize_temps()
Definition: DFJK.cc:343
bool lr_symmetric_
Left-right symmetric? Determined in each call of compute()
Definition: jk.h:262
long int ncholesky_
Definition: jk.h:928
std::shared_ptr< Vector > SharedVector
Definition: adc.h:52
virtual void compute_JK()
Compute J/K for current C/D.
Definition: DirectJK.cc:94
std::shared_ptr< PSIO > psio_
PSIO object.
Definition: jk.h:982
double bump_R0_
Flat radius in MHG bump function.
Definition: jk.h:1002
virtual void manage_wK_core()
Definition: DFJK.cc:1771
void free_w_temps()
Definition: DFJK.cc:412
std::shared_ptr< Vector > J_temp_
Definition: jk.h:811
std::shared_ptr< ERISieve > sieve_
Sieve, must be static throughout the life of the object.
Definition: jk.h:994
virtual void postiterations()
Delete integrals, files, etc.
Definition: jk.h:743