00001 // 00002 // tcscf.h --- definition of the two-configuration SCF class 00003 // 00004 // Copyright (C) 1996 Limit Point Systems, Inc. 00005 // 00006 // Author: Edward Seidl <seidl@janed.com> 00007 // Maintainer: LPS 00008 // 00009 // This file is part of the SC Toolkit. 00010 // 00011 // The SC Toolkit is free software; you can redistribute it and/or modify 00012 // it under the terms of the GNU Library General Public License as published by 00013 // the Free Software Foundation; either version 2, or (at your option) 00014 // any later version. 00015 // 00016 // The SC Toolkit is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 // GNU Library General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU Library General Public License 00022 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to 00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 00024 // 00025 // The U.S. Government is granted a limited license as per AL 91-7. 00026 // 00027 00028 #ifndef _chemistry_qc_scf_tcscf_h 00029 #define _chemistry_qc_scf_tcscf_h 00030 00031 #ifdef __GNUC__ 00032 #pragma interface 00033 #endif 00034 00035 #include <chemistry/qc/scf/scf.h> 00036 00037 // ////////////////////////////////////////////////////////////////////////// 00038 00039 class TCSCF: public SCF { 00040 protected: 00041 int user_occupations_; 00042 int tndocc_; 00043 int nirrep_; 00044 int *ndocc_; 00045 int osa_; 00046 int osb_; 00047 00048 double occa_; 00049 double occb_; 00050 00051 double ci1_; 00052 double ci2_; 00053 00054 ResultRefSymmSCMatrix focka_; 00055 ResultRefSymmSCMatrix fockb_; 00056 ResultRefSymmSCMatrix ka_; 00057 ResultRefSymmSCMatrix kb_; 00058 00059 public: 00060 TCSCF(StateIn&); 00061 TCSCF(const Ref<KeyVal>&); 00062 ~TCSCF(); 00063 00064 void save_data_state(StateOut&); 00065 00066 void print(std::ostream&o=ExEnv::out()) const; 00067 00068 double occupation(int ir, int vectornum); 00069 double alpha_occupation(int irrep, int vectornum); 00070 double beta_occupation(int irrep, int vectornum); 00071 00072 int n_fock_matrices() const; 00073 RefSymmSCMatrix fock(int); 00074 RefSymmSCMatrix effective_fock(); 00075 RefSymmSCMatrix density(); 00076 RefSymmSCMatrix alpha_density(); 00077 RefSymmSCMatrix beta_density(); 00078 00079 void symmetry_changed(); 00080 00081 int spin_polarized(); 00082 00083 protected: 00084 // these are temporary data, so they should not be checkpointed 00085 RefSymmSCMatrix cl_dens_; 00086 RefSymmSCMatrix cl_dens_diff_; 00087 RefSymmSCMatrix op_densa_; 00088 RefSymmSCMatrix op_densa_diff_; 00089 RefSymmSCMatrix op_densb_; 00090 RefSymmSCMatrix op_densb_diff_; 00091 00092 RefSymmSCMatrix ao_gmata_; 00093 RefSymmSCMatrix ao_gmatb_; 00094 RefSymmSCMatrix ao_ka_; 00095 RefSymmSCMatrix ao_kb_; 00096 00097 RefSymmSCMatrix cl_hcore_; 00098 00099 void set_occupations(const RefDiagSCMatrix& evals); 00100 00101 // scf things 00102 void init_vector(); 00103 void done_vector(); 00104 void reset_density(); 00105 double new_density(); 00106 double scf_energy(); 00107 00108 Ref<SCExtrapData> extrap_data(); 00109 00110 // gradient things 00111 void init_gradient(); 00112 void done_gradient(); 00113 00114 RefSymmSCMatrix lagrangian(); 00115 RefSymmSCMatrix gradient_density(); 00116 00117 // hessian things 00118 void init_hessian(); 00119 void done_hessian(); 00120 }; 00121 00122 #endif 00123 00124 // Local Variables: 00125 // mode: c++ 00126 // c-file-style: "ETS" 00127 // End: