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_basis_sobasis_h
00029 #define _chemistry_qc_basis_sobasis_h
00030
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034
00035 #include <chemistry/qc/basis/basis.h>
00036
00039 class SOTransformFunction {
00040 public:
00042 double coef;
00044 int aofunc;
00046 int sofunc;
00048 int irrep;
00049 };
00050
00054 class SOTransformShell {
00055 public:
00057 int aoshell;
00059 int nfunc;
00061 SOTransformFunction *func;
00062 SOTransformShell();
00063 ~SOTransformShell();
00065 void add_func(int irrep, double coef, int aofunc, int sofunc);
00066 };
00067
00071 class SOTransform {
00072 public:
00073 int naoshell_allocated;
00075 int naoshell;
00077 SOTransformShell *aoshell;
00078 SOTransform();
00079 ~SOTransform();
00080 void set_naoshell(int n);
00082 void add_transform(int aoshell, int irrep,
00083 double coef, int aofunc, int sofunc);
00084 };
00085
00088 class SOBasis : public RefCount {
00089 protected:
00090 Ref<GaussianBasisSet> basis_;
00091 int nshell_;
00092 int nirrep_;
00093 int *ncomp_;
00094 int **nfunc_;
00095 int *naofunc_;
00096 int **funcoff_;
00097
00098 int *nfunc_in_irrep_;
00099 int *func_;
00100 int *irrep_;
00101 int *func_within_irrep_;
00102
00103 SOTransform *trans_;
00104
00105 public:
00107 SOBasis(const Ref<GaussianBasisSet> &, const Ref<Integral>&);
00108 ~SOBasis();
00109
00111 int nshell() const { return nshell_; }
00113 int nirrep() const { return nirrep_; }
00114 int ncomponent(int iirrep) const { return ncomp_[iirrep]; }
00116 int nfunction_in_irrep(int irrep) const { return nfunc_in_irrep_[irrep]; }
00118 int function_offset_for_irrep(int irrep) const;
00120 int nfunction(int ishell) const;
00123 int naofunction(int ishell) const { return naofunc_[ishell]; }
00125 int nfunction(int ishell, int iirrep) const;
00128 int max_nfunction_in_shell() const;
00132 int function_offset_within_shell(int ishell, int iirrep) const;
00133
00136 int function(int ishell);
00137
00139 int irrep(int ishell, int ifunc) const;
00141 int function_within_irrep(int ishell, int ifunc) const;
00142
00144 const SOTransform &trans(int i) const { return trans_[i]; }
00145
00146 void print(std::ostream &o=ExEnv::out()) const;
00147 };
00148
00149
00150 inline int
00151 SOBasis::function(int ishell)
00152 {
00153 return func_[ishell];
00154 }
00155
00156 inline int
00157 SOBasis::irrep(int ishell, int ifunc) const
00158 {
00159 return irrep_[func_[ishell]+ifunc];
00160 }
00161
00162 inline int
00163 SOBasis::function_offset_for_irrep(int irrep) const
00164 {
00165 int r = 0;
00166 for (int i=0; i<irrep; i++) {
00167 r += nfunc_in_irrep_[i];
00168 }
00169 return r;
00170 }
00171
00172 inline int
00173 SOBasis::function_within_irrep(int ishell, int ifunc) const
00174 {
00175 return func_within_irrep_[func_[ishell]+ifunc];
00176 }
00177
00178 inline int
00179 SOBasis::nfunction(int ishell, int iirrep) const
00180 {
00181 return nfunc_[ishell][iirrep];
00182 }
00183
00184 inline int
00185 SOBasis::function_offset_within_shell(int ishell, int iirrep) const
00186 {
00187 return funcoff_[ishell][iirrep];
00188 }
00189
00190 #endif
00191
00192
00193
00194
00195