| 1 | // | 
|---|
| 2 | // effh.h --- definition of the effective fock builder classes | 
|---|
| 3 | // | 
|---|
| 4 | // Copyright (C) 1996 Limit Point Systems, Inc. | 
|---|
| 5 | // | 
|---|
| 6 | // Author: Curtis Janssen <cljanss@limitpt.com> | 
|---|
| 7 | // Maintainer: LPS | 
|---|
| 8 | // | 
|---|
| 9 | // This file is part of the SC Toolkit. | 
|---|
| 10 | // | 
|---|
| 11 | // The SC Toolkit is free software; you can redistribute it and/or modify | 
|---|
| 12 | // it under the terms of the GNU Library General Public License as published by | 
|---|
| 13 | // the Free Software Foundation; either version 2, or (at your option) | 
|---|
| 14 | // any later version. | 
|---|
| 15 | // | 
|---|
| 16 | // The SC Toolkit is distributed in the hope that it will be useful, | 
|---|
| 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 19 | // GNU Library General Public License for more details. | 
|---|
| 20 | // | 
|---|
| 21 | // You should have received a copy of the GNU Library General Public License | 
|---|
| 22 | // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to | 
|---|
| 23 | // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 
|---|
| 24 | // | 
|---|
| 25 | // The U.S. Government is granted a limited license as per AL 91-7. | 
|---|
| 26 | // | 
|---|
| 27 |  | 
|---|
| 28 | #ifndef _chemistry_qc_scf_effh_h | 
|---|
| 29 | #define _chemistry_qc_scf_effh_h | 
|---|
| 30 |  | 
|---|
| 31 | #ifdef __GNUC__ | 
|---|
| 32 | #pragma interface | 
|---|
| 33 | #endif | 
|---|
| 34 |  | 
|---|
| 35 | #include <math/scmat/blkiter.h> | 
|---|
| 36 | #include <math/scmat/blocked.h> | 
|---|
| 37 | #include <chemistry/qc/scf/scf.h> | 
|---|
| 38 |  | 
|---|
| 39 | namespace sc { | 
|---|
| 40 |  | 
|---|
| 41 | class AccumEffectiveH: public BlockedSCElementOp2 { | 
|---|
| 42 | protected: | 
|---|
| 43 | SCF *scf_; | 
|---|
| 44 | double coef_[18]; | 
|---|
| 45 |  | 
|---|
| 46 | virtual void init() =0; | 
|---|
| 47 |  | 
|---|
| 48 | // hindex is 0 for the closed and 1 for the open shell fock matrix | 
|---|
| 49 | // shelli and shellj are 0 for closed, 1 for open, and 2 for virtual | 
|---|
| 50 | int index(int hindex, int shelli, int shellj); | 
|---|
| 51 |  | 
|---|
| 52 | // converts an occupation number to a shell number | 
|---|
| 53 | int shell(double); | 
|---|
| 54 |  | 
|---|
| 55 | double& coef(int i, int j, int k) { return coef_[index(i,j,k)]; } | 
|---|
| 56 |  | 
|---|
| 57 | public: | 
|---|
| 58 | AccumEffectiveH(SCF*); | 
|---|
| 59 | virtual ~AccumEffectiveH(); | 
|---|
| 60 |  | 
|---|
| 61 | virtual void process(SCMatrixBlockIter&,SCMatrixBlockIter&); | 
|---|
| 62 | }; | 
|---|
| 63 |  | 
|---|
| 64 | //  Guest & Saunders general form | 
|---|
| 65 | //        C        O         V | 
|---|
| 66 | //    ---------- | 
|---|
| 67 | //    |        | | 
|---|
| 68 | // C  |   fc   | | 
|---|
| 69 | //    |        | | 
|---|
| 70 | //    ------------------- | 
|---|
| 71 | //    |        |        | | 
|---|
| 72 | // O  | 2fc-fo |   fc   | | 
|---|
| 73 | //    |        |        | | 
|---|
| 74 | //    ---------------------------- | 
|---|
| 75 | //    |        |        |        | | 
|---|
| 76 | // V  |   fc   |   fo   |   fc   | | 
|---|
| 77 | //    |        |        |        | | 
|---|
| 78 | //    ---------------------------- | 
|---|
| 79 | class GSGeneralEffH: public AccumEffectiveH { | 
|---|
| 80 | protected: | 
|---|
| 81 | void init(); | 
|---|
| 82 |  | 
|---|
| 83 | public: | 
|---|
| 84 | GSGeneralEffH(SCF*); | 
|---|
| 85 | ~GSGeneralEffH(); | 
|---|
| 86 | }; | 
|---|
| 87 |  | 
|---|
| 88 | //  Guest & Saunders' form for high spin | 
|---|
| 89 | //        C        O         V | 
|---|
| 90 | //    ---------- | 
|---|
| 91 | //    |        | | 
|---|
| 92 | // C  | 2fc-fo | | 
|---|
| 93 | //    |        | | 
|---|
| 94 | //    ------------------- | 
|---|
| 95 | //    |        |        | | 
|---|
| 96 | // O  | 2fc-fo | 2fc-fo | | 
|---|
| 97 | //    |        |        | | 
|---|
| 98 | //    ---------------------------- | 
|---|
| 99 | //    |        |        |        | | 
|---|
| 100 | // V  |   fc   |   fo   | 2fc-fo | | 
|---|
| 101 | //    |        |        |        | | 
|---|
| 102 | //    ---------------------------- | 
|---|
| 103 | class GSHighSpinEffH: public AccumEffectiveH { | 
|---|
| 104 | protected: | 
|---|
| 105 | void init(); | 
|---|
| 106 |  | 
|---|
| 107 | public: | 
|---|
| 108 | GSHighSpinEffH(SCF*); | 
|---|
| 109 | ~GSHighSpinEffH(); | 
|---|
| 110 | }; | 
|---|
| 111 |  | 
|---|
| 112 | //  test form | 
|---|
| 113 | //        C        O         V | 
|---|
| 114 | //    ---------- | 
|---|
| 115 | //    |        | | 
|---|
| 116 | // C  |   fo   | | 
|---|
| 117 | //    |        | | 
|---|
| 118 | //    ------------------- | 
|---|
| 119 | //    |        |        | | 
|---|
| 120 | // O  | 2fc-fo |   fo   | | 
|---|
| 121 | //    |        |        | | 
|---|
| 122 | //    ---------------------------- | 
|---|
| 123 | //    |        |        |        | | 
|---|
| 124 | // V  |   fc   |   fo   |   fo   | | 
|---|
| 125 | //    |        |        |        | | 
|---|
| 126 | //    ---------------------------- | 
|---|
| 127 | class TestEffH: public AccumEffectiveH { | 
|---|
| 128 | protected: | 
|---|
| 129 | void init(); | 
|---|
| 130 |  | 
|---|
| 131 | public: | 
|---|
| 132 | TestEffH(SCF*); | 
|---|
| 133 | ~TestEffH(); | 
|---|
| 134 | }; | 
|---|
| 135 |  | 
|---|
| 136 | //  form for converged wavefunction | 
|---|
| 137 | //        C        O         V | 
|---|
| 138 | //    ---------- | 
|---|
| 139 | //    |        | | 
|---|
| 140 | // C  |   fc   | | 
|---|
| 141 | //    |        | | 
|---|
| 142 | //    ------------------- | 
|---|
| 143 | //    |        |        | | 
|---|
| 144 | // O  | 2fc-fo |   fo   | | 
|---|
| 145 | //    |        |        | | 
|---|
| 146 | //    ---------------------------- | 
|---|
| 147 | //    |        |        |        | | 
|---|
| 148 | // V  |   fc   |   fo   |   fo   | | 
|---|
| 149 | //    |        |        |        | | 
|---|
| 150 | //    ---------------------------- | 
|---|
| 151 | class PsiEffH: public AccumEffectiveH { | 
|---|
| 152 | protected: | 
|---|
| 153 | void init(); | 
|---|
| 154 |  | 
|---|
| 155 | public: | 
|---|
| 156 | PsiEffH(SCF*); | 
|---|
| 157 | ~PsiEffH(); | 
|---|
| 158 | }; | 
|---|
| 159 |  | 
|---|
| 160 | } | 
|---|
| 161 |  | 
|---|
| 162 | #endif | 
|---|
| 163 |  | 
|---|
| 164 | // Local Variables: | 
|---|
| 165 | // mode: c++ | 
|---|
| 166 | // c-file-style: "ETS" | 
|---|
| 167 | // End: | 
|---|