MPQC  3.0.0-alpha
transform.h
1 //
2 // transform.h
3 //
4 // Copyright (C) 1996 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_transform_h
29 #define _chemistry_qc_basis_transform_h
30 
31 namespace sc {
32 
33 // ///////////////////////////////////////////////////////////////////////////
34 
38  protected:
39  double coef_;
40  int a_, b_, c_, cartindex_, pureindex_;
41 
42  public:
43  virtual ~SphericalTransformComponent();
44 
46  int a() const { return a_; }
48  int b() const { return b_; }
50  int c() const { return c_; }
52  int cartindex() const { return cartindex_; }
54  int pureindex() const { return pureindex_; }
56  double coef() const { return coef_; }
57 
66  virtual void init(int a, int b, int c, double coef, int pureindex) =0;
67 };
68 
69 // ///////////////////////////////////////////////////////////////////////////
70 
74  protected:
75  int n_;
76  int l_;
77  int subl_;
78  SphericalTransformComponent *components_;
79 
81 
89  SphericalTransform(int l, int subl = -1);
90 
95  virtual void init();
96 
97  public:
98  virtual ~SphericalTransform();
99 
101  void add(int a, int b, int c, double coef, int pureindex);
102 
104  int cartindex(int i) const { return components_[i].cartindex(); }
106  int pureindex(int i) const { return components_[i].pureindex(); }
108  double coef(int i) const { return components_[i].coef(); }
110  int a(int i) const { return components_[i].a(); }
112  int b(int i) const { return components_[i].b(); }
114  int c(int i) const { return components_[i].c(); }
116  int l() const { return l_; }
118  int n() const { return n_; }
119 
123 };
124 
127  protected:
129  ISphericalTransform(int l,int subl=-1);
130  void init();
131 };
132 
133 // ///////////////////////////////////////////////////////////////////////////
134 
137  private:
138  int i_;
139 
140  protected:
141  const SphericalTransform *transform_;
142 
143  public:
146 
147  void begin() { i_ = 0; }
148  void start() { begin(); }
149  void next() { i_++; }
150  int ready() { return i_ < transform_->n(); }
151  operator int() { return ready(); }
152  int l() { return transform_->l(); }
153  int cartindex() { return transform_->cartindex(i_); }
154  int pureindex() { return transform_->pureindex(i_); }
155  int bfn() { return pureindex(); }
156  double coef() { return transform_->coef(i_); }
157  int a() { return transform_->a(i_); }
158  int b() { return transform_->b(i_); }
159  int c() { return transform_->c(i_); }
160  int l(int i) { return i?(i==1?b():c()):a(); }
161  int n() { return 2*l() + 1; }
162 };
163 
164 }
165 
166 #endif
167 
168 // Local Variables:
169 // mode: c++
170 // c-file-style: "ETS"
171 // End:
sc::SphericalTransform::init
virtual void init()
This determines all of the components of the transformation.
sc::SphericalTransformComponent::coef
double coef() const
Returns the coefficient of this component of the transformation.
Definition: transform.h:56
sc::SphericalTransformComponent::cartindex
int cartindex() const
Returns the index of the Cartesian basis function.
Definition: transform.h:52
sc::SphericalTransform::b
int b(int i) const
Returns the Cartesian basis function's y exponent of component i.
Definition: transform.h:112
sc::SphericalTransform::cartindex
int cartindex(int i) const
Returns the Cartesian basis function index of component i.
Definition: transform.h:104
sc::ISphericalTransform
This describes a solid harmonic to Cartesian transform.
Definition: transform.h:126
sc::SphericalTransformComponent::c
int c() const
Returns the exponent of z.
Definition: transform.h:50
sc::SphericalTransformIter
This iterates through the components of a SphericalTransform.
Definition: transform.h:136
sc::SphericalTransform::coef
double coef(int i) const
Returns the transform coefficient of component i.
Definition: transform.h:108
sc::SphericalTransformComponent::pureindex
int pureindex() const
Returns the index solid harmonic basis function.
Definition: transform.h:54
sc::SphericalTransform::new_components
virtual SphericalTransformComponent * new_components()=0
This must create SphericalTransformComponent's of the appropriate specialization.
sc::SphericalTransformComponent::a
int a() const
Returns the exponent of x.
Definition: transform.h:46
sc::SphericalTransform::pureindex
int pureindex(int i) const
Returns the solid harmonic basis function index of component i.
Definition: transform.h:106
sc::SphericalTransformComponent::b
int b() const
Returns the exponent of y.
Definition: transform.h:48
sc::ISphericalTransform::init
void init()
This determines all of the components of the transformation.
sc::SphericalTransformComponent
This is a base class for a container for a component of a sparse Cartesian to solid harmonic basis fu...
Definition: transform.h:37
sc::SphericalTransform::n
int n() const
Returns the number of components in the transformation.
Definition: transform.h:118
sc::SphericalTransform
This is a base class for a container for a sparse Cartesian to solid harmonic basis function transfor...
Definition: transform.h:73
sc::SphericalTransformComponent::init
virtual void init(int a, int b, int c, double coef, int pureindex)=0
Initialize this object.
sc::SphericalTransform::a
int a(int i) const
Returns the Cartesian basis function's x exponent of component i.
Definition: transform.h:110
sc::SphericalTransform::add
void add(int a, int b, int c, double coef, int pureindex)
Adds another SphericalTransformComponent.
sc::SphericalTransform::c
int c(int i) const
Returns the Cartesian basis function's z exponent of component i.
Definition: transform.h:114
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::SphericalTransform::l
int l() const
Returns the angular momentum.
Definition: transform.h:116

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