~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to src/bin/ccresponse/cc2_X2.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <stdio.h>
2
 
#include <string.h>
3
 
#include <libdpd/dpd.h>
4
 
#define EXTERN
5
 
#include "globals.h"
6
 
 
7
 
void denom2(dpdbuf4 *X2, double omega);
8
 
void local_filter_T2(dpdbuf4 *T2, double omega);
9
 
 
10
 
void cc2_X2_build(char *pert, char *cart, int irrep, double omega)
11
 
{
12
 
  dpdfile2 X1, z, F, t1;
13
 
  dpdbuf4 X2, X2new, Z, Z1, Z2, W, I;
14
 
  char lbl[32];
15
 
 
16
 
  sprintf(lbl, "%sBAR_%1s_IjAb", pert, cart);
17
 
  dpd_buf4_init(&X2new, CC_LR, irrep, 0, 5, 0, 5, 0, lbl);
18
 
  sprintf(lbl, "New X_%s_%1s_IjAb (%5.3f)", pert, cart, omega);
19
 
  dpd_buf4_copy(&X2new, CC_LR, lbl);
20
 
  dpd_buf4_close(&X2new);
21
 
  dpd_buf4_init(&X2new, CC_LR, irrep, 0, 5, 0, 5, 0, lbl);
22
 
 
23
 
  /*** D-S ***/
24
 
 
25
 
  sprintf(lbl, "X_%s_%1s_IA (%5.3f)", pert, cart, omega);
26
 
  dpd_file2_init(&X1, CC_OEI, irrep, 0, 1, lbl);
27
 
 
28
 
  sprintf(lbl, "Z(Ij,Ab) %s %1s", pert, cart);
29
 
  dpd_buf4_init(&Z, CC_TMP0, irrep, 0, 5, 0, 5, 0, lbl);
30
 
  dpd_buf4_init(&W, CC2_HET1, 0, 10, 0, 10, 0, 0, "CC2 WMbIj");
31
 
  dpd_contract244(&X1, &W, &Z, 0, 0, 1, 1, 0);
32
 
  dpd_buf4_close(&W);
33
 
  dpd_buf4_axpy(&Z, &X2new, -1);
34
 
  dpd_buf4_close(&X2new);
35
 
  sprintf(lbl, "New X_%s_%1s_IjAb (%5.3f)", pert, cart, omega);
36
 
  dpd_buf4_sort_axpy(&Z, CC_LR, qpsr, 0, 5, lbl, -1);
37
 
  dpd_buf4_close(&Z);
38
 
 
39
 
 
40
 
  sprintf(lbl, "Z(Ab,Ij) %s %1s", pert, cart);
41
 
  dpd_buf4_init(&Z, CC_TMP0, irrep, 5, 0, 5, 0, 0, lbl);
42
 
  dpd_buf4_init(&W, CC2_HET1, 0, 5, 11, 5, 11, 0, "CC2 WAbEi");
43
 
  dpd_contract244(&X1, &W, &Z, 1, 2, 1, 1, 0);
44
 
  dpd_buf4_close(&W);
45
 
  sprintf(lbl, "New X_%s_%1s_IjAb (%5.3f)", pert, cart, omega);
46
 
  dpd_buf4_sort_axpy(&Z, CC_LR, rspq, 0, 5, lbl, 1);
47
 
  sprintf(lbl, "Z(Ij,Ab) %s %1s", pert, cart);
48
 
  dpd_buf4_sort(&Z, CC_TMP0, srqp, 0, 5, lbl);
49
 
  dpd_buf4_close(&Z);
50
 
  dpd_buf4_init(&Z, CC_TMP0, irrep, 0, 5, 0, 5, 0, lbl);
51
 
  sprintf(lbl, "New X_%s_%1s_IjAb (%5.3f)", pert, cart, omega);
52
 
  dpd_buf4_init(&X2new, CC_LR, irrep, 0, 5, 0, 5, 0, lbl);
53
 
  dpd_buf4_axpy(&Z, &X2new, 1);
54
 
  dpd_buf4_close(&X2new);
55
 
  dpd_buf4_close(&Z);
56
 
 
57
 
  dpd_file2_close(&X1);
58
 
 
59
 
  /*** D-D ***/
60
 
 
61
 
  dpd_buf4_init(&X2new, CC_LR, irrep, 0, 5, 0, 5, 0, lbl);
62
 
 
63
 
  sprintf(lbl, "X_%s_%1s_IjAb (%5.3f)", pert, cart, omega);
64
 
  dpd_buf4_init(&X2, CC_LR, irrep, 0, 5, 0, 5, 0, lbl);
65
 
 
66
 
  dpd_buf4_axpy(&X2, &X2new, -omega);
67
 
 
68
 
  sprintf(lbl, "Z(Ij,Ab) %s %1s", pert, cart);
69
 
  dpd_buf4_init(&Z, CC_TMP0, irrep, 0, 5, 0, 5, 0, lbl);
70
 
  dpd_file2_init(&F, CC_OEI, 0, 1, 1, "fAB");
71
 
  dpd_contract424(&X2, &F, &Z, 3, 1, 0, 1, 0);
72
 
  dpd_file2_close(&F);
73
 
  dpd_buf4_axpy(&Z, &X2new, 1);
74
 
  sprintf(lbl, "Z(jI,bA) %s %1s", pert, cart);
75
 
  dpd_buf4_sort(&Z, CC_TMP0, qpsr, 0, 5, lbl);
76
 
  dpd_buf4_close(&Z);
77
 
  dpd_buf4_init(&Z, CC_TMP0, irrep, 0, 5, 0, 5, 0, lbl);
78
 
  dpd_buf4_axpy(&Z, &X2new, 1);
79
 
  dpd_buf4_close(&Z);
80
 
 
81
 
  sprintf(lbl, "Z(Ij,Ab) %s %1s", pert, cart);
82
 
  dpd_buf4_init(&Z, CC_TMP0, irrep, 0, 5, 0, 5, 0, lbl);
83
 
  dpd_file2_init(&F, CC_OEI, 0, 0, 0, "fIJ");
84
 
  dpd_contract244(&F, &X2, &Z, 0, 0, 0, 1, 0);
85
 
  dpd_file2_close(&F);
86
 
  dpd_buf4_axpy(&Z, &X2new, -1);
87
 
  sprintf(lbl, "Z(jI,bA) %s %1s", pert, cart);
88
 
  dpd_buf4_sort(&Z, CC_TMP0, qpsr, 0, 5, lbl);
89
 
  dpd_buf4_close(&Z);
90
 
  dpd_buf4_init(&Z, CC_TMP0, irrep, 0, 5, 0, 5, 0, lbl);
91
 
  dpd_buf4_axpy(&Z, &X2new, -1);
92
 
  dpd_buf4_close(&Z);
93
 
 
94
 
  dpd_buf4_close(&X2);
95
 
 
96
 
  /** Filter and apply denominator **/
97
 
  if(params.local) local_filter_T2(&X2new, omega);
98
 
  else denom2(&X2new, omega);
99
 
  dpd_buf4_close(&X2new);
100
 
}