00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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
00053
00054
00055
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
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
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
00183
00184
00185