MPQC  3.0.0-alpha
sobasis.h
1 //
2 // sobasis.h --- definition of the Integral class
3 //
4 // Copyright (C) 1998 Limit Point Systems, Inc.
5 //
6 // Author: Curtis Janssen <cljanss@limitpt.com>
7 // Maintainer: LPS
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _chemistry_qc_basis_sobasis_h
29 #define _chemistry_qc_basis_sobasis_h
30 
31 #include <chemistry/qc/basis/basis.h>
32 
33 namespace sc {
34 
38  public:
40  double coef;
42  int aofunc;
44  int sofunc;
46  int irrep;
47 };
48 
53  public:
55  int aoshell;
57  int nfunc;
63  void add_func(int irrep, double coef, int aofunc, int sofunc);
64 };
65 
69 class SOTransform {
70  public:
71  int naoshell_allocated;
73  int naoshell;
76  SOTransform();
77  ~SOTransform();
78  void set_naoshell(int n);
80  void add_transform(int aoshell, int irrep,
81  double coef, int aofunc, int sofunc);
82 };
83 
91 class SOBasis : public RefCount {
92  protected:
93  Ref<GaussianBasisSet> basis_;
94  int nshell_; //< number of unique AO shells
95  int nirrep_;
96  int *ncomp_;
97  int **nfunc_;
98  int *naofunc_;
99  int **funcoff_;
100 
101  int *nfunc_in_irrep_;
102  int *func_;
103  int *irrep_;
104  int *func_within_irrep_;
105 
106  SOTransform *trans_;
107 
108  public:
111  ~SOBasis();
112 
114  int nshell() const { return nshell_; }
116  int nirrep() const { return nirrep_; }
117  int ncomponent(int iirrep) const { return ncomp_[iirrep]; }
119  int nfunction_in_irrep(int irrep) const { return nfunc_in_irrep_[irrep]; }
121  int function_offset_for_irrep(int irrep) const;
123  int nfunction(int ishell) const;
126  int naofunction(int ishell) const { return naofunc_[ishell]; }
128  int nfunction(int ishell, int iirrep) const;
131  int max_nfunction_in_shell() const;
135  int function_offset_within_shell(int ishell, int iirrep) const;
136 
139  int function(int ishell);
140 
142  int irrep(int ishell, int ifunc) const;
144  int function_within_irrep(int ishell, int ifunc) const;
145 
147  const SOTransform &trans(int ishell) const { return trans_[ishell]; }
148 
149  void print(std::ostream &o=ExEnv::out0()) const;
150 };
151 
152 
153 inline int
154 SOBasis::function(int ishell)
155 {
156  return func_[ishell];
157 }
158 
159 inline int
160 SOBasis::irrep(int ishell, int ifunc) const
161 {
162  return irrep_[func_[ishell]+ifunc];
163 }
164 
165 inline int
167 {
168  int r = 0;
169  for (int i=0; i<irrep; i++) {
170  r += nfunc_in_irrep_[i];
171  }
172  return r;
173 }
174 
175 inline int
176 SOBasis::function_within_irrep(int ishell, int ifunc) const
177 {
178  return func_within_irrep_[func_[ishell]+ifunc];
179 }
180 
181 inline int
182 SOBasis::nfunction(int ishell, int iirrep) const
183 {
184  return nfunc_[ishell][iirrep];
185 }
186 
187 inline int
188 SOBasis::function_offset_within_shell(int ishell, int iirrep) const
189 {
190  return funcoff_[ishell][iirrep];
191 }
192 
193 }
194 
195 #endif
196 
197 // Local Variables:
198 // mode: c++
199 // c-file-style: "CLJ"
200 // End:
sc::SOTransformShell::aoshell
int aoshell
The number of the AO shell from which these functions come.
Definition: sobasis.h:55
sc::SOBasis::naofunction
int naofunction(int ishell) const
Return the number of functions in the AO shell that make up the given SO shell.
Definition: sobasis.h:126
sc::SOBasis::function_offset_within_shell
int function_offset_within_shell(int ishell, int iirrep) const
Normally, SO shell numbering starts at zero within each irrep.
Definition: sobasis.h:188
sc::SOTransformFunction::irrep
int irrep
The SO function's irrep.
Definition: sobasis.h:46
sc::SOTransformShell::nfunc
int nfunc
The number of AO/SO function pairs contributing.
Definition: sobasis.h:57
sc::SOBasis::function_offset_for_irrep
int function_offset_for_irrep(int irrep) const
Return the offset for the first function of the given irrep.
Definition: sobasis.h:166
sc::SOTransform::naoshell
int naoshell
The number of AO shells that make up this SO shell.
Definition: sobasis.h:73
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::SOBasis::nfunction_in_irrep
int nfunction_in_irrep(int irrep) const
Return the number of functions in the given irrep.
Definition: sobasis.h:119
sc::SOTransform::add_transform
void add_transform(int aoshell, int irrep, double coef, int aofunc, int sofunc)
Adds another term to the transform.
sc::SOBasis::irrep
int irrep(int ishell, int ifunc) const
Convert SO shell and function number within shell to irrep.
Definition: sobasis.h:160
sc::SOTransform::aoshell
SOTransformShell * aoshell
The SOTransformShell object for each AO.
Definition: sobasis.h:75
sc::SOTransformFunction::aofunc
int aofunc
The AO function number.
Definition: sobasis.h:42
sc::SOBasis::trans
const SOTransform & trans(int ishell) const
Return the SOTransform object for the given shell.
Definition: sobasis.h:147
sc::SOBasis::function_within_irrep
int function_within_irrep(int ishell, int ifunc) const
Convert SO shell and function number to number within irrep.
Definition: sobasis.h:176
sc::SOBasis::function
int function(int ishell)
Convert the SO shell number to the overall number of the first function within that shell.
Definition: sobasis.h:154
sc::SOTransformFunction
SOTransformShell describes how an AO function contributes to an SO function in a particular SO shell.
Definition: sobasis.h:37
sc::SOTransform
SOTransform maintains a list of AO shells that are be used to compute the SO.
Definition: sobasis.h:69
sc::SOTransformShell
SOTransformShell maintains a list of AO functions contribute to an SO function in a particular SO she...
Definition: sobasis.h:52
sc::SOBasis::nfunction
int nfunction(int ishell) const
Return the number of functions in the given shell.
sc::SOBasis::nshell
int nshell() const
Return the number of shells.
Definition: sobasis.h:114
sc::SOBasis::nirrep
int nirrep() const
Return the number of irreps.
Definition: sobasis.h:116
sc::SOTransformShell::func
SOTransformFunction * func
The array of SOTransformFunction objects describing the transform.
Definition: sobasis.h:59
sc::SOTransformFunction::sofunc
int sofunc
The SO function number.
Definition: sobasis.h:44
sc::SOBasis::SOBasis
SOBasis(const Ref< GaussianBasisSet > &, const Ref< Integral > &)
Create an SOBasis object given a GaussianBasisSet and Integral objects.
sc::ExEnv::out0
static std::ostream & out0()
Return an ostream that writes from node 0.
sc::SOBasis
A SOBasis object describes the transformation from an atomic orbital basis to a symmetry orbital basi...
Definition: sobasis.h:91
sc::SOTransformShell::add_func
void add_func(int irrep, double coef, int aofunc, int sofunc)
Add another function to the transform.
sc::RefCount
The base class for all reference counted objects.
Definition: ref.h:192
sc::SOBasis::max_nfunction_in_shell
int max_nfunction_in_shell() const
Returns the maximum number of functions in a shell (summed over all irreps)
sc::SOTransformFunction::coef
double coef
The coefficient of the AO.
Definition: sobasis.h:40
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14

Generated at Sun Jan 26 2020 23:23:57 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.