1
#include <liboptions/liboptions.h>
5
namespace psi{ namespace mcscf{
7
void SCF::construct_Feff(int cycle)
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));
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));
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));
35
if(cycle == options_get_int("START_FAVG")){
36
fprintf(outfile,"\n *** Switching from Fc to F_avg ***");
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);
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);
61
if(reference == tcscf && (cycle > turn_on_actv)){
63
for(int I = 0 ; I < nci; ++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);
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);
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]){
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);
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]){
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);
112
}} /* End Namespaces */