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

wfn.h

00001 //
00002 // wfn.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_wfn_h
00029 #define _chemistry_qc_wfn_wfn_h
00030 
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034 
00035 #include <iostream>
00036 
00037 #include <util/misc/compute.h>
00038 #include <math/scmat/matrix.h>
00039 #include <math/scmat/vector3.h>
00040 #include <chemistry/molecule/energy.h>
00041 #include <chemistry/qc/basis/basis.h>
00042 #include <chemistry/qc/basis/integral.h>
00043 
00045 class Wavefunction: public MolecularEnergy {
00046   public:
00047 
00049     enum OrthogMethod { Symmetric=1, Canonical=2, GramSchmidt=3 };
00050 
00051   private:
00052     RefSCDimension aodim_;
00053     RefSCDimension sodim_;
00054     Ref<SCMatrixKit> basiskit_;
00055     
00056     ResultRefSymmSCMatrix overlap_;
00057     ResultRefSymmSCMatrix hcore_;
00058     ResultRefSCMatrix natural_orbitals_;
00059     ResultRefDiagSCMatrix natural_density_;
00060 
00061     double * bs_values;
00062     double * bsg_values;
00063 
00064     Ref<GaussianBasisSet> gbs_;
00065     Ref<Integral> integral_;
00066 
00067     // The tolerance for linearly independent basis functions.
00068     // The intepretation depends on the orthogonalization method.
00069     double lindep_tol_;
00070     // The orthogonalization method
00071     OrthogMethod orthog_method_;
00072     // The dimension in the orthogonalized SO basis
00073     RefSCDimension osodim_;
00074     // The orthogonalization matrices
00075     RefSCMatrix orthog_trans_;
00076     RefSCMatrix orthog_trans_inverse_;
00077     // The maximum and minimum residuals from the orthogonalization
00078     // procedure.  The interpretation depends on the method used.
00079     // For symmetry and canonical, these are the min and max overlap
00080     // eigenvalues.  These are the residuals for the basis functions
00081     // that actually end up being used.
00082     double min_orthog_res_;
00083     double max_orthog_res_;
00084 
00085     int print_nao_;
00086     int print_npa_;
00087 
00088     void compute_overlap_eig(RefSCMatrix& overlap_eigvec,
00089                              RefDiagSCMatrix& overlap_isqrt_eigval,
00090                              RefDiagSCMatrix& overlap_sqrt_eigval);
00091     void compute_symmetric_orthog();
00092     void compute_canonical_orthog();
00093     void compute_gs_orthog();
00094     void compute_orthog_trans();
00095 
00096   protected:
00097 
00098     int debug_;
00099 
00100     double min_orthog_res() const { return min_orthog_res_; }
00101     double max_orthog_res() const { return max_orthog_res_; }
00102 
00103     void copy_orthog_info(const Ref<Wavefunction> &);
00104     
00105   public:
00106     Wavefunction(StateIn&);
00139     Wavefunction(const Ref<KeyVal>&);
00140     virtual ~Wavefunction();
00141 
00142     void save_data_state(StateOut&);
00143 
00144     double density(const SCVector3&);
00145     double density_gradient(const SCVector3&,double*);
00146     double natural_orbital(const SCVector3& r, int iorb);
00147     double natural_orbital_density(const SCVector3& r,
00148                                    int orb, double* orbval = 0);
00149     double orbital(const SCVector3& r, int iorb, const RefSCMatrix& orbs);
00150 
00151     double orbital_density(const SCVector3& r,
00152                            int iorb,
00153                            const RefSCMatrix& orbs,
00154                            double* orbval = 0);
00155 
00157     double charge();
00159     virtual int nelectron() = 0;
00160 
00162     virtual RefSymmSCMatrix density() = 0;
00164     virtual RefSymmSCMatrix ao_density();
00166     virtual RefSCMatrix natural_orbitals();
00168     virtual RefDiagSCMatrix natural_density();
00169 
00171     virtual int spin_polarized() = 0;
00172 
00174     virtual RefSymmSCMatrix alpha_density();
00176     virtual RefSymmSCMatrix beta_density();
00178     virtual RefSymmSCMatrix alpha_ao_density();
00180     virtual RefSymmSCMatrix beta_ao_density();
00181 
00183     virtual RefSCMatrix nao(double *atom_charges=0);
00184 
00186     virtual RefSymmSCMatrix overlap();
00188     virtual RefSymmSCMatrix core_hamiltonian();
00189 
00191     RefSCDimension ao_dimension();
00193     RefSCDimension so_dimension();
00195     RefSCDimension oso_dimension();
00197     Ref<SCMatrixKit> basis_matrixkit();
00199     Ref<GaussianBasisSet> basis() const;
00201     Ref<Integral> integral();
00202 
00203     // override symmetry_changed from MolecularEnergy
00204     void symmetry_changed();
00205 
00212     RefSCMatrix so_to_orthog_so();
00213 
00216     RefSCMatrix so_to_orthog_so_inverse();
00217 
00219     OrthogMethod orthog_method() { return orthog_method_; }
00220 
00221     void obsolete();
00222 
00223     void print(std::ostream& = ExEnv::out()) const;
00224 };
00225 
00226 
00227 #endif
00228 
00229 // Local Variables:
00230 // mode: c++
00231 // c-file-style: "ETS"
00232 // End:

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