Psi4
libdpd/dpd.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-2018 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 
33 #ifndef _psi_src_lib_libdpd_dpd_h
34 #define _psi_src_lib_libdpd_dpd_h
35 
36 #include <cstdio>
37 #include <string>
38 #include "psi4/psifiles.h"
39 #include "psi4/libpsio/config.h"
40 #include "psi4/pragma.h"
41 PRAGMA_WARNING_PUSH
42 PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS
43 #include <memory>
45 #include <vector>
46 #include "psi4/psi4-dec.h"
47 
48 // Testing -TDC
49 #include "dpdmospace.h"
50 
51 namespace psi {
52 
53 #define T3_TIMER_ON (0)
54 
55 #define DPD_BIGNUM 2147483647 /* the four-byte signed int limit */
56 /* #define ALL_BUF4_SORT_OOC */
57 
58 struct dpdparams4 {
59  int nirreps; /* No. of irreps */
60  int pqnum; /* Pair number for the row indices */
61  int rsnum; /* Pair number for the column indices */
62  int *rowtot; /* Row dimension for each irrep */
63  int *coltot; /* Column dimension for each irrep */
64  int **rowidx; /* Row index lookup array */
65  int **colidx; /* Column index lookup array */
66  int ***roworb; /* Row index -> orbital index lookup array */
67  int ***colorb; /* Column index -> orbital index lookup array */
68  int *ppi; /* Number of p indices per irrep */
69  int *qpi; /* Number of q indices per irrep */
70  int *rpi; /* Number of r indices per irrep */
71  int *spi; /* Number of s indices per irrep */
72  int *poff; /* Orbital offset for p */
73  int *qoff; /* Orbital offset for q */
74  int *roff; /* Orbital offset for r */
75  int *soff; /* Orbital offset for s */
76  int *psym; /* Orbital symmetry for index p */
77  int *qsym; /* Orbital symmetry for index q */
78  int *rsym; /* Orbital symmetry for index r */
79  int *ssym; /* Orbital symmetry for index s */
80  int perm_pq; /* Can p and q be permuted? */
81  int perm_rs; /* Can r and s be permuted? */
82  int peq; /* Can p and q be equal? */
83  int res; /* Can r and s be equal? */
84  int **start13; /* returns the starting row of irrep matrix h for orbital index p */
85 };
86 
87 struct dpdfile4 {
88  int dpdnum; /* dpd structure reference */
90  int filenum;
91  int my_irrep; /* Total irrep of this quantity */
92  psio_address *lfiles; /* File address for each submatrix by ROW irrep */
94  int incore;
95  double ***matrix;
96 };
97 
98 struct dpdshift4 {
100  int **rowtot;
101  int **coltot;
102  double ****matrix;
103 };
104 
105 struct dpdbuf4 {
106  int dpdnum; /* dpd structure reference */
107  int anti; /* Is this buffer antisymmetric? */
111  int **row_offset;
112  int **col_offset;
113  double ***matrix;
114 };
115 
116 struct dpdtrans4 {
117  double ***matrix;
120 };
121 
122 struct dpdparams2 {
123  int nirreps; /* No. of irreps */
124  int pnum;
125  int qnum;
126  int *rowtot; /* Row dimension for each submatrix */
127  int *coltot; /* Column dimension for each submatrix */
128  int *rowidx; /* Row index lookup array */
129  int *colidx; /* Column index lookup array */
130  int **roworb; /* Row index -> orbital index lookup array */
131  int **colorb; /* Column index -> orbital index lookup array */
132  int *ppi; /* Number of p indices per irrep */
133  int *qpi; /* Number of q indices per irrep */
134  int *poff; /* Orbital offset for p */
135  int *qoff; /* Orbital offset for q */
136  int *psym; /* Orbital symmetry for index p */
137  int *qsym; /* Orbital symmetry for index q */
138 };
139 
140 struct dpdfile2 {
141  int dpdnum; /* dpd structure reference */
143  int filenum;
144  int my_irrep;
147  int incore;
148  double ***matrix;
149 };
150 
151 /* DPD File4 Cache entries */
153  int dpdnum; /* dpd structure reference */
154  int filenum; /* libpsio unit number */
155  int irrep; /* overall symmetry */
156  int pqnum; /* dpd pq value */
157  int rsnum; /* dpd rs value */
158  char label[PSIO_KEYLEN]; /* libpsio TOC keyword */
159  double ***matrix; /* pointer to irrep blocks */
160  int size; /* size of entry in double words */
161  size_t access; /* access time */
162  size_t usage; /* number of accesses */
163  size_t priority; /* priority level */
164  int lock; /* auto-deletion allowed? */
165  int clean; /* has this file4 changed? */
166  dpd_file4_cache_entry *next; /* pointer to next cache entry */
167  dpd_file4_cache_entry *last; /* pointer to previous cache entry */
168 };
169 
170 /* DPD File2 Cache entries */
172  dpd_file2_cache_entry() : next(nullptr), last(nullptr) {}
173  int dpdnum; /* dpd structure reference */
174  int filenum; /* libpsio unit number */
175  int irrep; /* overall symmetry */
176  int pnum; /* dpd p value */
177  int qnum; /* dpd q value */
178  char label[PSIO_KEYLEN]; /* libpsio TOC keyword */
179  double ***matrix; /* pointer to irrep blocks */
180  int size; /* size of entry in double words */
181  int clean; /* has this file2 changed? */
182  dpd_file2_cache_entry *next; /* pointer to next cache entry */
183  dpd_file2_cache_entry *last; /* pointer to previous cache entry */
184 };
185 
186 /* DPD global parameter set */
187 struct dpd_data {
188  int nirreps;
191  int *numorbs;
192  int **orboff;
193  int **pairtot;
194  int **orbspi;
195  int **orbsym;
196  int **orbidx2;
197  int ***pairidx;
198  int ***orbs2;
199  int ****pairorb;
202 };
203 
204 struct thread_data {
216  int *occpi;
217  int *occ_off;
218  int *virtpi;
219  int *vir_off;
220  double omega;
223  int Gi;
224  int Gj;
225  int Gk;
227  int last_ijk;
228  std::string outfile;
229  int thr_id;
232  int newtrips;
233 };
234 
235 struct dpd_gbl {
236  long int memory; /* Total memory requested by the user */
237  long int memused; /* Total memory used (cache + other) */
238  long int memcache; /* Total memory in cache (locked and unlocked) */
239  long int memlocked; /* Total memory locked in the cache */
240 
241  // The default C'tor will zero everything out properly
243  : file2_cache(nullptr),
244  file4_cache(nullptr),
248  file4_cache_low_del(0) {}
257  int **cachelist;
259 };
260 
261 /* Useful for the generalized 4-index sorting function */
262 enum indices {
287 };
288 
289 /* Useful for the 3-index sorting function dpd_3d_sort() */
290 enum pattern { abc, acb, cab, cba, bca, bac };
291 
292 class PSI_API DPD {
293  public:
294  // These used to live in the dpd_data struct
295  int nirreps;
298  int *numorbs;
299  int **orboff;
300  int **pairtot;
301  int **orbspi;
302  int **orbsym;
303  int **orbidx2;
304  int ***pairidx;
305  int ***orbs2;
306  int ****pairorb;
309 
310  std::vector<DPDMOSpace> moSpaces;
311 
312  DPD(int dpd_num, int nirreps, long int memory, int cachetype, int *cachefiles, int **cachelist,
313  dpd_file4_cache_entry *priority, int num_subspaces, std::vector<int *> &spaceArrays);
314  DPD(int dpd_num, int nirreps, long int memory, int cachetype, int *cachefiles, int **cachelist,
315  dpd_file4_cache_entry *priority, int num_subspaces, std::vector<DPDMOSpace> &moSpaces);
316  DPD();
317 
318  ~DPD();
319 
320  int init(int dpd_num, int nirreps, long int memory, int cachetype, int *cachefiles, int **cachelist,
321  dpd_file4_cache_entry *priority, int num_subspaces, ...);
322  int init(int dpd_num, int nirreps, long int memory, int cachetype, int *cachefiles, int **cachelist,
323  dpd_file4_cache_entry *priority, int num_subspaces, std::vector<int *> &spaceArrays);
324 
325  void dpd_error(const char *caller, std::string out_fname);
326 
327  double **dpd_block_matrix(size_t n, size_t m);
328  void free_dpd_block(double **array, size_t n, size_t m);
329 
330  int contract222(dpdfile2 *X, dpdfile2 *Y, dpdfile2 *Z, int target_X, int target_Y, double alpha, double beta);
331  int contract442(dpdbuf4 *X, dpdbuf4 *Y, dpdfile2 *Z, int target_X, int target_Y, double alpha, double beta);
332  int contract422(dpdbuf4 *X, dpdfile2 *Y, dpdfile2 *Z, int trans_Y, int trans_Z, double alpha, double beta);
333  int contract244(dpdfile2 *X, dpdbuf4 *Y, dpdbuf4 *Z, int sum_X, int sum_Y, int trans_Z, double alpha, double beta);
334  int contract424(dpdbuf4 *X, dpdfile2 *Y, dpdbuf4 *Z, int sum_X, int sum_Y, int trans_Z, double alpha, double beta);
335  int contract444(dpdbuf4 *X, dpdbuf4 *Y, dpdbuf4 *Z, int target_X, int target_Y, double alpha, double beta);
336  int contract444_df(dpdbuf4 *B, dpdbuf4 *tau_in, dpdbuf4 *tau_out, double alpha, double beta);
337 
338  /* Need to consolidate these routines into one general function */
339  int dot23(dpdfile2 *T, dpdbuf4 *I, dpdfile2 *Z, int transt, int transz, double alpha, double beta);
340  int dot24(dpdfile2 *T, dpdbuf4 *I, dpdfile2 *Z, int transt, int transz, double alpha, double beta);
341  int dot13(dpdfile2 *T, dpdbuf4 *I, dpdfile2 *Z, int transt, int transz, double alpha, double beta);
342  int dot14(dpdfile2 *T, dpdbuf4 *I, dpdfile2 *Z, int transt, int transz, double alpha, double beta);
343 
344  int trace42_13(dpdbuf4 *A, dpdfile2 *B, int transb, double alpha, double beta);
345 
346  int file2_init(dpdfile2 *File, int filenum, int irrep, int pnum, int qnum, const char *label);
347  int file2_close(dpdfile2 *File);
348  int file2_mat_init(dpdfile2 *File);
349  int file2_mat_close(dpdfile2 *File);
350  int file2_mat_rd(dpdfile2 *File);
351  int file2_mat_wrt(dpdfile2 *File);
352  int file2_print(dpdfile2 *File, std::string out_fname);
353  int file2_mat_print(dpdfile2 *File, std::string out_fname);
354  int file2_copy(dpdfile2 *InFile, int outfilenum, const char *label);
355  int file2_dirprd(dpdfile2 *FileA, dpdfile2 *FileB);
356  double file2_dot(dpdfile2 *FileA, dpdfile2 *FileB);
357  int file2_scm(dpdfile2 *InFile, double alpha);
358  double file2_dot_self(dpdfile2 *BufX);
359  double file2_trace(dpdfile2 *InFile);
360  int file2_axpy(dpdfile2 *FileA, dpdfile2 *FileB, double alpha, int transA);
361  int file2_axpbycz(dpdfile2 *FileA, dpdfile2 *FileB, dpdfile2 *FileC, double a, double b, double c);
362 
363  int file4_init(dpdfile4 *File, int filenum, int irrep, int pqnum, int rsnum, const char *label);
364  int file4_init_nocache(dpdfile4 *File, int filenum, int irrep, int pqnum, int rsnum, const char *label);
365  int file4_close(dpdfile4 *File);
366  int file4_mat_irrep_init(dpdfile4 *File, int irrep);
367  int file4_mat_irrep_close(dpdfile4 *File, int irrep);
368  int file4_mat_irrep_rd(dpdfile4 *File, int irrep);
369  int file4_mat_irrep_wrt(dpdfile4 *File, int irrep);
370  int file4_mat_irrep_row_init(dpdfile4 *File, int irrep);
371  int file4_mat_irrep_row_close(dpdfile4 *File, int irrep);
372  int file4_mat_irrep_row_rd(dpdfile4 *File, int irrep, int row);
373  int file4_mat_irrep_row_wrt(dpdfile4 *File, int irrep, int row);
374  int file4_mat_irrep_row_zero(dpdfile4 *File, int irrep, int row);
375  int file4_print(dpdfile4 *File, std::string out_fname);
376  int file4_mat_irrep_rd_block(dpdfile4 *File, int irrep, int start_pq, int num_pq);
377  int file4_mat_irrep_wrt_block(dpdfile4 *File, int irrep, int start_pq, int num_pq);
378 
379  int buf4_init(dpdbuf4 *Buf, int inputfile, int irrep, int pqnum, int rsnum, int file_pqnum, int file_rsnum,
380  int anti, const char *label);
381  int buf4_init(dpdbuf4 *Buf, int inputfile, int irrep, std::string pq, std::string rs, std::string file_pq,
382  std::string file_rs, int anti, const char *label);
383  int buf4_init(dpdbuf4 *Buf, int inputfile, int irrep, std::string pq, std::string rs, int anti, const char *label);
384  int pairnum(std::string);
385  double buf4_trace(dpdbuf4 *Buf);
386  int buf4_close(dpdbuf4 *Buf);
387  int buf4_mat_irrep_init(dpdbuf4 *Buf, int irrep);
388  int buf4_mat_irrep_close(dpdbuf4 *Buf, int irrep);
389  int buf4_mat_irrep_rd(dpdbuf4 *Buf, int irrep);
390  int buf4_mat_irrep_wrt(dpdbuf4 *Buf, int irrep);
391  int buf4_print(dpdbuf4 *Buf, std::string out_fname, int print_data);
392  int buf4_copy(dpdbuf4 *InBuf, int outfilenum, const char *label);
393  int buf4_sort(dpdbuf4 *InBuf, int outfilenum, enum indices index, int pqnum, int rsnum, const char *label);
394  int buf4_sort(dpdbuf4 *InBuf, int outfilenum, enum indices index, std::string pq, std::string rs,
395  const char *label);
396  int buf4_sort_ooc(dpdbuf4 *InBuf, int outfilenum, enum indices index, int pqnum, int rsnum, const char *label);
397  int buf4_sort_axpy(dpdbuf4 *InBuf, int outfilenum, enum indices index, int pqnum, int rsnum, const char *label,
398  double alpha);
399  int buf4_axpy(dpdbuf4 *BufX, dpdbuf4 *BufY, double alpha);
400  int buf4_axpbycz(dpdbuf4 *FileA, dpdbuf4 *FileB, dpdbuf4 *FileC, double a, double b, double c);
401  int buf4_dirprd(dpdbuf4 *BufA, dpdbuf4 *BufB);
402  double buf4_dot(dpdbuf4 *BufA, dpdbuf4 *BufB);
403  double buf4_dot_self(dpdbuf4 *BufX);
404  int buf4_scm(dpdbuf4 *InBuf, double alpha);
405  int buf4_scmcopy(dpdbuf4 *InBuf, int outfilenum, const char *label, double alpha);
406  int buf4_symm(dpdbuf4 *Buf);
407  int buf4_symm2(dpdbuf4 *Buf1, dpdbuf4 *Buf2);
408  int buf4_mat_irrep_shift13(dpdbuf4 *Buf, int irrep);
409  int buf4_mat_irrep_shift31(dpdbuf4 *Buf, int irrep);
410  int buf4_mat_irrep_row_init(dpdbuf4 *Buf, int irrep);
411  int buf4_mat_irrep_row_close(dpdbuf4 *Buf, int irrep);
412  int buf4_mat_irrep_row_zero(dpdbuf4 *Buf, int irrep, int row);
413  int buf4_mat_irrep_row_rd(dpdbuf4 *Buf, int irrep, int pq);
414  int buf4_mat_irrep_row_wrt(dpdbuf4 *Buf, int irrep, int pq);
415  int buf4_mat_irrep_init_block(dpdbuf4 *Buf, int irrep, int num_pq);
416  int buf4_mat_irrep_close_block(dpdbuf4 *Buf, int irrep, int num_pq);
417  int buf4_mat_irrep_rd_block(dpdbuf4 *Buf, int irrep, int start_pq, int num_pq);
418  int buf4_mat_irrep_wrt_block(dpdbuf4 *Buf, int irrep, int start_pq, int num_pq);
419  int buf4_dump(dpdbuf4 *DPDBuf, struct iwlbuf *IWLBuf, int *prel, int *qrel, int *rrel, int *srel, int bk_pack,
420  int swap23);
421  int trans4_init(dpdtrans4 *Trans, dpdbuf4 *Buf);
422  int trans4_close(dpdtrans4 *Trans);
423  int trans4_mat_irrep_init(dpdtrans4 *Trans, int irrep);
424  int trans4_mat_irrep_close(dpdtrans4 *Trans, int irrep);
425  int trans4_mat_irrep_rd(dpdtrans4 *Trans, int irrep);
426  int trans4_mat_irrep_wrt(dpdtrans4 *Trans, int irrep);
427  int trans4_mat_irrep_shift13(dpdtrans4 *Trans, int irrep);
428  int trans4_mat_irrep_shift31(dpdtrans4 *Trans, int irrep);
429 
430  int mat4_irrep_print(double **matrix, dpdparams4 *Params, int irrep, int my_irrep, std::string out_fname);
431 
432  void file2_cache_init();
433  void file2_cache_close();
434  void file2_cache_print(std::string out_fname);
435  dpd_file2_cache_entry *file2_cache_scan(int filenum, int irrep, int pnum, int qnum, const char *label, int dpdnum);
436  dpd_file2_cache_entry *dpd_file2_cache_last();
437  int file2_cache_add(dpdfile2 *File);
438  int file2_cache_del(dpdfile2 *File);
439  int file4_cache_del_low();
440  void file2_cache_dirty(dpdfile2 *File);
441 
442  void file4_cache_init();
443  void file4_cache_close();
444  void file4_cache_print(std::string out_fname);
445  void file4_cache_print_screen();
446  int file4_cache_get_priority(dpdfile4 *File);
447 
448  dpd_file4_cache_entry *file4_cache_scan(int filenum, int irrep, int pqnum, int rsnum, const char *label,
449  int dpdnum);
450  dpd_file4_cache_entry *file4_cache_last();
451  int file4_cache_add(dpdfile4 *File, size_t priority);
452  int file4_cache_del(dpdfile4 *File);
453  dpd_file4_cache_entry *file4_cache_find_lru();
454  int file4_cache_del_lru();
455  void file4_cache_dirty(dpdfile4 *File);
456  void file4_cache_lock(dpdfile4 *File);
457  void file4_cache_unlock(dpdfile4 *File);
458 
459  void sort_3d(double ***Win, double ***Wout, int nirreps, int h, int *rowtot, int **rowidx, int ***roworb, int *asym,
460  int *bsym, int *aoff, int *boff, int *cpi, int *coff, int **rowidx_out, enum pattern index, int sum);
461 
462  void T3_AAA(double ***W1, int nirreps, int I, int Gi, int J, int Gj, int K, int Gk, dpdbuf4 *T2, dpdbuf4 *F,
463  dpdbuf4 *E, dpdfile2 *fIJ, dpdfile2 *fAB, int *occpi, int *occ_off, int *virtpi, int *vir_off,
464  double omega);
465 
466  void T3_AAB(double ***W1, int nirreps, int I, int Gi, int J, int Gj, int K, int Gk, dpdbuf4 *T2AA, dpdbuf4 *T2AB,
467  dpdbuf4 *T2BA, dpdbuf4 *FAA, dpdbuf4 *FAB, dpdbuf4 *FBA, dpdbuf4 *EAA, dpdbuf4 *EAB, dpdbuf4 *EBA,
468  dpdfile2 *fIJ, dpdfile2 *fij, dpdfile2 *fAB, dpdfile2 *fab, int *aoccpi, int *aocc_off, int *boccpi,
469  int *bocc_off, int *avirtpi, int *avir_off, int *bvirtpi, int *bvir_off, double omega);
470 
471  void T3_RHF(double ***W1, int nirreps, int I, int Gi, int J, int Gj, int K, int Gk, dpdbuf4 *T2, dpdbuf4 *F,
472  dpdbuf4 *E, dpdfile2 *fIJ, dpdfile2 *fAB, int *occpi, int *occ_off, int *virtpi, int *vir_off,
473  double omega);
474 
475  void T3_RHF_ic(double ***W1, int nirreps, int I, int Gi, int J, int Gj, int K, int Gk, dpdbuf4 *T2, dpdbuf4 *F,
476  dpdbuf4 *E, dpdfile2 *fIJ, dpdfile2 *fAB, int *occpi, int *occ_off, int *virtpi, int *vir_off,
477  double omega);
478 
479  void cc3_sigma_RHF(dpdbuf4 *CIjAb, dpdbuf4 *WAbEi, dpdbuf4 *WMbIj, int do_singles, dpdbuf4 *Dints, dpdfile2 *SIA,
480  int do_doubles, dpdfile2 *FME, dpdbuf4 *WAmEf, dpdbuf4 *WMnIe, dpdbuf4 *SIjAb, int *occpi,
481  int *occ_off, int *virtpi, int *vir_off, double omega, std::string out_fname, int newtrips);
482 
483  void cc3_sigma_RHF_ic(dpdbuf4 *CIjAb, dpdbuf4 *WAbEi, dpdbuf4 *WMbIj, int do_singles, dpdbuf4 *Dints, dpdfile2 *SIA,
484  int do_doubles, dpdfile2 *FME, dpdbuf4 *WAmEf, dpdbuf4 *WMnIe, dpdbuf4 *SIjAb, int *occpi,
485  int *occ_off, int *virtpi, int *vir_off, double omega, std::string out_fname, int nthreads,
486  int newtrips);
487 
488  void cc3_sigma_UHF_AAA(dpdbuf4 *CMNEF, dpdbuf4 *WABEI, dpdbuf4 *WMBIJ, int do_singles, dpdbuf4 *Dints_anti,
489  dpdfile2 *SIA, int do_doubles, dpdfile2 *FME, dpdbuf4 *WMAFE, dpdbuf4 *WMNIE, dpdbuf4 *SIJAB,
490  int *aoccpi, int *aocc_off, int *avirtpi, int *avir_off, double omega,
491  std::string out_fname);
492 
493  void cc3_sigma_UHF_BBB(dpdbuf4 *Cmnef, dpdbuf4 *Wabei, dpdbuf4 *Wmbij, int do_singles, dpdbuf4 *Dijab_anti,
494  dpdfile2 *Sia, int do_doubles, dpdfile2 *Fme, dpdbuf4 *Wmafe, dpdbuf4 *Wmnie, dpdbuf4 *Sijab,
495  int *boccpi, int *bocc_off, int *bvirtpi, int *bvir_off, double omega,
496  std::string out_fname);
497 
498  void cc3_sigma_UHF_AAB(dpdbuf4 *C2AA, dpdbuf4 *C2AB, dpdbuf4 *C2BA, dpdbuf4 *FAA, dpdbuf4 *FAB, dpdbuf4 *FBA,
499  dpdbuf4 *EAA, dpdbuf4 *EAB, dpdbuf4 *EBA, int do_singles, dpdbuf4 *DAA, dpdbuf4 *DAB,
500  dpdfile2 *SIA, dpdfile2 *Sia, int do_doubles, dpdfile2 *FME, dpdfile2 *Fme, dpdbuf4 *WMAFE,
501  dpdbuf4 *WMaFe, dpdbuf4 *WmAfE, dpdbuf4 *WMNIE, dpdbuf4 *WMnIe, dpdbuf4 *WmNiE,
502  dpdbuf4 *SIJAB, dpdbuf4 *SIjAb, int *aoccpi, int *aocc_off, int *boccpi, int *bocc_off,
503  int *avirtpi, int *avir_off, int *bvirtpi, int *bvir_off, double omega,
504  std::string out_fname);
505 
506  void cc3_sigma_UHF_BBA(dpdbuf4 *C2BB, dpdbuf4 *C2AB, dpdbuf4 *C2BA, dpdbuf4 *FBB, dpdbuf4 *FAB, dpdbuf4 *FBA,
507  dpdbuf4 *EBB, dpdbuf4 *EAB, dpdbuf4 *EBA, int do_singles, dpdbuf4 *DBB, dpdbuf4 *DBA,
508  dpdfile2 *SIA, dpdfile2 *Sia, int do_doubles, dpdfile2 *FME, dpdfile2 *Fme, dpdbuf4 *Wmafe,
509  dpdbuf4 *WMaFe, dpdbuf4 *WmAfE, dpdbuf4 *Wmnie, dpdbuf4 *WMnIe, dpdbuf4 *WmNiE,
510  dpdbuf4 *Sijab, dpdbuf4 *SIjAb, int *aoccpi, int *aocc_off, int *boccpi, int *bocc_off,
511  int *avirtpi, int *avir_off, int *bvirtpi, int *bvir_off, double omega,
512  std::string out_fname);
513 }; // Dpd class
514 
515 /*
516  * Static variables/functions to mimic the old C machinery
517  */
518 extern dpd_gbl dpd_main;
519 extern PSI_API DPD *global_dpd_;
520 extern PSI_API int dpd_default;
521 extern DPD *dpd_list[2];
522 extern PSI_API int dpd_set_default(int dpd_num);
523 extern int dpd_init(int dpd_num, int nirreps, long int memory, int cachetype, int *cachefiles, int **cachelist,
524  dpd_file4_cache_entry *priority, int num_subspaces, std::vector<int *> &spaceArrays);
525 extern int dpd_close(int dpd_num);
526 extern long int PSI_API dpd_memfree();
527 extern void dpd_memset(long int memory);
528 
529 } // Namespace psi
530 
531 #endif /* _psi_src_lib_libdpd_dpd_h */
int **** pairorb
Definition: libdpd/dpd.h:306
int peq
Definition: libdpd/dpd.h:82
dpdparams4 ** params4
Definition: libdpd/dpd.h:308
int pqnum
Definition: libdpd/dpd.h:60
Definition: libdpd/dpd.h:273
size_t priority
Definition: libdpd/dpd.h:163
int dpd_close(int dpd_num)
Definition: libdpd/init.cc:76
int *** pairidx
Definition: libdpd/dpd.h:304
int newtrips
Definition: libdpd/dpd.h:232
dpd_file4_cache_entry * next
Definition: libdpd/dpd.h:166
Definition: libdpd/dpd.h:277
long int memlocked
Definition: libdpd/dpd.h:239
Definition: libdpd/dpd.h:276
int ** rowtot
Definition: libdpd/dpd.h:100
psio_address * lfiles
Definition: libdpd/dpd.h:145
Definition: libdpd/dpd.h:275
int dpdnum
Definition: libdpd/dpd.h:106
void dpd_memset(long int memory)
Definition: libdpd/init.cc:88
dpd_file2_cache_entry * next
Definition: libdpd/dpd.h:182
Definition: libdpd/dpd.h:290
int my_irrep
Definition: libdpd/dpd.h:144
dpd_file2_cache_entry * last
Definition: libdpd/dpd.h:183
int my_irrep
Definition: libdpd/dpd.h:91
Definition: libdpd/dpd.h:87
double *** matrix
Definition: libdpd/dpd.h:148
PSI_API int dpd_default
Definition: libdpd/init.cc:44
size_t access
Definition: libdpd/dpd.h:161
int size
Definition: libdpd/dpd.h:180
Definition: iwl.h:47
size_t file4_cache_least_recent
Definition: libdpd/dpd.h:252
int shift_type
Definition: libdpd/dpd.h:99
int last_ijk
Definition: libdpd/dpd.h:227
long int memused
Definition: libdpd/dpd.h:237
Definition: libdpd/dpd.h:265
Definition: libdpd/dpd.h:284
int num_subspaces
Definition: libdpd/dpd.h:189
dpd_file4_cache_entry * file4_cache
Definition: libdpd/dpd.h:250
Definition: libdpd/dpd.h:286
dpdbuf4 * CIjAb
Definition: libdpd/dpd.h:205
size_t file4_cache_lru_del
Definition: libdpd/dpd.h:253
int filenum
Definition: libdpd/dpd.h:154
int dpdnum
Definition: libdpd/dpd.h:173
int * qpi
Definition: libdpd/dpd.h:69
int ** pairtot
Definition: libdpd/dpd.h:300
int * poff
Definition: libdpd/dpd.h:72
int ** colorb
Definition: libdpd/dpd.h:131
dpdbuf4 buf
Definition: libdpd/dpd.h:119
std::vector< DPDMOSpace > moSpaces
Definition: libdpd/dpd.h:310
int incore
Definition: libdpd/dpd.h:147
int nirreps
Definition: libdpd/dpd.h:123
Definition: libdpd/dpd.h:268
int dpd_init(int dpd_num, int nirreps, long int memory, int cachetype, int *cachefiles, int **cachelist, dpd_file4_cache_entry *priority, int num_subspaces, std::vector< int * > &spaceArrays)
Definition: libdpd/init.cc:65
int ** rowidx
Definition: libdpd/dpd.h:64
int ** pairtot
Definition: libdpd/dpd.h:193
dpdfile2 * fAB
Definition: libdpd/dpd.h:222
void rs(int nm, int n, double **array, double *e_vals, int matz, double **e_vecs, double toler)
int * rowidx
Definition: libdpd/dpd.h:128
int irrep
Definition: libdpd/dpd.h:175
int irrep
Definition: libdpd/dpd.h:155
int * rsym
Definition: libdpd/dpd.h:78
double *** matrix
Definition: libdpd/dpd.h:95
Definition: libpsio/config.h:65
PSI_API DPD * global_dpd_
Definition: libdpd/init.cc:43
size_t file4_cache_low_del
Definition: libdpd/dpd.h:254
int perm_pq
Definition: libdpd/dpd.h:80
Definition: libdpd/dpd.h:116
dpd_gbl()
Definition: libdpd/dpd.h:242
int nirreps
Definition: libdpd/dpd.h:295
int * rowtot
Definition: libdpd/dpd.h:62
int clean
Definition: libdpd/dpd.h:165
int * qoff
Definition: libdpd/dpd.h:73
int ** coltot
Definition: libdpd/dpd.h:101
std::string outfile
Definition: libdpd/dpd.h:228
int * cachefiles
Definition: libdpd/dpd.h:256
int * virtpi
Definition: libdpd/dpd.h:218
int num_subspaces
Definition: libdpd/dpd.h:296
int * spi
Definition: libdpd/dpd.h:71
int Gi
Definition: libdpd/dpd.h:223
double *** matrix
Definition: libdpd/dpd.h:117
int * qoff
Definition: libdpd/dpd.h:135
int * T
Definition: stringlist.cc:66
int rsnum
Definition: libdpd/dpd.h:61
int num_pairs
Definition: libdpd/dpd.h:190
int dpdnum
Definition: libdpd/dpd.h:88
dpd_file4_cache_entry * file4_cache_priority
Definition: libdpd/dpd.h:258
dpdbuf4 * WAbEi
Definition: libdpd/dpd.h:206
dpdfile2 SIA_local
Definition: libdpd/dpd.h:230
int * occ_off
Definition: libdpd/dpd.h:217
dpdparams2 ** params2
Definition: libdpd/dpd.h:307
dpdparams2 * params
Definition: libdpd/dpd.h:146
dpdparams4 * params
Definition: libdpd/dpd.h:108
Definition: libdpd/dpd.h:152
int * poff
Definition: libdpd/dpd.h:134
Definition: libdpd/dpd.h:171
int cachetype
Definition: libdpd/dpd.h:255
int do_singles
Definition: libdpd/dpd.h:208
int * rpi
Definition: libdpd/dpd.h:70
int * soff
Definition: libdpd/dpd.h:75
int * occpi
Definition: libdpd/dpd.h:216
int dpdnum
Definition: libdpd/dpd.h:141
int pnum
Definition: libdpd/dpd.h:124
Definition: libdpd/dpd.h:98
int first_ijk
Definition: libdpd/dpd.h:226
int lock
Definition: libdpd/dpd.h:164
int * numorbs
Definition: libdpd/dpd.h:298
int ** colidx
Definition: libdpd/dpd.h:65
int * roff
Definition: libdpd/dpd.h:74
int ** row_offset
Definition: libdpd/dpd.h:111
char label[PSIO_KEYLEN]
Definition: libdpd/dpd.h:178
int ** orbidx2
Definition: libdpd/dpd.h:303
int *** roworb
Definition: libdpd/dpd.h:66
int anti
Definition: libdpd/dpd.h:107
#define PSIO_KEYLEN
Definition: libpsio/config.h:39
int Gj
Definition: libdpd/dpd.h:224
Definition: libdpd/dpd.h:122
int dpdnum
Definition: libdpd/dpd.h:153
PRAGMA_WARNING_PUSH PRAGMA_WARNING_IGNORE_DEPRECATED_DECLARATIONS PRAGMA_WARNING_POP
Definition: integraliter.cc:43
int * psym
Definition: libdpd/dpd.h:76
int qnum
Definition: libdpd/dpd.h:177
double omega
Definition: libdpd/dpd.h:220
dpd_file4_cache_entry * last
Definition: libdpd/dpd.h:167
int res
Definition: libdpd/dpd.h:83
int ** roworb
Definition: libdpd/dpd.h:130
int ** orbspi
Definition: libdpd/dpd.h:194
dpdfile2 * fIJ
Definition: libdpd/dpd.h:221
int incore
Definition: libdpd/dpd.h:94
DPD * dpd_list[2]
Definition: libdpd/init.cc:45
int filenum
Definition: libdpd/dpd.h:143
dpdbuf4 * WMnIe
Definition: libdpd/dpd.h:214
dpdshift4 shift
Definition: libdpd/dpd.h:110
int * colidx
Definition: libdpd/dpd.h:129
int *** colorb
Definition: libdpd/dpd.h:67
int * psym
Definition: libdpd/dpd.h:136
Definition: libdpd/dpd.h:269
double *** matrix
Definition: libdpd/dpd.h:159
Definition: libdpd/dpd.h:290
Definition: libdpd/dpd.h:187
int * ssym
Definition: libdpd/dpd.h:79
dpdparams4 ** params4
Definition: libdpd/dpd.h:201
dpdbuf4 * WMbIj
Definition: libdpd/dpd.h:207
dpd_file2_cache_entry * file2_cache
Definition: libdpd/dpd.h:249
Definition: libdpd/dpd.h:280
int * coltot
Definition: libdpd/dpd.h:63
int pqnum
Definition: libdpd/dpd.h:156
Definition: libdpd/dpd.h:282
int ** orboff
Definition: libdpd/dpd.h:299
dpdbuf4 * SIjAb
Definition: libdpd/dpd.h:215
int filenum
Definition: libdpd/dpd.h:174
Definition: libdpd/dpd.h:140
int clean
Definition: libdpd/dpd.h:181
long int PSI_API dpd_memfree()
Definition: libdpd/init.cc:84
int do_doubles
Definition: libdpd/dpd.h:211
Definition: libdpd/dpd.h:279
double *** matrix
Definition: libdpd/dpd.h:179
Definition: libdpd/dpd.h:270
Definition: libdpd/dpd.h:58
char label[PSIO_KEYLEN]
Definition: libdpd/dpd.h:158
int ** orbsym
Definition: libdpd/dpd.h:195
int num_pairs
Definition: libdpd/dpd.h:297
int *** orbs2
Definition: libdpd/dpd.h:198
long int memory
Definition: libdpd/dpd.h:236
int ** orboff
Definition: libdpd/dpd.h:192
dpdfile2 * FME
Definition: libdpd/dpd.h:212
double **** matrix
Definition: libdpd/dpd.h:102
int ** col_offset
Definition: libdpd/dpd.h:112
Definition: libdpd/dpd.h:290
Definition: libdpd/dpd.h:292
dpd_file2_cache_entry()
Definition: libdpd/dpd.h:172
double *** matrix
Definition: libdpd/dpd.h:113
int * qpi
Definition: libdpd/dpd.h:133
int perm_rs
Definition: libdpd/dpd.h:81
dpdbuf4 SIjAb_local
Definition: libdpd/dpd.h:231
#define PSI_API
Definition: pragma.h:155
long int memcache
Definition: libdpd/dpd.h:238
int filenum
Definition: libdpd/dpd.h:90
dpdparams4 * params
Definition: libdpd/dpd.h:93
Definition: libdpd/dpd.h:274
int * qsym
Definition: libdpd/dpd.h:137
Definition: libdpd/dpd.h:105
Definition: libdpd/dpd.h:272
int *** orbs2
Definition: libdpd/dpd.h:305
int ** start13
Definition: libdpd/dpd.h:84
psio_address * lfiles
Definition: libdpd/dpd.h:92
int * qsym
Definition: libdpd/dpd.h:77
dpdbuf4 * WmAEf
Definition: libdpd/dpd.h:213
pattern
Definition: libdpd/dpd.h:290
Definition: libdpd/dpd.h:281
dpdfile4 file
Definition: libdpd/dpd.h:109
int Gk
Definition: libdpd/dpd.h:225
Definition: pointgrp.h:104
char label[PSIO_KEYLEN]
Definition: libdpd/dpd.h:142
dpdshift4 shift
Definition: libdpd/dpd.h:118
Definition: libdpd/dpd.h:204
int nirreps
Definition: libdpd/dpd.h:188
Definition: libdpd/dpd.h:266
size_t usage
Definition: libdpd/dpd.h:162
int *** pairidx
Definition: libdpd/dpd.h:197
indices
Definition: libdpd/dpd.h:262
int * coltot
Definition: libdpd/dpd.h:127
Definition: libdpd/dpd.h:285
int ** orbsym
Definition: libdpd/dpd.h:302
Definition: libdpd/dpd.h:264
PSI_API int dpd_set_default(int dpd_num)
Definition: libdpd/init.cc:59
Definition: libdpd/dpd.h:271
Definition: libdpd/dpd.h:278
int * ppi
Definition: libdpd/dpd.h:68
int ** orbidx2
Definition: libdpd/dpd.h:196
Definition: libdpd/dpd.h:267
Definition: libdpd/dpd.h:290
int * vir_off
Definition: libdpd/dpd.h:219
Definition: libdpd/dpd.h:290
int nirreps
Definition: libdpd/dpd.h:59
dpdbuf4 * Dints
Definition: libdpd/dpd.h:209
Definition: libdpd/dpd.h:235
int * numorbs
Definition: libdpd/dpd.h:191
dpd_gbl dpd_main
Definition: libdpd/init.cc:46
int ** orbspi
Definition: libdpd/dpd.h:301
int pnum
Definition: libdpd/dpd.h:176
dpdparams2 ** params2
Definition: libdpd/dpd.h:200
Definition: libdpd/dpd.h:283
int qnum
Definition: libdpd/dpd.h:125
size_t file4_cache_most_recent
Definition: libdpd/dpd.h:251
Definition: libdpd/dpd.h:290
int thr_id
Definition: libdpd/dpd.h:229
char label[PSIO_KEYLEN]
Definition: libdpd/dpd.h:89
int size
Definition: libdpd/dpd.h:160
int ** cachelist
Definition: libdpd/dpd.h:257
Definition: libdpd/dpd.h:263
dpdfile2 * SIA
Definition: libdpd/dpd.h:210
int * ppi
Definition: libdpd/dpd.h:132
int * rowtot
Definition: libdpd/dpd.h:126
int **** pairorb
Definition: libdpd/dpd.h:199
int rsnum
Definition: libdpd/dpd.h:157