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
00037
namespace sc {
00038
00041 class OneBodyWavefunction:
public Wavefunction {
00042
protected:
00043
ResultRefSymmSCMatrix density_;
00044
AccResultRefSCMatrix oso_eigenvectors_;
00045
AccResultRefDiagSCMatrix eigenvalues_;
00046
int nirrep_;
00047
int *nvecperirrep_;
00048
double *occupations_;
00049
double *alpha_occupations_;
00050
double *beta_occupations_;
00051
00052
void init_sym_info();
00053
00054
00055
00056
00057
00058
int form_occupations(
int *&newocc,
const int *oldocc);
00059
00060
public:
00061
OneBodyWavefunction(
StateIn&);
00072
OneBodyWavefunction(
const Ref<KeyVal>&);
00073 ~
OneBodyWavefunction();
00074
00075
void save_data_state(
StateOut&);
00076
00077
int nelectron();
00078
00080
RefSCMatrix so_to_mo();
00082
RefSCMatrix orthog_so_to_mo();
00084
RefSCMatrix mo_to_so();
00087
RefSCMatrix mo_to_orthog_so();
00088
00090
RefSCMatrix eigenvectors();
00092
virtual RefSCMatrix oso_eigenvectors() = 0;
00094
virtual RefDiagSCMatrix eigenvalues() = 0;
00097
virtual double occupation(
int irrep,
int vectornum) = 0;
00100
double occupation(
int vectornum);
00101
00103
virtual int spin_unrestricted() = 0;
00104
00107
virtual double alpha_occupation(
int irrep,
int vectornum);
00110
virtual double beta_occupation(
int irrep,
int vectornum);
00113
double alpha_occupation(
int vectornum);
00116
double beta_occupation(
int vectornum);
00117
00118
00119
virtual RefSCMatrix oso_alpha_eigenvectors();
00120
virtual RefSCMatrix oso_beta_eigenvectors();
00121
virtual RefSCMatrix alpha_eigenvectors();
00122
virtual RefSCMatrix beta_eigenvectors();
00123
virtual RefDiagSCMatrix alpha_eigenvalues();
00124
virtual RefDiagSCMatrix beta_eigenvalues();
00125
00126
virtual RefDiagSCMatrix
00127 projected_eigenvalues(
const Ref<OneBodyWavefunction>&,
int alp=1);
00130
virtual RefSCMatrix projected_eigenvectors(
const Ref<OneBodyWavefunction>&,
00131
int alp=1);
00134
virtual RefSCMatrix hcore_guess();
00138
virtual RefSCMatrix hcore_guess(
RefDiagSCMatrix &val);
00139
00140
void symmetry_changed();
00141
00142
double orbital(
const SCVector3& r,
int iorb);
00143
double orbital_density(
const SCVector3& r,
int iorb,
double* orbval = 0);
00144
00145
void print(std::ostream&o=ExEnv::out0())
const;
00146 };
00147
00148
00149
00150
class HCoreWfn:
public OneBodyWavefunction {
00151
private:
00152
int nirrep_;
00153
int *docc_;
00154
int *socc_;
00155
int total_charge_;
00156
int user_occ_;
00157
00158
void fill_occ(
const RefDiagSCMatrix &evals,
00159
int ndocc,
int *docc,
int nsocc = 0,
int *socc = 0);
00160
00161
void compute();
00162
00163
public:
00164 HCoreWfn(
StateIn&);
00165 HCoreWfn(
const Ref<KeyVal>&);
00166 ~HCoreWfn();
00167
00168
void save_data_state(
StateOut&);
00169
00170
double occupation(
int irrep,
int vectornum);
00171
00172
RefSCMatrix oso_eigenvectors();
00173
RefDiagSCMatrix eigenvalues();
00174
RefSymmSCMatrix density();
00175
int spin_polarized();
00176
int spin_unrestricted();
00177
00178
int value_implemented() const;
00179 };
00180
00181 }
00182
00183 #endif
00184
00185
00186
00187
00188