Google

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 
00044 namespace sc {
00045 
00047 class Wavefunction: public MolecularEnergy {
00048   public:
00049 
00051     enum OrthogMethod { Symmetric=1, Canonical=2, GramSchmidt=3 };
00052 
00053   private:
00054     RefSCDimension aodim_;
00055     RefSCDimension sodim_;
00056     Ref<SCMatrixKit> basiskit_;
00057     
00058     ResultRefSymmSCMatrix overlap_;
00059     ResultRefSymmSCMatrix hcore_;
00060     ResultRefSCMatrix natural_orbitals_;
00061     ResultRefDiagSCMatrix natural_density_;
00062 
00063     double * bs_values;
00064     double * bsg_values;
00065 
00066     Ref<GaussianBasisSet> gbs_;
00067     Ref<Integral> integral_;
00068 
00069     // The tolerance for linearly independent basis functions.
00070     // The intepretation depends on the orthogonalization method.
00071     double lindep_tol_;
00072     // The orthogonalization method
00073     OrthogMethod orthog_method_;
00074     // The dimension in the orthogonalized SO basis
00075     RefSCDimension osodim_;
00076     // The orthogonalization matrices
00077     RefSCMatrix orthog_trans_;
00078     RefSCMatrix orthog_trans_inverse_;
00079     // The maximum and minimum residuals from the orthogonalization
00080     // procedure.  The interpretation depends on the method used.
00081     // For symmetry and canonical, these are the min and max overlap
00082     // eigenvalues.  These are the residuals for the basis functions
00083     // that actually end up being used.
00084     double min_orthog_res_;
00085     double max_orthog_res_;
00086 
00087     int print_nao_;
00088     int print_npa_;
00089 
00090     void compute_overlap_eig(RefSCMatrix& overlap_eigvec,
00091                              RefDiagSCMatrix& overlap_isqrt_eigval,
00092                              RefDiagSCMatrix& overlap_sqrt_eigval);
00093     void compute_symmetric_orthog();
00094     void compute_canonical_orthog();
00095     void compute_gs_orthog();
00096     void compute_orthog_trans();
00097 
00098   protected:
00099 
00100     int debug_;
00101 
00102     double min_orthog_res() const { return min_orthog_res_; }
00103     double max_orthog_res() const { return max_orthog_res_; }
00104 
00105     void copy_orthog_info(const Ref<Wavefunction> &);
00106     
00107   public:
00108     Wavefunction(StateIn&);
00141     Wavefunction(const Ref<KeyVal>&);
00142     virtual ~Wavefunction();
00143 
00144     void save_data_state(StateOut&);
00145 
00146     double density(const SCVector3&);
00147     double density_gradient(const SCVector3&,double*);
00148     double natural_orbital(const SCVector3& r, int iorb);
00149     double natural_orbital_density(const SCVector3& r,
00150                                    int orb, double* orbval = 0);
00151     double orbital(const SCVector3& r, int iorb, const RefSCMatrix& orbs);
00152 
00153     double orbital_density(const SCVector3& r,
00154                            int iorb,
00155                            const RefSCMatrix& orbs,
00156                            double* orbval = 0);
00157 
00159     double charge();
00161     virtual int nelectron() = 0;
00162 
00164     virtual RefSymmSCMatrix density() = 0;
00166     virtual RefSymmSCMatrix ao_density();
00168     virtual RefSCMatrix natural_orbitals();
00170     virtual RefDiagSCMatrix natural_density();
00171 
00173     virtual int spin_polarized() = 0;
00174 
00176     virtual RefSymmSCMatrix alpha_density();
00178     virtual RefSymmSCMatrix beta_density();
00180     virtual RefSymmSCMatrix alpha_ao_density();
00182     virtual RefSymmSCMatrix beta_ao_density();
00183 
00185     virtual RefSCMatrix nao(double *atom_charges=0);
00186 
00188     virtual RefSymmSCMatrix overlap();
00190     virtual RefSymmSCMatrix core_hamiltonian();
00191 
00193     RefSCDimension ao_dimension();
00195     RefSCDimension so_dimension();
00197     RefSCDimension oso_dimension();
00199     Ref<SCMatrixKit> basis_matrixkit();
00201     Ref<GaussianBasisSet> basis() const;
00203     Ref<Integral> integral();
00204 
00205     // override symmetry_changed from MolecularEnergy
00206     void symmetry_changed();
00207 
00214     RefSCMatrix so_to_orthog_so();
00215 
00218     RefSCMatrix so_to_orthog_so_inverse();
00219 
00221     OrthogMethod orthog_method() const { return orthog_method_; }
00222 
00224     double lindep_tol() const { return lindep_tol_; }
00225 
00226     void obsolete();
00227 
00228     void print(std::ostream& = ExEnv::out0()) const;
00229 };
00230 
00231 }
00232 
00233 #endif
00234 
00235 // Local Variables:
00236 // mode: c++
00237 // c-file-style: "ETS"
00238 // End:

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