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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2006-09-10 14:01:33 UTC
  • Revision ID: james.westby@ubuntu.com-20060910140133-ib2j86trekykfsfv
Tags: upstream-3.2.3
ImportĀ upstreamĀ versionĀ 3.2.3

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
double HXY(char *pert_x, char *cart_x, int irrep_x, double omega_x, 
 
8
           char *pert_y, char *cart_y, int irrep_y, double omega_y)
 
9
{
 
10
  double polar;
 
11
  dpdfile2 X1, Y1, z;
 
12
  dpdbuf4 I;
 
13
  char lbl[32];
 
14
 
 
15
  sprintf(lbl, "Z_%s_%1s_IA", pert_y, cart_y);
 
16
  dpd_file2_init(&z, CC_TMP0, irrep_y, 0, 1, lbl);
 
17
 
 
18
  sprintf(lbl, "X_%s_%1s_IA (%5.3f)", pert_y, cart_y, omega_y);
 
19
  dpd_file2_init(&Y1, CC_OEI, irrep_y, 0, 1, lbl);
 
20
  dpd_buf4_init(&I, CC_DINTS, 0, 0, 5, 0, 5, 0, "D 2<ij|ab> - <ij|ba>");
 
21
  dpd_dot24(&Y1, &I, &z, 0, 0, 1, 0);
 
22
  dpd_buf4_close(&I);
 
23
  dpd_file2_close(&Y1);
 
24
 
 
25
  sprintf(lbl, "X_%s_%1s_IA (%5.3f)", pert_x, cart_x, omega_x);
 
26
  dpd_file2_init(&X1, CC_OEI, irrep_x, 0, 1, lbl);
 
27
  polar = 2.0 * dpd_file2_dot(&X1, &z);
 
28
  dpd_file2_close(&X1);
 
29
 
 
30
  dpd_file2_close(&z);
 
31
 
 
32
  return polar;
 
33
}