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

« back to all changes in this revision

Viewing changes to src/bin/mcscf/scf_Feff.cc

  • 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 <liboptions/liboptions.h>
 
2
 
 
3
#include "scf.h"
 
4
 
 
5
namespace psi{ namespace mcscf{
 
6
 
 
7
void SCF::construct_Feff(int cycle)
 
8
{
 
9
  Feff_t = Fc_t;
 
10
 
 
11
  if(options_get_bool("USE_FAVG")){
 
12
    if(cycle >= options_get_int("START_FAVG")){
 
13
      // Set the diagonal blocks Fock 
 
14
      for(int h =0; h < nirreps; ++h){
 
15
        // Set the (closed,closed) blocks
 
16
        for(int i = 0; i < docc[h]; ++i){
 
17
          for(int j = 0; j < docc[h]; ++j){
 
18
            Feff_t->set(h,i,j,Favg_t->get(h,i,j));
 
19
          }
 
20
        }
 
21
        // Set the (active,active) blocks
 
22
        for(int i = docc[h]; i< docc[h] + actv[h]; ++i){
 
23
          for(int j = docc[h]; j < docc[h] + actv[h]; ++j){
 
24
            Feff_t->set(h,i,j,Favg_t->get(h,i,j));
 
25
          }
 
26
        }
 
27
        // Set the (virtual,virtual) blocks        
 
28
        for(int i = docc[h] + actv[h]; i < sopi[h]; ++i){
 
29
          for(int j = docc[h] + actv[h]; j < sopi[h]; ++j){
 
30
            Feff_t->set(h,i,j,Favg_t->get(h,i,j));
 
31
          }
 
32
        }        
 
33
      }
 
34
    }
 
35
    if(cycle == options_get_int("START_FAVG")){
 
36
      fprintf(outfile,"\n  *** Switching from Fc to F_avg ***");
 
37
    }
 
38
  }
 
39
 
 
40
  if(reference == rohf  && (cycle > turn_on_actv)){
 
41
    for(int h =0; h < nirreps; ++h){
 
42
      // Set the (closed,open) and (open,closed) blocks to 2(Fc-Fo)
 
43
      for(int i =0; i < docc[h]; ++i){
 
44
        for(int j = docc[h]; j < docc[h] + actv[h]; ++j){
 
45
          double element = 2.0 * ( Fc_t->get(h,i,j) - Fo_t->get(h,i,j) );
 
46
          Feff_t->set(h,i,j,element);
 
47
          Feff_t->set(h,j,i,element);
 
48
        }
 
49
      }
 
50
  
 
51
      // Set the (virtual,open) and (open,virtual) blocks to 2 Fo
 
52
      for(int i = docc[h] + actv[h]; i < sopi[h]; ++i){
 
53
        for(int j = docc[h]; j < docc[h] + actv[h]; ++j){
 
54
          double element = 2.0 * Fo_t->get(h,i,j);
 
55
          Feff_t->set(h,i,j,element);
 
56
          Feff_t->set(h,j,i,element);
 
57
        }
 
58
      }
 
59
    }
 
60
  }
 
61
  if(reference == tcscf && (cycle > turn_on_actv)){
 
62
    double lambda = 1.0;
 
63
    for(int I = 0 ; I < nci; ++I){
 
64
      int h = tcscf_sym[I];
 
65
      int i = tcscf_mos[I];
 
66
      // Set the (closed,tc) and (tc,closed) blocks to 2 (Fc - Ftc)
 
67
      for(int j = 0; j < docc[h]; ++j){
 
68
        double element = 2.0 * ( Fc_t->get(h,i,j) - Ftc_t[I]->get(h,i,j) );
 
69
        Feff_t->set(h,i,j,element);
 
70
        Feff_t->set(h,j,i,element);
 
71
      }
 
72
      // Set the (external,tc) and (tc,external) blocks to 2 Ftc
 
73
      for(int j = docc[h] + actv[h]; j < sopi[h]; ++j){
 
74
        double element = 2.0 * Ftc_t[I]->get(h,i,j);
 
75
        Feff_t->set(h,i,j,element);
 
76
        Feff_t->set(h,j,i,element);
 
77
      }
 
78
    }
 
79
    // Orbitals of the same symmetry
 
80
    if(options_get_bool("INTERNAL_ROTATIONS")){
 
81
      for(int I = 0 ; I < nci; ++I){
 
82
        for(int J = I + 1 ; J < nci; ++J){
 
83
          if(tcscf_sym[I] == tcscf_sym[J]){
 
84
                int h = tcscf_sym[I];
 
85
                int i = tcscf_mos[I];
 
86
                int j = tcscf_mos[J];
 
87
                // Set the (tc,tc) and (tc,tc) blocks to 2 (Ftc_a - Ftc_b)
 
88
                double element = 2.0 * (Ftc_t[I]->get(h,i,j) - Ftc_t[J]->get(h,i,j));
 
89
                Feff_t->set(h,i,j,element);
 
90
                Feff_t->set(h,j,i,element);
 
91
          }     
 
92
        }
 
93
      }
 
94
    }else{
 
95
      for(int I = 0 ; I < nci; ++I){
 
96
        for(int J = I + 1 ; J < nci; ++J){
 
97
          if(tcscf_sym[I] == tcscf_sym[J]){
 
98
            int h = tcscf_sym[I];
 
99
            int i = tcscf_mos[I];
 
100
            int j = tcscf_mos[J];
 
101
                // Set the (tc,tc) and (tc,tc) blocks to 2 (Ftc_a - Ftc_b)
 
102
            double element = 0.0;
 
103
            Feff_t->set(h,i,j,element);
 
104
            Feff_t->set(h,j,i,element);
 
105
          }     
 
106
        }
 
107
      }           
 
108
    }
 
109
  }
 
110
}
 
111
 
 
112
}} /* End Namespaces */