00001 // 00002 // hsosscf.h --- definition of the high-spin open shell 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_hsosscf_h 00029 #define _chemistry_qc_scf_hsosscf_h 00030 00031 #ifdef __GNUC__ 00032 #pragma interface 00033 #endif 00034 00035 #include <chemistry/qc/scf/scf.h> 00036 00037 namespace sc { 00038 00039 // ////////////////////////////////////////////////////////////////////////// 00040 00043 class HSOSSCF: public SCF { 00044 protected: 00045 Ref<PointGroup> most_recent_pg_; 00046 int user_occupations_; 00047 int tndocc_; 00048 int tnsocc_; 00049 int nirrep_; 00050 int *initial_ndocc_; 00051 int *initial_nsocc_; 00052 int *ndocc_; 00053 int *nsocc_; 00054 00055 ResultRefSymmSCMatrix cl_fock_; 00056 ResultRefSymmSCMatrix op_fock_; 00057 00058 // computes semicanonical orbitals. Uses fock() to get the fock matrix. 00059 // Should be overloaded if fock() does not return the correct matrix (e.g. HSOSKS) 00060 virtual void semicanonical(); 00061 bool semicanonical_evaluated_; 00062 AccResultRefDiagSCMatrix alpha_semican_evals_; 00063 AccResultRefDiagSCMatrix beta_semican_evals_; 00064 AccResultRefSCMatrix alpha_semican_evecs_; 00065 AccResultRefSCMatrix beta_semican_evecs_; 00066 00067 public: 00068 HSOSSCF(StateIn&); 00112 HSOSSCF(const Ref<KeyVal>&); 00113 ~HSOSSCF(); 00114 00115 void save_data_state(StateOut&); 00116 00117 void print(std::ostream&o=ExEnv::out0()) const; 00118 00119 double occupation(int irrep, int vectornum); 00120 double alpha_occupation(int irrep, int vectornum); 00121 double beta_occupation(int irrep, int vectornum); 00122 00123 int n_fock_matrices() const; 00128 RefSymmSCMatrix fock(int i); 00130 RefSymmSCMatrix effective_fock(); 00131 00132 void symmetry_changed(); 00133 00134 // returns 1 00135 int spin_polarized(); 00136 RefSymmSCMatrix density(); 00137 RefSymmSCMatrix alpha_density(); 00138 RefSymmSCMatrix beta_density(); 00139 00141 RefSCMatrix alpha_semicanonical_eigenvectors(); 00143 RefSCMatrix beta_semicanonical_eigenvectors(); 00145 RefDiagSCMatrix alpha_semicanonical_eigenvalues(); 00147 RefDiagSCMatrix beta_semicanonical_eigenvalues(); 00148 00149 protected: 00150 // these are temporary data, so they should not be checkpointed 00151 RefSymmSCMatrix cl_dens_; 00152 RefSymmSCMatrix cl_dens_diff_; 00153 RefSymmSCMatrix cl_gmat_; 00154 RefSymmSCMatrix op_dens_; 00155 RefSymmSCMatrix op_dens_diff_; 00156 RefSymmSCMatrix op_gmat_; 00157 00158 RefSymmSCMatrix cl_hcore_; 00159 00162 void set_occupations(const RefDiagSCMatrix& evals); 00163 virtual void set_occupations(const RefDiagSCMatrix& evals, bool can_change_multiplicity); 00164 00165 // scf things 00166 void init_vector(); 00167 void done_vector(); 00168 void reset_density(); 00169 double new_density(); 00170 double scf_energy(); 00171 00172 Ref<SCExtrapData> extrap_data(); 00173 00174 // gradient things 00175 void init_gradient(); 00176 void done_gradient(); 00177 00178 RefSymmSCMatrix lagrangian(); 00179 RefSymmSCMatrix gradient_density(); 00180 00181 // hessian things 00182 void init_hessian(); 00183 void done_hessian(); 00184 00185 // The Hartree-Fock derivatives 00186 void two_body_deriv_hf(double*grad,double exchange_fraction); 00187 }; 00188 00189 } 00190 00191 #endif 00192 00193 // Local Variables: 00194 // mode: c++ 00195 // c-file-style: "ETS" 00196 // End: