- Main Page
- Classes
- Files
- 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&, double enuclear);
    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;
    00102     RefSymmSCMatrix fock(int i);
    00105     RefSymmSCMatrix effective_fock();
    00106
    00110     void set_desired_value_accuracy(double eps);
    00111
    00112   protected:
    00113     // these are temporary data, so they should not be checkpointed
    00114     Ref<TwoBodyInt> tbi_;
    00115
    00116     RefSymmSCMatrix densa_;
    00117     RefSymmSCMatrix densb_;
    00118     RefSymmSCMatrix gmata_;
    00119     RefSymmSCMatrix gmatb_;
    00120     RefSymmSCMatrix diff_densa_;
    00121     RefSymmSCMatrix diff_densb_;
    00122
    00123     void set_occupations(const RefDiagSCMatrix&);
    00124     void set_occupations(const RefDiagSCMatrix&, const RefDiagSCMatrix&);
    00125
    00126     void init_vector();
    00127     void done_vector();
    00128     double new_density();
    00129     void reset_density();
    00130     double scf_energy();
    00131     Ref<SCExtrapData> extrap_data();
    00132
    00133     void init_gradient();
    00134     void done_gradient();
    00135     RefSymmSCMatrix lagrangian();
    00136     RefSymmSCMatrix gradient_density();
    00137
    00138     void init_hessian();
    00139     void done_hessian();
    00140
    00141     // The Hartree-Fock derivatives
    00142     void two_body_deriv_hf(double*grad,double exchange_fraction);
    00143 };
    00144
    00145 }
    00146
    00147 #endif
    00148
    00149 // Local Variables:
    00150 // mode: c++
    00151 // c-file-style: "ETS"
    00152 // End: