Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

uscf.h

00001 //
00002 // uscf.h --- definition of the UnrestrictedSCF abstract base class
00003 //
00004 // Copyright (C) 1997 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_uscf_h
00029 #define _chemistry_qc_scf_uscf_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 
00042 class UnrestrictedSCF: public SCF {
00043   protected:
00044     Ref<PointGroup> most_recent_pg_;
00045     int user_occupations_;
00046     int tnalpha_;
00047     int tnbeta_;
00048     int nirrep_;
00049     int *nalpha_;
00050     int *nbeta_;
00051     int *initial_nalpha_;
00052     int *initial_nbeta_;
00053 
00054     AccResultRefSCMatrix oso_eigenvectors_beta_;
00055     AccResultRefDiagSCMatrix eigenvalues_beta_;
00056     ResultRefSymmSCMatrix focka_;
00057     ResultRefSymmSCMatrix fockb_;
00058 
00059   protected:
00060     Ref<SCExtrapError> extrap_error();
00061     // calculate the scf vector, returning the accuracy
00062     double compute_vector(double&);
00063     void initial_vector(int needv=1);
00064     
00065   public:
00066     UnrestrictedSCF(StateIn&);
00067     UnrestrictedSCF(const Ref<KeyVal>&);
00068     ~UnrestrictedSCF();
00069 
00070     void save_data_state(StateOut&);
00071 
00072     RefSCMatrix eigenvectors();
00073     RefDiagSCMatrix eigenvalues();
00074 
00075     RefSCMatrix oso_alpha_eigenvectors();
00076     RefSCMatrix alpha_eigenvectors();
00077     RefDiagSCMatrix alpha_eigenvalues();
00078     RefSCMatrix oso_beta_eigenvectors();
00079     RefSCMatrix beta_eigenvectors();
00080     RefDiagSCMatrix beta_eigenvalues();
00081 
00082     RefSymmSCMatrix alpha_density();
00083     RefSymmSCMatrix beta_density();
00084     RefSymmSCMatrix density();
00085 
00086     void symmetry_changed();
00087 
00088     double occupation(int, int);
00089     double alpha_occupation(int, int);
00090     double beta_occupation(int, int);
00091     
00092     // both return 1
00093     int spin_polarized();
00094     int spin_unrestricted();
00095     
00096     void print(std::ostream&o=ExEnv::out0()) const;
00097 
00098     int n_fock_matrices() const;
00099     RefSymmSCMatrix fock(int);
00100     RefSymmSCMatrix effective_fock();
00101     
00102   protected:
00103     // these are temporary data, so they should not be checkpointed
00104     Ref<TwoBodyInt> tbi_;
00105     
00106     RefSymmSCMatrix densa_;
00107     RefSymmSCMatrix densb_;
00108     RefSymmSCMatrix gmata_;
00109     RefSymmSCMatrix gmatb_;
00110     RefSymmSCMatrix diff_densa_;
00111     RefSymmSCMatrix diff_densb_;
00112 
00113     void set_occupations(const RefDiagSCMatrix&);
00114     void set_occupations(const RefDiagSCMatrix&, const RefDiagSCMatrix&);
00115 
00116     void init_vector();
00117     void done_vector();
00118     double new_density();
00119     void reset_density();
00120     double scf_energy();
00121     Ref<SCExtrapData> extrap_data();
00122 
00123     void init_gradient();
00124     void done_gradient();
00125     RefSymmSCMatrix lagrangian();
00126     RefSymmSCMatrix gradient_density();
00127     
00128     void init_hessian();
00129     void done_hessian();
00130 
00131     // The Hartree-Fock derivatives
00132     void two_body_deriv_hf(double*grad,double exchange_fraction);
00133 };
00134 
00135 }
00136 
00137 #endif
00138 
00139 // Local Variables:
00140 // mode: c++
00141 // c-file-style: "ETS"
00142 // End:

Generated at Fri Jan 10 08:14:10 2003 for MPQC 2.1.3 using the documentation package Doxygen 1.2.14.