~ubuntu-branches/ubuntu/vivid/psicode/vivid

« back to all changes in this revision

Viewing changes to src/bin/cceom/get_eom_params.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2008-06-07 16:49:57 UTC
  • mfrom: (2.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080607164957-8pifvb133yjlkagn
Tags: 3.3.0-3
* debian/rules (DEB_MAKE_CHECK_TARGET): Do not abort test suite on
  failures.
* debian/rules (DEB_CONFIGURE_EXTRA_FLAGS): Set ${bindir} to /usr/lib/psi.
* debian/rules (install/psi3): Move psi3 file to /usr/bin.
* debian/patches/07_464867_move_executables.dpatch: New patch, add
  /usr/lib/psi to the $PATH, so that the moved executables are found.
  (closes: #464867)
* debian/patches/00list: Adjusted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <stdio.h>
 
2
#include <stdlib.h>
2
3
#include <string.h>
3
4
#include <math.h>
4
5
#include <libipv1/ip_lib.h>
10
11
{
11
12
  int errcod, i, j, sym, iconv,exist, state_irrep, c_irrep;
12
13
 
13
 
  eom_params.max_iter = 80;
14
 
  errcod = ip_data("MAX_ITER","%d",&(eom_params.max_iter),0);
15
 
 
16
14
  eom_params.states_per_irrep = (int *) malloc(moinfo.nirreps * sizeof(int));
17
15
  if (ip_exist("STATES_PER_IRREP",0)) {
18
16
    ip_count("STATES_PER_IRREP", &i, 0);
23
21
    for (i=0;i<moinfo.nirreps;++i)
24
22
      errcod = ip_data("STATES_PER_IRREP","%d",&(eom_params.states_per_irrep[i]),1,i);
25
23
  }
26
 
  else { fprintf(outfile,"Must have states_per_irrep vector in input.\n"); exit(0); } 
 
24
  else { fprintf(outfile,"Must have states_per_irrep vector in input.\n"); exit(PSI_RETURN_FAILURE); } 
27
25
 
28
26
  eom_params.cs_per_irrep = (int *) malloc(moinfo.nirreps * sizeof(int));
29
27
  for (state_irrep=0; state_irrep<moinfo.nirreps; ++state_irrep) {
30
28
    eom_params.cs_per_irrep[state_irrep^moinfo.sym] = eom_params.states_per_irrep[state_irrep];
31
29
  }
32
30
 
33
 
  /* We now write out all of the final R's so prop_sym and prop_root should not be
34
 
   * needed by cceom */
35
 
  /*
 
31
  eom_params.max_iter = 80 * moinfo.nirreps;
 
32
  errcod = ip_data("MAX_ITER","%d",&(eom_params.max_iter),0);
 
33
 
 
34
  /* Use prop_sym and prop_root only to determine what energy to write the file32 */
36
35
  if (ip_exist("PROP_SYM",0)) {
37
36
    ip_data("PROP_SYM","%d",&(eom_params.prop_sym),0);
38
 
    eom_params.prop_sym = eom_params.prop_sym - 1;
 
37
    eom_params.prop_sym = (eom_params.prop_sym - 1)^moinfo.sym;
39
38
  }
40
39
  else {
41
40
    for (i=0;i<moinfo.nirreps;++i)
42
 
      if (eom_params.states_per_irrep[i]) eom_params.prop_sym = i;
 
41
      if (eom_params.states_per_irrep[i])
 
42
        eom_params.prop_sym = i^moinfo.sym;
43
43
  }
44
44
  if (ip_exist("PROP_ROOT",0)) {
45
45
    ip_data("PROP_ROOT","%d",&(eom_params.prop_root),0);
46
 
    if (eom_params.prop_root > eom_params.states_per_irrep[eom_params.prop_sym]) {
 
46
    if (eom_params.prop_root > eom_params.states_per_irrep[eom_params.prop_sym^moinfo.sym]) {
47
47
      fprintf(outfile,"prop_root is too big\n");
48
48
      exit(1);
49
49
    }
50
50
  }
51
51
  else {
52
 
    eom_params.prop_root = eom_params.states_per_irrep[eom_params.prop_sym];
53
 
  }
54
 
  */
55
 
 
 
52
    eom_params.prop_root = eom_params.states_per_irrep[eom_params.prop_sym^moinfo.sym];
 
53
  }
 
54
  --eom_params.prop_root;
 
55
 
 
56
  if ( (!strcmp(params.wfn,"EOM_CC3")) && (eom_params.prop_root != 0) ) {
 
57
    eom_params.follow_root = 1;
 
58
  }
 
59
 
 
60
  /* so far, all R's are always kept so this is not used */
56
61
  eom_params.save_all = 0;
57
 
  errcod = ip_data("SAVE_ALL","%d",&(eom_params.save_all),0);
 
62
 
 
63
  eom_params.mult = 1;
 
64
  eom_params.rhf_triplets = 0;
 
65
  errcod = ip_data("RHF_TRIPLETS","%d",&(eom_params.rhf_triplets),0);
 
66
  if (eom_params.rhf_triplets != 0) eom_params.mult = 3;
58
67
 
59
68
  eom_params.excitation_range = 2;
60
69
  errcod = ip_data("EXCITATION_RANGE","%d",&(eom_params.excitation_range),0);
65
74
  eom_params.vectors_per_root_SS = 5;
66
75
  errcod = ip_data("VECTORS_PER_ROOT_SS","%d",&(eom_params.vectors_per_root_SS),0);
67
76
 
68
 
  eom_params.vectors_per_root = 6;
 
77
  eom_params.vectors_per_root = 12;
69
78
  errcod = ip_data("VECTORS_PER_ROOT","%d",&(eom_params.vectors_per_root),0);
70
79
 
 
80
  eom_params.vectors_cc3 = eom_params.vectors_per_root;
 
81
  errcod = ip_data("VECTORS_CC3","%d",&(eom_params.vectors_cc3),0);
 
82
  if (eom_params.vectors_cc3 > eom_params.vectors_per_root)
 
83
    eom_params.vectors_cc3 = eom_params.vectors_per_root;
 
84
 
 
85
  eom_params.restart_vectors_per_root = 1;
 
86
  errcod = ip_data("RESTART_VECTORS_PER_ROOT","%d",&(eom_params.restart_vectors_per_root),0);
 
87
 
71
88
  eom_params.complex_tol = 1E-12;
72
89
  errcod = ip_data("COMPLEX_TOL","%d",&(iconv),0);
73
90
  if(errcod == IPE_OK) eom_params.complex_tol = 1.0*pow(10.0,(double) -iconv);
74
91
 
75
 
  eom_params.residual_tol = 1E-4;
 
92
  eom_params.residual_tol = 1E-6;
76
93
  errcod = ip_data("RESIDUAL_TOL","%d",&(iconv),0);
77
94
  if(errcod == IPE_OK) eom_params.residual_tol = 1.0*pow(10.0,(double) -iconv);
78
95
 
80
97
  errcod = ip_data("RESIDUAL_TOL_SS","%d",&(iconv),0);
81
98
  if(errcod == IPE_OK) eom_params.residual_tol_SS = 1.0*pow(10.0,(double) -iconv);
82
99
 
83
 
  eom_params.eval_tol = 1E-6;
 
100
  eom_params.eval_tol = 1E-8;
84
101
  errcod = ip_data("EVAL_TOL","%d",&(iconv),0);
85
102
  if(errcod == IPE_OK) eom_params.eval_tol = 1.0*pow(10.0,(double) -iconv);
86
103
 
 
104
  eom_params.eval_tol_SS = 1E-6;
 
105
  errcod = ip_data("EVAL_TOL_SS","%d",&(iconv),0);
 
106
  if(errcod == IPE_OK) eom_params.eval_tol_SS = 1.0*pow(10.0,(double) -iconv);
 
107
 
87
108
  eom_params.schmidt_add_residual_tol = 1E-3;
88
109
  errcod = ip_data("SCHMIDT_ADD_RESIDUAL_TOL","%d",&(iconv),0);
89
110
  if(errcod == IPE_OK) eom_params.schmidt_add_residual_tol = 1.0*pow(10.0,(double) -iconv);
90
111
 
 
112
  eom_params.skip_diagSS = 0;
 
113
  i = 0;
 
114
  errcod = ip_boolean("SKIP_DIAGSS",&(i),0);
 
115
  if (i) eom_params.skip_diagSS = 1;
 
116
 
 
117
  eom_params.restart_eom_cc3 = 0;
 
118
  i = 0;
 
119
  errcod = ip_boolean("RESTART_EOM_CC3",&(i),0);
 
120
  if (i) eom_params.restart_eom_cc3 = 1;
 
121
 
91
122
  eom_params.max_iter_SS = 500;
92
123
 
93
124
  if(eom_params.guess == NULL) { /* we didn't use the cmdline arg --reuse */
112
143
  fprintf(outfile, "\tPrint HbarSS iterations?    = %5d\n", eom_params.print_singles);
113
144
  fprintf(outfile, "\tExcitation range for HBarSS = %5d\n", eom_params.excitation_range);
114
145
  fprintf(outfile, "\tEigenvalue tolerance        = %5.1e\n", eom_params.eval_tol);
 
146
  fprintf(outfile, "\tEigenvalue toleranceSS      = %5.1e\n", eom_params.eval_tol_SS);
115
147
  fprintf(outfile, "\tResidual vector tolerance   = %5.1e\n", eom_params.residual_tol);
 
148
  fprintf(outfile, "\tResidual vector toleranceSS = %5.1e\n", eom_params.residual_tol_SS);
116
149
  fprintf(outfile, "\tComplex tolerance           = %5.1e\n", eom_params.complex_tol);
117
 
  fprintf(outfile, "\tRoot for properties         = %5d\n", eom_params.prop_root);
118
 
  fprintf(outfile, "\tSave all R vectors          = %5d\n", eom_params.save_all);
 
150
  fprintf(outfile, "\tRoot for properties         = %5d\n", eom_params.prop_root + 1);
119
151
  fprintf(outfile, "\tSym of state for properties = %6s\n", moinfo.labels[eom_params.prop_sym]);
120
152
  fprintf(outfile, "\tGuess vectors taken from    = %s\n", eom_params.guess);
 
153
  fprintf(outfile, "\tRestart EOM CC3             = %s\n", eom_params.restart_eom_cc3?"YES":"NO");
 
154
  if (eom_params.follow_root)
 
155
    fprintf(outfile, "\tRoot following for CC3 turned on.\n");
121
156
  fprintf(outfile, "\n\n");
122
157
}
123
158