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

obwfn.h

00001 //
00002 // obwfn.h
00003 //
00004 // Copyright (C) 1996 Limit Point Systems, Inc.
00005 //
00006 // Author: Curtis Janssen <cljanss@limitpt.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_wfn_obwfn_h
00029 #define _chemistry_qc_wfn_obwfn_h
00030 
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034 
00035 #include <chemistry/qc/wfn/wfn.h>
00036 
00039 class OneBodyWavefunction: public Wavefunction {
00040  protected:
00041     ResultRefSymmSCMatrix density_;
00042     AccResultRefSCMatrix oso_eigenvectors_;
00043     AccResultRefDiagSCMatrix eigenvalues_;
00044     int nirrep_;
00045     int *nvecperirrep_;
00046     double *occupations_;
00047     double *alpha_occupations_;
00048     double *beta_occupations_;
00049 
00050     void init_sym_info();
00051 
00052     // oldocc is converted to newocc using the correlation
00053     // table between initial_pg_ and the current point group
00054     // returns 1 if successful and 0 otherwise.  newocc is
00055     // delete[]'ed and new'ed.
00056     int form_occupations(int *&newocc, const int *oldocc);
00057 
00058  public:
00059     OneBodyWavefunction(StateIn&);
00070     OneBodyWavefunction(const Ref<KeyVal>&);
00071     ~OneBodyWavefunction();
00072 
00073     void save_data_state(StateOut&);
00074 
00075     int nelectron();
00076 
00078     RefSCMatrix so_to_mo();
00080     RefSCMatrix orthog_so_to_mo();
00082     RefSCMatrix mo_to_so();
00085     RefSCMatrix mo_to_orthog_so();
00086 
00088     RefSCMatrix eigenvectors();
00090     virtual RefSCMatrix oso_eigenvectors() = 0;
00092     virtual RefDiagSCMatrix eigenvalues() = 0;
00095     virtual double occupation(int irrep, int vectornum) = 0;
00098     double occupation(int vectornum);
00099 
00101     virtual int spin_unrestricted() = 0;
00102 
00105     virtual double alpha_occupation(int irrep, int vectornum);
00108     virtual double beta_occupation(int irrep, int vectornum);
00111     double alpha_occupation(int vectornum);
00114     double beta_occupation(int vectornum);
00115     
00116     // Return alpha and beta electron densities
00117     virtual RefSCMatrix oso_alpha_eigenvectors();
00118     virtual RefSCMatrix oso_beta_eigenvectors();
00119     virtual RefSCMatrix alpha_eigenvectors();
00120     virtual RefSCMatrix beta_eigenvectors();
00121     virtual RefDiagSCMatrix alpha_eigenvalues();
00122     virtual RefDiagSCMatrix beta_eigenvalues();
00123 
00124     virtual RefDiagSCMatrix
00125       projected_eigenvalues(const Ref<OneBodyWavefunction>&, int alp=1);
00128     virtual RefSCMatrix projected_eigenvectors(const Ref<OneBodyWavefunction>&,
00129                                                int alp=1);
00132     virtual RefSCMatrix hcore_guess();
00136     virtual RefSCMatrix hcore_guess(RefDiagSCMatrix &val);
00137 
00138     void symmetry_changed();
00139     
00140     double orbital(const SCVector3& r, int iorb);
00141     double orbital_density(const SCVector3& r, int iorb, double* orbval = 0);
00142 
00143     void print(std::ostream&o=ExEnv::out()) const;
00144 };
00145 
00146 
00147 // This is useful as an initial guess for other one body wavefunctions
00148 class HCoreWfn: public OneBodyWavefunction {
00149   private:
00150     int nirrep_;
00151     int *docc_;
00152     int *socc_;
00153     int total_charge_;
00154     int user_occ_;
00155 
00156     void fill_occ(const RefDiagSCMatrix &evals,
00157                   int ndocc, int *docc, int nsocc = 0, int *socc = 0);
00158 
00159     void compute();
00160 
00161   public:
00162     HCoreWfn(StateIn&);
00163     HCoreWfn(const Ref<KeyVal>&);
00164     ~HCoreWfn();
00165 
00166     void save_data_state(StateOut&);
00167 
00168     double occupation(int irrep, int vectornum);
00169 
00170     RefSCMatrix oso_eigenvectors();
00171     RefDiagSCMatrix eigenvalues();
00172     RefSymmSCMatrix density();
00173     int spin_polarized();
00174     int spin_unrestricted();
00175 
00176     int value_implemented() const;
00177 };
00178 
00179 
00180 #endif
00181 
00182 // Local Variables:
00183 // mode: c++
00184 // c-file-style: "ETS"
00185 // End:

Generated at Thu Oct 4 18:08:46 2001 for MPQC 2.0.0 using the documentation package Doxygen 1.2.5.