Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/LIBS.h
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/LIBS.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/LIBS.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,6 @@
+libSCintcca.LIBSUF
+#include <util/keyval/LIBS.h>
+#include <util/misc/LIBS.h>
+#include <chemistry/qc/basis/LIBS.h>
+#include <chemistry/qc/intv3/LIBS.h>
+#include <chemistry/cca/LIBS.h>
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/Makefile
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/Makefile	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/Makefile	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,84 @@
+#
+# Makefile
+#
+# Copyright (C) 1996 Limit Point Systems, Inc.
+#
+# Author: Curtis Janssen <cljanss@ca.sandia.gov>
+# Maintainer: LPS
+#
+# This file is part of the SC Toolkit.
+#
+# The SC Toolkit is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Library General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# The SC Toolkit is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# The U.S. Government is granted a limited license as per AL 91-7.
+#
+
+TOPDIR=../../../../..
+ifndef SRCDIR
+  SRCDIR=$(shell pwd)
+endif
+
+include $(SRCDIR)/$(TOPDIR)/lib/GlobalMakefile
+ifeq ($(HAVE_LIBINT),yes)
+  DEFINES += -DHAVE_CINTS
+endif
+ifeq ($(INTV3_ORDER),yes)
+  DEFINES += -DINTV3_ORDER
+endif
+
+TARGET_TO_MAKE = libSCintcca
+BIN_OR_LIB = LIB
+
+DEFINES += -DDMALLOC
+
+CXXSRC = int1e.cc int2e.cc obintcca.cc tbintcca.cc intcca.cc
+
+INC = int1e.h int2e.h obintcca.h tbintcca.h intcca.h cartit.h tform.h
+
+CPPFLAGS += -I../../cca
+LTLINKLIBOPTS += -L$(CCAFE_LIB) -R$(CCAFE_LIB) -lccafeCore \
+  -L$(BABEL_LIB) -R$(BABEL_LIB) -lsidl \
+  -L$(CCA_CHEM_LIB) -R$(CCA_CHEM_LIB) -lccachem_cxx_client -lccachem_cxx_server
+
+LIBSRC = $(CXXSRC) $(CSRC) $(XCSRC)
+LIBOBJ = $(LIBSRC:%.c=%.$(OBJSUF))
+LIBOBJ := $(LIBOBJ:%.cc=%.$(OBJSUF))
+
+DISTFILES = $(INC) Makefile
+
+DEPENDINCLUDE = $(INC) $(GENINC) $(SGENINC)
+
+#############################################################
+
+default:: $(DEPENDINCLUDE)
+interface:: $(DEPENDINCLUDE)
+
+include $(SRCDIR)/$(TOPDIR)/lib/GlobalRules
+
+targetclean::
+
+$(TESTOBJ:.$(OBJSUF)=.d) $(LIBOBJ:.$(OBJSUF)=.d): $(DEPENDINCLUDE)
+ifneq ($(DODEPEND),no)
+include $(LIBOBJ:.$(OBJSUF)=.d) $(TESTOBJ:.$(OBJSUF)=.d)
+endif
+
+#############################################################
+
+# need babel headers generated
+ifneq ($(DODEPEND),no)
+include ../../cca/.babel-stamp
+endif
+../../cca/.babel-stamp:
+	cd ../../cca; $(MAKE) .babel-stamp
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/cartit.h
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/cartit.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/cartit.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,105 @@
+//
+// cartit.h
+//
+// Copyright (C) 2001 Edward Valeev
+//
+// Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
+// Maintainer: EV
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifndef _chemistry_qc_cints_cartit_h
+#define _chemistry_qc_cints_cartit_h
+
+#include <chemistry/qc/basis/cartiter.h>
+
+namespace sc {
+
+class CartesianIterCCA : public CartesianIter {
+  int *avec, *bvec, *cvec;
+
+  public:
+    CartesianIterCCA(int l) : CartesianIter(l) {}
+
+    void start() {
+      bfn_=b_=c_=0;
+      a_=l_;
+    }
+
+    void next() {
+      if (c_ < l_ - a_) {
+	b_--;
+	c_++;
+      }
+      else {
+	a_--;
+	c_ = 0;
+	b_ = l_ - a_;
+      }
+      bfn_++;
+    }
+    
+    operator int() {
+      return (a_ >= 0);
+    }
+};
+
+class RedundantCartesianIterCCA : public RedundantCartesianIter {
+  public:
+    RedundantCartesianIterCCA(int l) : RedundantCartesianIter(l) {}
+
+    int bfn() {
+      int i = a();
+      int am = l();
+      if (am == i)
+	return 0;
+      else {
+	int j = b();
+	int c = am - i;
+	return ((((c+1)*c)>>1)+c-j);
+      }
+    }
+};
+
+class RedundantCartesianSubIterCCA : public RedundantCartesianSubIter {
+  public:
+    RedundantCartesianSubIterCCA(int l) : RedundantCartesianSubIter(l) {}
+
+    int bfn() {
+      int i = a();
+      int am = l();
+      if (am == i)
+	return 0;
+      else {
+	int j = b();
+	int c = am - i;
+	return ((((c+1)*c)>>1)+c-j);
+      }
+    }
+};
+
+}
+
+#endif
+
+// Local Variables:
+// mode: c++
+// c-file-style: "CLJ"
+// End:
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int1e.cc
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int1e.cc	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int1e.cc	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,264 @@
+//
+// int1e.cc
+//
+// Copyright (C) 2004 Sandia National Laboratories.
+//
+// Author: Joseph Kenny <jpkenny@sandia.gov>
+// Maintainer: Joseph Kenny
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include <chemistry/qc/intcca/int1e.h>
+#include <util/class/scexception.h>
+#include <Chemistry_Chemistry_QC_GaussianBasis_DerivCenters.hh>
+
+using namespace std;
+using namespace sc;
+using namespace Chemistry;
+using namespace Chemistry::QC::GaussianBasis;
+
+Int1eCCA::Int1eCCA(Integral *integral,
+		   const Ref<GaussianBasisSet>&b1,
+		   const Ref<GaussianBasisSet>&b2,
+		   int order, IntegralEvaluatorFactory eval_factory, 
+                   std::string int_type, bool use_opaque):
+  bs1_(b1), bs2_(b2),
+  overlap_ptr_(0), kinetic_ptr_(0),
+  nuclear_ptr_(0), hcore_ptr_(0),
+  integral_(integral), eval_factory_(eval_factory), use_opaque_(use_opaque)
+{
+
+  int scratchsize=0,nshell2;
+  
+  /* The efield routines look like derivatives so bump up order if
+   * it is zero to allow efield integrals to be computed.
+   */
+  if (order == 0) order = 1;
+
+  nshell2 = bs1_->max_ncartesian_in_shell()*bs2_->max_ncartesian_in_shell();
+
+  if (order == 0) 
+    scratchsize = nshell2;
+  else if (order == 1) 
+    scratchsize = nshell2*3;
+  else
+    throw InputError("invalid derivative level",
+                     __FILE__,__LINE__);
+
+  if( !use_opaque_ )
+    buff_ = new double[scratchsize];
+
+  // create cca basis sets
+  cca_bs1_ = GaussianBasis_Molecular::_create();
+  cca_bs1_.initialize( bs1_.pointer(), bs1_->name() );
+  if( bs1_.pointer() != bs2_.pointer() ) {
+    cca_bs2_ = GaussianBasis_Molecular::_create();
+    cca_bs2_.initialize( bs2_.pointer(), bs2_->name() );
+  }
+  else
+    cca_bs2_ = cca_bs1_;
+
+  cca_dc_ = Chemistry_QC_GaussianBasis_DerivCenters::_create();
+
+  if( int_type == "overlap" ) {
+    overlap_ = eval_factory_.get_integral_evaluator2( "overlap", 0, 
+                                                      cca_bs1_, cca_bs2_ );
+    overlap_ptr_ = &overlap_;
+    if( use_opaque_ )
+      buff_ = static_cast<double*>( overlap_ptr_->get_buffer() );
+  }
+
+  else if( int_type == "overlap_1der" ) {
+    overlap_1der_ = eval_factory_.get_integral_evaluator2( "overlap", 1,
+                                                           cca_bs1_, cca_bs2_ );
+    overlap_1der_ptr_ = &overlap_1der_;
+    if( use_opaque_ )
+      buff_ = static_cast<double*>( overlap_1der_ptr_->get_buffer() );
+  }
+
+  else if( int_type == "kinetic" ) {
+    kinetic_ = eval_factory_.get_integral_evaluator2( "kinetic", 0,
+                                                      cca_bs1_, cca_bs2_ );
+    kinetic_ptr_ = &kinetic_;
+    if( use_opaque_ )
+      buff_ = static_cast<double*>( kinetic_ptr_->get_buffer() );
+  }
+
+  else if( int_type == "kinetic_1der" ) {
+    kinetic_1der_ = eval_factory_.get_integral_evaluator2( "kinetic", 1,
+                                                           cca_bs1_, cca_bs2_ );
+    kinetic_1der_ptr_ = &kinetic_1der_;
+    if( use_opaque_ )
+      buff_ = static_cast<double*>( kinetic_1der_ptr_->get_buffer() );
+  }
+
+  else if( int_type == "nuclear" ) {
+    nuclear_ = eval_factory_.get_integral_evaluator2( "potential", 0,
+                                                      cca_bs1_, cca_bs2_ );
+    nuclear_ptr_ = &nuclear_;
+    if( use_opaque_ )
+      buff_ = static_cast<double*>( nuclear_ptr_->get_buffer() );
+  }
+
+  else if( int_type == "nuclear_1der" ) {
+    nuclear_1der_ = eval_factory_.get_integral_evaluator2( "potential", 1,
+                                                           cca_bs1_, cca_bs2_ );
+    nuclear_1der_ptr_ = &nuclear_1der_;
+    if( use_opaque_ )
+      buff_ = static_cast<double*>( nuclear_1der_ptr_->get_buffer() );
+  }
+
+  else if( int_type == "hcore" ) {
+    hcore_ = eval_factory_.get_integral_evaluator2( "1eham", 0,
+                                                    cca_bs1_, cca_bs2_ );
+    hcore_ptr_ = &hcore_;
+    if( use_opaque_ )
+      buff_ = static_cast<double*>( hcore_ptr_->get_buffer() );
+  }
+
+  else if( int_type == "hcore_1der" ) {
+    hcore_1der_ = eval_factory_.get_integral_evaluator2( "1eham", 1,
+                                                         cca_bs1_, cca_bs2_ );
+    hcore_1der_ptr_ = &hcore_1der_;
+    if( use_opaque_ )
+      buff_ = static_cast<double*>( hcore_1der_ptr_->get_buffer() );
+  }
+
+}
+
+Int1eCCA::~Int1eCCA()
+{
+}
+
+void
+Int1eCCA::overlap( int ish, int jsh )
+{
+  cca_dc_.clear();
+  if( use_opaque_ )
+    overlap_ptr_->compute( ish, jsh, 0, cca_dc_ );
+  else {
+    sidl_buffer_ = overlap_ptr_->compute_array( ish, jsh, 0, cca_dc_ ); 
+    copy_buffer();
+  }
+}  
+
+void
+Int1eCCA::overlap_1der(int ish, int jsh,
+                       Chemistry_QC_GaussianBasis_DerivCenters &dc)
+{
+  if( use_opaque_ ) 
+    overlap_1der_ptr_->compute( ish, jsh, 1, dc );
+  else {
+    sidl_buffer_ = overlap_1der_ptr_->compute_array( ish, jsh, 1, dc );
+    copy_buffer();
+  }
+}
+
+void
+Int1eCCA::kinetic( int ish, int jsh )
+{
+  cca_dc_.clear();
+  if( use_opaque_ )
+    kinetic_ptr_->compute( ish, jsh, 0, cca_dc_ );
+  else {
+    sidl_buffer_ = kinetic_ptr_->compute_array( ish, jsh, 0, cca_dc_ ); 
+    copy_buffer();
+  }
+}
+
+void
+Int1eCCA::kinetic_1der(int ish, int jsh,
+                       Chemistry_QC_GaussianBasis_DerivCenters &dc)
+{
+  if( use_opaque_ )
+    kinetic_1der_ptr_->compute( ish, jsh, 1, dc );
+  else {
+    sidl_buffer_ = kinetic_1der_ptr_->compute_array( ish, jsh, 1, dc );
+    copy_buffer();
+  }
+}
+
+
+void
+Int1eCCA::nuclear( int ish, int jsh )
+{
+  cca_dc_.clear();
+  if( use_opaque_ )
+    nuclear_ptr_->compute( ish, jsh, 0, cca_dc_ );
+  else {
+    sidl_buffer_ = nuclear_ptr_->compute_array( ish, jsh, 0, cca_dc_ ); 
+    copy_buffer();
+  }
+}
+
+void
+Int1eCCA::nuclear_1der(int ish, int jsh,
+                       Chemistry_QC_GaussianBasis_DerivCenters &dc)
+{
+  if( use_opaque_ )
+    nuclear_1der_ptr_->compute( ish, jsh, 1, dc );
+  else {
+    sidl_buffer_ = nuclear_1der_ptr_->compute_array( ish, jsh, 1, dc );
+    copy_buffer();
+  }
+}
+
+void
+Int1eCCA::hcore( int ish, int jsh )
+{
+  cca_dc_.clear();
+  if( use_opaque_ )
+    hcore_ptr_->compute( ish, jsh, 0, cca_dc_ );
+  else {
+    sidl_buffer_ = hcore_ptr_->compute_array( ish, jsh, 0, cca_dc_ ); 
+    copy_buffer();
+  }
+}
+
+void
+Int1eCCA::hcore_1der(int ish, int jsh,
+                     Chemistry_QC_GaussianBasis_DerivCenters &dc)
+{
+  if( use_opaque_ )
+    hcore_1der_ptr_->compute( ish, jsh, 1, dc );
+  else {
+    sidl_buffer_ = hcore_1der_ptr_->compute_array( ish, jsh, 1, dc );
+    copy_buffer();
+  }
+}
+
+void 
+Int1eCCA::copy_buffer() 
+{
+  int sidl_size = 1 + sidl_buffer_.upper(0) - sidl_buffer_.lower(0);
+  for(int i=0; i<sidl_size; ++i) 
+    buff_[i] = sidl_buffer_.get(i);
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+// Local Variables:
+// mode: c++
+// End:
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int1e.h
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int1e.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int1e.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,116 @@
+//
+// int1e.h
+//
+// Copyright (C) 2004 Sandia National Laboratories.
+//
+// Author: Joseph Kenny <jpkenny@sandia.gov>
+// Maintainer: JPK
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#ifndef _chemistry_qc_intcca_int1e_h
+#define _chemistry_qc_intcca_int1e_h
+
+#include <sidl_cxx.hh>
+#include <Chemistry_QC_GaussianBasis_IntegralEvaluatorFactory.hh>
+#include <Chemistry_QC_GaussianBasis_IntegralEvaluator2.hh>
+#include <Chemistry_QC_GaussianBasis_Molecular.hh>
+#include <Chemistry_Chemistry_QC_GaussianBasis_DerivCenters.hh>
+#include <Chemistry_Chemistry_QC_GaussianBasis_DerivCenters.hh>
+#include <MPQC_GaussianBasis_Molecular.hh>
+#include <chemistry/qc/basis/integral.h>
+
+using namespace std;
+using namespace Chemistry;
+using namespace Chemistry::QC::GaussianBasis;
+using namespace MPQC;
+namespace sc {
+
+class Integral;
+
+/** Int1eCCA adapts CCA integrals components for use within SC.  It is
+    used by OneBodyIntCCA and OneBodyDerivIntCCA to implement the 
+    IntegralCCA class. */
+class Int1eCCA: public RefCount {
+
+  private:
+    IntegralEvaluatorFactory eval_factory_;
+    Ref<GaussianBasisSet> bs1_;
+    Ref<GaussianBasisSet> bs2_;
+    GaussianBasis_Molecular cca_bs1_;
+    GaussianBasis_Molecular cca_bs2_;
+    sidl::array<double> sidl_buffer_;
+    double *buff_;
+    bool use_opaque_;
+    void copy_buffer();
+    IntegralEvaluator2 overlap_;
+    IntegralEvaluator2 overlap_1der_;
+    IntegralEvaluator2 kinetic_;
+    IntegralEvaluator2 kinetic_1der_;
+    IntegralEvaluator2 nuclear_;
+    IntegralEvaluator2 nuclear_1der_;
+    IntegralEvaluator2 hcore_;
+    IntegralEvaluator2 hcore_1der_;
+    IntegralEvaluator2 *overlap_ptr_;
+    IntegralEvaluator2 *overlap_1der_ptr_;
+    IntegralEvaluator2 *kinetic_ptr_;
+    IntegralEvaluator2 *kinetic_1der_ptr_;
+    IntegralEvaluator2 *nuclear_ptr_;
+    IntegralEvaluator2 *nuclear_1der_ptr_;
+    IntegralEvaluator2 *hcore_ptr_;
+    IntegralEvaluator2 *hcore_1der_ptr_;
+    Chemistry_QC_GaussianBasis_DerivCenters cca_dc_;
+
+  protected:
+    Integral *integral_;
+
+  public:
+    Int1eCCA(Integral *integral,
+             const Ref<GaussianBasisSet>&b1,
+	     const Ref<GaussianBasisSet>&b2,
+	     int order, IntegralEvaluatorFactory, std::string, bool);
+    ~Int1eCCA();
+
+    double *buffer() { return buff_; }
+    void overlap(int ish, int jsh);
+    void overlap_1der(int ish, int jsh, 
+                      Chemistry_QC_GaussianBasis_DerivCenters &dc);
+    void kinetic(int ish, int jsh);
+    void kinetic_1der(int ish, int jsh, 
+                      Chemistry_QC_GaussianBasis_DerivCenters &dc);
+    void nuclear(int ish, int jsh);
+    void nuclear_1der(int ish, int jsh,
+                      Chemistry_QC_GaussianBasis_DerivCenters &dc);
+    void hcore(int ish, int jsh);
+    void hcore_1der(int ish, int jsh,
+                    Chemistry_QC_GaussianBasis_DerivCenters &dc);
+};
+
+}
+
+#endif
+
+// Local Variables:
+// mode: c++
+// End:
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int2e.cc
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int2e.cc	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int2e.cc	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,374 @@
+//
+// int2e.cc
+//
+// Copyright (C) 2004 Sandia National Laboratories.
+//
+// Author: Joseph Kenny <jpkenny@sandia.gov>
+// Maintainer: Joseph Kenny
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include <chemistry/qc/intcca/int2e.h>
+#include <Chemistry_Chemistry_QC_GaussianBasis_DerivCenters.hh>
+#include <util/class/scexception.h>
+
+using namespace std;
+using namespace sc;
+using namespace MPQC;
+using namespace Chemistry;
+using namespace Chemistry::QC::GaussianBasis;
+
+Int2eCCA::Int2eCCA(Integral *integral,
+		   const Ref<GaussianBasisSet>&b1,
+		   const Ref<GaussianBasisSet>&b2,
+		   const Ref<GaussianBasisSet>&b3,
+		   const Ref<GaussianBasisSet>&b4,
+		   int order, size_t storage,
+		   IntegralEvaluatorFactory eval_factory, 
+                   bool use_opaque, string eval_type ):
+  bs1_(b1), bs2_(b2), bs3_(b3), bs4_(b4),
+  erep_ptr_(0), integral_(integral), eval_factory_(eval_factory),
+  use_opaque_(use_opaque), buffer_(0)
+{
+
+  /* Allocate storage for the integral buffer. */
+  int maxsize = bs1_->max_ncartesian_in_shell()
+                *bs2_->max_ncartesian_in_shell()
+                *bs3_->max_ncartesian_in_shell()
+                *bs4_->max_ncartesian_in_shell();
+  if( order == 1 )
+    maxsize *= 9;
+  else if( order != 0 )
+    throw FeatureNotImplemented("only first order derivatives are available",
+                                __FILE__,__LINE__);
+  if( !use_opaque ) buffer_ = new double[maxsize];
+
+  cca_bs1_ = GaussianBasis_Molecular::_create();
+  cca_bs2_ = GaussianBasis_Molecular::_create();
+  cca_bs3_ = GaussianBasis_Molecular::_create();
+  cca_bs4_ = GaussianBasis_Molecular::_create();
+  cca_bs1_.initialize( bs1_.pointer(), bs1_->name() );
+  cca_bs2_.initialize( bs2_.pointer(), bs2_->name() );
+  cca_bs3_.initialize( bs3_.pointer(), bs3_->name() );
+  cca_bs4_.initialize( bs4_.pointer(), bs4_->name() );
+
+  cca_dc_ = Chemistry_QC_GaussianBasis_DerivCenters::_create();
+ 
+  if( eval_type == "eri" ) {
+    erep_ = eval_factory_.get_integral_evaluator4( "eri2", 0,
+                                                   cca_bs1_, cca_bs2_, 
+                                                   cca_bs3_, cca_bs4_ );
+    erep_ptr_ = &erep_;
+    if( use_opaque_ )
+      buffer_ = static_cast<double*>( erep_ptr_->get_buffer() );
+  }
+  else if( eval_type == "eri_1der") {
+    erep_1der_ = eval_factory_.get_integral_evaluator4( "eri2", 1,
+                                                        cca_bs1_, cca_bs2_,
+                                                        cca_bs3_, cca_bs4_ );
+    erep_1der_ptr_ = &erep_1der_;
+    if( use_opaque_ )
+      buffer_ = static_cast<double*>( erep_1der_ptr_->get_buffer() );
+  }
+  else {
+    std::cerr << "integral type: " << eval_type << std::endl;
+    throw InputError("unrecognized integral type",
+                     __FILE__,__LINE__);
+  }
+  if (!buffer_)
+    throw ProgrammingError("buffer not assigned",
+                           __FILE__,__LINE__);
+}
+
+void
+Int2eCCA::compute_erep( int is, int js, int ks, int ls )
+{
+  cca_dc_.clear();
+  if( use_opaque_ )
+    erep_ptr_->compute( is, js, ks, ls, 0, cca_dc_ );
+  else {   
+    sidl_buffer_ = erep_ptr_->compute_array( is, js, ks, ls, 0, cca_dc_ );
+    int nelem = bs1_->shell(is).nfunction() * bs2_->shell(js).nfunction() *
+                bs3_->shell(ks).nfunction() * bs4_->shell(ls).nfunction();
+    copy_buffer(nelem);
+  }
+
+  if(!redundant_) {
+    remove_redundant(is,js,ks,ls);
+  }
+}  
+
+void
+Int2eCCA::compute_erep_1der( int is, int js, int ks, int ls, 
+                             Chemistry::QC::GaussianBasis::DerivCenters &dc )
+{
+
+  if( use_opaque_ )
+    erep_1der_ptr_->compute( is, js, ks, ls, 1, dc );
+  else {
+    sidl_buffer_ = erep_ptr_->compute_array( is, js, ks, ls, 1, dc );
+    int nelem = bs1_->shell(is).nfunction() * bs2_->shell(js).nfunction() *
+                bs3_->shell(ks).nfunction() * bs4_->shell(ls).nfunction();
+    copy_buffer(nelem);
+  }
+
+  if(!redundant_) {
+    remove_redundant(is,js,ks,ls);
+  }
+}
+
+void 
+Int2eCCA::copy_buffer( int n ) 
+{
+  for( int i=0; i<n; ++i)
+     buffer_[i] = sidl_buffer_.get(i);
+}
+
+#ifndef INTV3_ORDER
+
+/////////////////////////////////////////////////////////////////////////////
+// Code for removing redundant integrals
+// copied liberally from cints
+
+void get_nonredundant_ints_(double *source, double *target, 
+                            int e13e24, int e12, int e34,
+                            GaussianShell* int_shell1,GaussianShell* int_shell2,
+                            GaussianShell* int_shell3,GaussianShell* int_shell4)
+{
+
+  //std::cout << "\nremoving redundant integrals";
+
+  int i,j,k,l;
+
+  int nbf1 = int_shell1->nfunction();
+  int nbf2 = int_shell2->nfunction();
+  int nbf3 = int_shell3->nfunction();
+  int nbf4 = int_shell4->nfunction();
+
+  double *redundant_ptr = source;
+  double *nonredundant_ptr = target;
+
+  int nbf34 = nbf3*nbf4;
+  for (i=0; i<nbf1; i++) {
+    int jmax = e12 ? i : nbf2-1;
+    for (j=0; j<=jmax; j++) {
+      int kmax = e13e24 ? i : nbf3-1;
+      for (k=0; k<=kmax; k++) {
+        int lmax = e34 ? ( (e13e24&&(i==k)) ? j : k) : 
+                         ( (e13e24&&(i==k)) ? j : nbf4-1);
+        for (l=0; l<=lmax; l++) {
+          *(nonredundant_ptr++) = redundant_ptr[l];
+        }
+        redundant_ptr += nbf4;
+      }
+      redundant_ptr += (nbf3-(kmax+1))*nbf4;
+    }
+    redundant_ptr += (nbf2-(jmax+1))*nbf34;
+  }
+}
+
+void
+Int2eCCA::remove_redundant(int sh1, int sh2, int sh3, int sh4) {
+
+  GaussianShell* int_shell1(&bs1_->shell(sh1));
+  GaussianShell* int_shell2(&bs2_->shell(sh2));
+  GaussianShell* int_shell3(&bs3_->shell(sh3));
+  GaussianShell* int_shell4(&bs4_->shell(sh4));
+
+  bool need_unique_ints_only = false;
+  int e12,e34,e13e24;
+  e12 = 0;
+  if (int_shell1 == int_shell2 && int_shell1->nfunction()>1)
+    e12 = 1;
+  e34 = 0;
+  if (int_shell3 == int_shell4 && int_shell3->nfunction()>1)
+    e34 = 1;
+  e13e24 = 0;
+  if (int_shell1 == int_shell3 && int_shell2 ==
+      int_shell4 && int_shell1->nfunction()*int_shell2->nfunction()>1)
+    e13e24 = 1;
+
+  if ( e12 || e34 || e13e24 )
+    need_unique_ints_only = true;
+
+  if (need_unique_ints_only) {
+    std::cout.flush();
+    get_nonredundant_ints_( buffer_, buffer_, e13e24, e12, e34,
+                            int_shell1, int_shell2, int_shell3, int_shell4 );
+  }
+}
+
+#else
+
+/////////////////////////////////////////////////////////////////////////////
+// Code for removing redundant integrals
+// copied liberally from intV3 
+
+static int
+shell_offset(Ref<GaussianBasisSet> cs, int off)
+{
+  return off + cs->nshell();
+}
+
+#define INT_MAX1(n1) ((n1)-1)
+#define INT_MAX2(e12,i,n2) ((e12)?(i):((n2)-1))
+#define INT_MAX3(e13e24,i,n3) ((e13e24)?(i):((n3)-1))
+#define INT_MAX4(e13e24,e34,i,j,k,n4) \
+  ((e34)?(((e13e24)&&((k)==(i)))?(j):(k)) \
+        :((e13e24)&&((k)==(i)))?(j):(n4)-1)
+
+void
+nonredundant_erep(double *buffer, int e12, int e34, int e13e24,
+		  int n1, int n2, int n3, int n4,
+		  int *red_off, int *nonred_off)
+{
+  int nonredundant_index;
+  int i,j,k,l;
+  
+  double *redundant_ptr = &buffer[*red_off];
+  double *nonredundant_ptr = &buffer[*nonred_off];
+  
+  nonredundant_index = 0;
+  int n34 = n3*n4;
+  for (i=0; i<n1; i++) {
+    int jmax = INT_MAX2(e12,i,n2);
+    for (j=0; j<=jmax; j++) {
+      int kmax = INT_MAX3(e13e24,i,n3);
+      for (k=0; k<=kmax; k++) {
+        int lmax = INT_MAX4(e13e24,e34,i,j,k,n4);
+        for (l=0; l<=lmax; l++) {
+          nonredundant_ptr[l] = redundant_ptr[l];
+	}
+        redundant_ptr += n4;
+        nonredundant_index += lmax+1;
+        nonredundant_ptr += lmax+1;
+      }
+      redundant_ptr += (n3-(kmax+1))*n4;
+    }
+    redundant_ptr += (n2-(jmax+1))*n34;
+  }
+  *red_off += n1*n2*n34;
+  *nonred_off += nonredundant_index;
+}
+
+void
+Int2eCCA::remove_redundant(int is, int js, int ks, int ls) {
+
+  int bs1_shell_offset = 0;
+  int bs2_shell_offset, bs3_shell_offset, bs4_shell_offset;
+  
+  int shell_offset1 = shell_offset(bs1_,0);
+  int shell_offset2, shell_offset3, shell_offset4;
+  if (bs2_ == bs1_) {
+    shell_offset2 = shell_offset1;
+    bs2_shell_offset = bs1_shell_offset;
+  }
+  else {
+    shell_offset2 = shell_offset(bs2_,shell_offset1);
+    bs2_shell_offset = shell_offset1;
+  }
+  
+  if (bs3_ == bs1_) {
+    shell_offset3 = shell_offset2;
+    bs3_shell_offset = bs1_shell_offset;
+  }
+  else if (bs3_ == bs2_) {
+    shell_offset3 = shell_offset2;
+    bs3_shell_offset = bs2_shell_offset;
+  }
+  else {
+    shell_offset3 = shell_offset(bs3_,shell_offset2);
+    bs3_shell_offset = shell_offset2;
+  }
+  
+  if (bs4_ == bs1_) {
+    bs4_shell_offset = bs1_shell_offset;
+  }
+  else if (bs4_ == bs2_) {
+    bs4_shell_offset = bs2_shell_offset;
+  }
+  else if (bs4_ == bs3_) {
+    bs4_shell_offset = bs3_shell_offset;
+  }
+  else {
+    bs4_shell_offset = shell_offset3;
+  }
+  
+  int int_unit2 = 0;
+  int int_unit4 = 0;
+  int osh1 = is + bs1_shell_offset;
+  int osh2;
+  if (!int_unit2) osh2 = js + bs2_shell_offset;
+  int osh3 = ks + bs3_shell_offset;
+  int osh4;
+  if (!int_unit4) osh4 = ls + bs4_shell_offset;
+  
+  int sh1 = is;
+  int sh2;
+  if (!int_unit2) sh2 = js;
+  int sh3 = ks;
+  int sh4;
+  if (!int_unit4) sh4 = ls;
+  
+  GaussianShell* int_unit_shell = 0;
+  GaussianShell* int_shell1 = &bs1_->shell(sh1);
+  GaussianShell* int_shell2;
+  if (!int_unit2) int_shell2 = &bs2_->shell(sh2);
+  else int_shell2 = int_unit_shell;
+  GaussianShell* int_shell3 = &bs3_->shell(sh3);
+  GaussianShell* int_shell4;
+  if (!int_unit4) int_shell4 = &bs4_->shell(sh4);
+  else int_shell4 = int_unit_shell;
+  
+  int redundant_offset = 0;
+  int nonredundant_offset = 0;
+
+  if ((osh1 == osh4)&&(osh2 == osh3)&&(osh1 != osh2)) {
+    throw ProgrammingError("nonredundant integrals cannot be generated",
+                           __FILE__,__LINE__);
+  }
+
+  int e12 = (int_unit2?0:(osh1 == osh2));
+  int e13e24 = ((osh1 == osh3)
+		&& ((int_unit2 && int_unit4)
+		    || ((int_unit2||int_unit4)?0:(osh2 == osh4))));
+  int e34 = (int_unit4?0:(osh3 == osh4));
+  if (e12||e34||e13e24) {
+    nonredundant_erep(buffer_,e12,e34,e13e24,
+		      int_shell1->nfunction(),
+		      int_shell2->nfunction(),
+		      int_shell3->nfunction(),
+		      int_shell4->nfunction(),
+		      &redundant_offset,
+		      &nonredundant_offset);
+  }
+}
+
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+
+// Local Variables:
+// mode: c++
+// End:
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int2e.h
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int2e.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/int2e.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,106 @@
+//
+// int1e.h
+//
+// Copyright (C) 2004 Sandia National Laboratories.
+//
+// Author: Joseph Kenny <jpkenny@sandia.gov>
+// Maintainer: JPK
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#ifndef _chemistry_qc_intcca_int2e_h
+#define _chemistry_qc_intcca_int2e_h
+
+#include <sidl_cxx.hh>
+#include <Chemistry_QC_GaussianBasis_IntegralEvaluatorFactory.hh>
+#include <Chemistry_QC_GaussianBasis_IntegralEvaluator4.hh>
+#include <Chemistry_QC_GaussianBasis_DerivCenters.hh>
+#include <Chemistry_Chemistry_QC_GaussianBasis_DerivCenters.hh>
+#include <MPQC_GaussianBasis_Molecular.hh>
+#include <chemistry/qc/basis/integral.h>
+
+using namespace std;
+using namespace MPQC;
+using namespace Chemistry;
+using namespace Chemistry::QC::GaussianBasis;
+
+namespace sc {
+
+class Integral;
+
+/** Int2eCCA adapts CCA integrals components for use within SC.  It is
+    used by TwoBodyIntCCA and TwoBodyDerivIntCCA to implement the 
+    IntegralCCA class. */
+class Int2eCCA: public RefCount {
+
+  private:
+    IntegralEvaluatorFactory eval_factory_;
+    Ref<GaussianBasisSet> bs1_;
+    Ref<GaussianBasisSet> bs2_;
+    Ref<GaussianBasisSet> bs3_;
+    Ref<GaussianBasisSet> bs4_;
+    GaussianBasis_Molecular cca_bs1_;
+    GaussianBasis_Molecular cca_bs2_;
+    GaussianBasis_Molecular cca_bs3_;
+    GaussianBasis_Molecular cca_bs4_;
+    sidl::array<double> sidl_buffer_;
+    double *buffer_;
+    bool use_opaque_;
+    void copy_buffer(int);
+    IntegralEvaluator4 erep_;
+    IntegralEvaluator4 erep_1der_;
+    IntegralEvaluator4 *erep_ptr_;
+    IntegralEvaluator4 *erep_1der_ptr_;
+    Chemistry_QC_GaussianBasis_DerivCenters cca_dc_;
+    int redundant_;
+    void remove_redundant(int,int,int,int);
+
+  protected:
+    Integral *integral_;
+
+  public:
+    Int2eCCA(Integral *integral,
+             const Ref<GaussianBasisSet>&b1,
+             const Ref<GaussianBasisSet>&b2,
+             const Ref<GaussianBasisSet>&b3,
+             const Ref<GaussianBasisSet>&b4,
+             int order, size_t storage, IntegralEvaluatorFactory, 
+             bool, string );
+    ~Int2eCCA() {};
+    double *buffer() { return buffer_; }
+    void compute_erep( int is, int js, int ks, int ls );
+    void compute_erep_1der( int is, int js, int ks, int ls,
+                            Chemistry::QC::GaussianBasis::DerivCenters &dc);
+    int redundant() const { return redundant_; }
+    void set_redundant(int i) { redundant_ = i; }
+
+};
+
+}
+
+#endif
+
+// Local Variables:
+// mode: c++
+// End:
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/intcca.cc
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/intcca.cc	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/intcca.cc	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,481 @@
+//
+// intcca.cc
+//
+// Copyright (C) 2004 Sandia National Laboratories
+//
+// Author: Joe Kenny <jpkenny@sandia.gov>
+// Maintainer: Joe Kenny
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#include <util/state/stateio.h>
+#include <util/misc/ccaenv.h>
+#include <chemistry/qc/basis/integral.h>
+#include <chemistry/qc/intcca/intcca.h>
+#include <chemistry/qc/intcca/obintcca.h>
+#include <chemistry/qc/intcca/tbintcca.h>
+#include <util/class/scexception.h>
+#ifdef INTV3_ORDER
+  #include <chemistry/qc/intv3/cartitv3.h>
+  #include <chemistry/qc/intv3/tformv3.h>
+#else
+  #include <chemistry/qc/intcca/cartit.h>
+  #include <chemistry/qc/intcca/tform.h>
+#endif
+
+using namespace std;
+using namespace sc;
+using namespace Chemistry::QC::GaussianBasis;
+
+static ClassDesc IntegralCCA_cd(
+  typeid(IntegralCCA),"IntegralCCA",1,"public Integral",
+  0, create<IntegralCCA>, create<IntegralCCA>);
+
+extern Ref<Integral> default_integral;
+
+/* may need to add optional "eval_factory" argument to this method in
+integral class to get this capability
+Integral*
+Integral::get_default_integral()
+{
+  if (default_integral.null())
+    default_integral = new IntegralCCA();
+
+  return default_integral;
+}
+*/
+
+IntegralCCA::IntegralCCA(IntegralEvaluatorFactory eval_factory, bool use_opaque,
+                         const Ref<GaussianBasisSet> &b1,
+                         const Ref<GaussianBasisSet> &b2,
+                         const Ref<GaussianBasisSet> &b3,
+                         const Ref<GaussianBasisSet> &b4):
+  Integral(b1,b2,b3,b4), eval_factory_(eval_factory)
+{
+  use_opaque_ = use_opaque;
+  initialize_transforms();
+}
+
+IntegralCCA::IntegralCCA(const Ref<KeyVal> &keyval):
+  Integral(keyval)
+{
+
+  initialize_transforms();
+
+  string buffer = keyval->stringvalue("integral_buffer");
+  if ( keyval->error() != KeyVal::OK ) buffer = "opaque";
+  if ( buffer == "opaque" ) use_opaque_ = 1;
+  else if ( buffer == "array" ) use_opaque_ = 0;
+  else {
+    InputError ex("integral_buffer must be either opaque or array",__FILE__, __LINE__,
+                  "integral_buffer",buffer.c_str(),class_desc());
+    throw ex;
+  }
+
+  factory_type_ = keyval->stringvalue("evaluator_factory");
+  if ( keyval->error() != KeyVal::OK ) {
+    factory_type_ = string("MPQC.IntegralEvaluatorFactory");
+  }
+  package_ = keyval->stringvalue("integral_package");
+  if ( keyval->error() != KeyVal::OK ) {
+    package_ = string("intv3");
+  }
+#ifdef INTV3_ORDER
+  if(package_ == "cints") {
+    InputError ex("using intv3 ordering, can't use cints",__FILE__, __LINE__);
+    try { ex.elaborate() << "INTV3_ORDER=yes in LocalMakefile,"
+                         << " this option is for development use only";
+    }
+    catch (...) {}
+    throw ex;
+  }
+#endif
+
+  sc_molecule_ << keyval->describedclassvalue("molecule");
+  if (sc_molecule_.null())
+    throw InputError("molecule is required",__FILE__,__LINE__);
+
+  gov::cca::Services &services = *CCAEnv::get_services();
+  gov::cca::ports::BuilderService &bs = *CCAEnv::get_builder_service();
+  gov::cca::TypeMap &type_map = *CCAEnv::get_type_map();
+  gov::cca::ComponentID &my_id = *CCAEnv::get_component_id();
+
+  // get eval factory
+  fac_id_ = bs.createInstance("evaluator_factory",factory_type_,type_map);
+  services.registerUsesPort("IntegralEvaluatorFactory",
+                            "Chemistry.QC.GaussianBasis.IntegralEvaluatorFactory",
+                            type_map);
+  fac_con_ = bs.connect(my_id,"IntegralEvaluatorFactory",
+                        fac_id_,"IntegralEvaluatorFactory");
+  eval_factory_ = services.getPort("IntegralEvaluatorFactory");
+
+  // set molecule on factory
+  molecule_ = Chemistry::Chemistry_Molecule::_create();
+  molecule_.initialize(sc_molecule_->natom(),"bohr");
+  for( int i=0; i<sc_molecule_->natom(); ++i ) {
+    molecule_.set_atomic_number( i, sc_molecule_->Z(i) );
+    for( int j=0; j<3; ++j )
+      molecule_.set_cart_coor( i, j, sc_molecule_->r(i,j) );
+  }
+  eval_factory_.set_molecule(molecule_);
+
+  // set package
+  eval_factory_.set_integral_package(package_);
+
+}
+
+IntegralCCA::IntegralCCA(StateIn& s) :
+  Integral(s)
+{
+  initialize_transforms();
+}
+
+void
+IntegralCCA::save_data_state(StateOut& s)
+{
+  Integral::save_data_state(s);
+}
+
+IntegralCCA::~IntegralCCA()
+{
+  free_transforms();
+}
+
+Integral*
+IntegralCCA::clone()
+{
+  // ???
+  return new IntegralCCA(eval_factory_,use_opaque_);
+  // this wouldn't take much work
+  //throw FeatureNotImplemented("clone not implemented",
+  //                            __FILE__,__LINE__);
+}
+
+CartesianIter *
+IntegralCCA::new_cartesian_iter(int l)
+{
+#ifdef INTV3_ORDER
+  return new CartesianIterV3(l);
+#else
+  return new CartesianIterCCA(l);
+#endif
+}
+
+RedundantCartesianIter *
+IntegralCCA::new_redundant_cartesian_iter(int l)
+{
+#ifdef INTV3_ORDER
+  return new RedundantCartesianIterV3(l);
+#else
+  return new RedundantCartesianIterCCA(l);
+#endif
+}
+
+RedundantCartesianSubIter *
+IntegralCCA::new_redundant_cartesian_sub_iter(int l)
+{
+#ifdef INTV3_ORDER
+  return new RedundantCartesianSubIterV3(l);
+#else
+  return new RedundantCartesianSubIterCCA(l);
+#endif
+}
+
+SphericalTransformIter *
+IntegralCCA::new_spherical_transform_iter(int l, int inv, int subl)
+{
+#ifdef INTV3_ORDER
+
+  if (l>maxl_ || l<0)
+      throw ProgrammingError("new_spherical_transform_iter: bad l",
+                             __FILE__,__LINE__);
+  if (subl == -1) subl = l;
+  if (subl < 0 || subl > l || (l-subl)%2 != 0)
+      throw ProgrammingError("new_spherical_transform_iter: bad subl",
+                             __FILE__,__LINE__);
+  if (inv)
+      return new SphericalTransformIter(ist_[l][(l-subl)/2]);
+  return new SphericalTransformIter(st_[l][(l-subl)/2]);
+
+#else
+ 
+  // CINTS version
+  if (l>maxl_ || l<0)
+      throw ProgrammingError("new_spherical_transform_iter: bad l",
+                             __FILE__,__LINE__);
+  if (subl == -1) subl = l;
+  if (subl < 0 || subl > l || (l-subl)%2 != 0)
+      throw ProgrammingError("new_spherical_transform_iter: bad subl",
+                             __FILE__,__LINE__);
+  if (inv)
+      return new SphericalTransformIter(ist_[l][(l-subl)/2]);
+  return new SphericalTransformIter(st_[l][(l-subl)/2]);
+
+#endif
+
+}
+
+const SphericalTransform *
+IntegralCCA::spherical_transform(int l, int inv, int subl)
+{
+#ifdef INTV3_ORDER
+
+  // INTV3 version
+  if (l>maxl_ || l<0)
+      throw ProgrammingError("spherical_transform_iter: bad l",
+                             __FILE__,__LINE__);
+  if (subl == -1) subl = l;
+  if (subl < 0 || subl > l || (l-subl)%2 != 0)
+      throw ProgrammingError("spherical_transform_iter: bad subl",
+                             __FILE__,__LINE__);
+  if (inv)
+      return ist_[l][(l-subl)/2];
+  return st_[l][(l-subl)/2];
+
+#else
+
+  // CINTS version
+  if (l>maxl_ || l<0)
+      throw ProgrammingError("spherical_transform_iter: bad l",
+                             __FILE__,__LINE__);
+  if (subl == -1) subl = l;
+  if (subl < 0 || subl > l || (l-subl)%2 != 0)
+      throw ProgrammingError("spherical_transform_iter: bad subl",
+                             __FILE__,__LINE__);
+  if (inv)
+      return ist_[l][(l-subl)/2];
+  return st_[l][(l-subl)/2];
+
+#endif
+
+}
+
+Ref<OneBodyInt>
+IntegralCCA::overlap()
+{
+  return new OneBodyIntCCA(this, bs1_, bs2_, eval_factory_, &Int1eCCA::overlap, 
+                           use_opaque_ );
+}
+
+Ref<OneBodyInt>
+IntegralCCA::kinetic()
+{
+  return new OneBodyIntCCA(this, bs1_, bs2_, eval_factory_, &Int1eCCA::kinetic, 
+                           use_opaque_ );
+}
+
+Ref<OneBodyInt>
+IntegralCCA::nuclear()
+{
+  return new OneBodyIntCCA(this, bs1_, bs2_, eval_factory_, &Int1eCCA::nuclear, 
+                           use_opaque_ );
+}
+
+Ref<OneBodyInt>
+IntegralCCA::hcore()
+{
+  return new OneBodyIntCCA(this, bs1_, bs2_, eval_factory_, &Int1eCCA::hcore, 
+                           use_opaque_ );
+}
+
+Ref<OneBodyInt>
+IntegralCCA::point_charge(const Ref<PointChargeData>& dat)
+{
+  throw FeatureNotImplemented("point_charge not implemented",
+                              __FILE__,__LINE__);
+}
+
+Ref<OneBodyInt>
+IntegralCCA::efield_dot_vector(const Ref<EfieldDotVectorData>&dat)
+{
+  throw FeatureNotImplemented("efield_dot_vector not iplemented",
+                              __FILE__,__LINE__);
+}
+
+Ref<OneBodyInt>
+IntegralCCA::dipole(const Ref<DipoleData>& dat)
+{
+  throw FeatureNotImplemented("dipole not implemented",
+                              __FILE__,__LINE__);
+}
+
+Ref<OneBodyInt>
+IntegralCCA::quadrupole(const Ref<DipoleData>& dat)
+{
+  throw FeatureNotImplemented("quadrupole not implemented",
+                              __FILE__,__LINE__);
+}
+
+Ref<OneBodyDerivInt>
+IntegralCCA::overlap_deriv()
+{
+   return new OneBodyDerivIntCCA(this, bs1_, bs2_, eval_factory_, use_opaque_, 
+                                 "overlap_1der");
+}
+
+Ref<OneBodyDerivInt>
+IntegralCCA::kinetic_deriv()
+{
+   return new OneBodyDerivIntCCA(this, bs1_, bs2_, eval_factory_, use_opaque_, 
+                                 "kinetic_1der");
+}
+
+Ref<OneBodyDerivInt>
+IntegralCCA::nuclear_deriv()
+{
+   return new OneBodyDerivIntCCA(this, bs1_, bs2_, eval_factory_, use_opaque_, 
+                                 "nuclear_1der");
+}
+
+Ref<OneBodyDerivInt>
+IntegralCCA::hcore_deriv()
+{
+   return new OneBodyDerivIntCCA(this, bs1_, bs2_, eval_factory_, use_opaque_,
+                                 "hcore_1der");
+}
+
+Ref<TwoBodyInt>
+IntegralCCA::electron_repulsion()
+{
+  return new TwoBodyIntCCA(this, bs1_, bs2_, bs3_, bs4_, 
+                           storage_, eval_factory_, use_opaque_, "eri" );
+}
+
+Ref<TwoBodyDerivInt>
+IntegralCCA::electron_repulsion_deriv()
+{
+   return new TwoBodyDerivIntCCA(this, bs1_, bs2_, bs3_, bs4_, 
+                                 storage_, eval_factory_, use_opaque_, "eri_1der" );
+}
+
+void
+IntegralCCA::set_basis(const Ref<GaussianBasisSet> &b1,
+                       const Ref<GaussianBasisSet> &b2,
+                       const Ref<GaussianBasisSet> &b3,
+                       const Ref<GaussianBasisSet> &b4)
+{
+  free_transforms();
+  Integral::set_basis(b1,b2,b3,b4);
+  initialize_transforms();
+}
+
+void
+IntegralCCA::free_transforms()
+{
+#ifdef INTV3_ORDER
+
+  // INTV3 version
+  int i,j;
+  for (i=0; i<=maxl_; i++) {
+      for (j=0; j<=i/2; j++) {
+          delete st_[i][j];
+          delete ist_[i][j];
+        }
+      delete[] st_[i];
+      delete[] ist_[i];
+    }
+  delete[] st_;
+  delete[] ist_;
+  st_ = 0;
+  ist_ = 0;
+
+#else
+
+  // CINTS version
+  int i,j;
+  for (i=0; i<=maxl_; i++) {
+      for (j=0; j<=i/2; j++) {
+          delete st_[i][j];
+          delete ist_[i][j];
+        }
+      delete[] st_[i];
+      delete[] ist_[i];
+    }
+  if (maxl_ >= 0) {
+    delete[] st_;
+    delete[] ist_;
+  }
+  st_ = NULL;
+  ist_ = NULL;
+
+#endif
+
+}
+
+ void
+ IntegralCCA::initialize_transforms()
+ {
+   maxl_ = -1;
+   int maxam;
+   maxam = bs1_.nonnull()?bs1_->max_angular_momentum():-1;
+   if (maxl_ < maxam) maxl_ = maxam;
+   maxam = bs2_.nonnull()?bs2_->max_angular_momentum():-1;
+   if (maxl_ < maxam) maxl_ = maxam;
+   maxam = bs3_.nonnull()?bs3_->max_angular_momentum():-1;
+   if (maxl_ < maxam) maxl_ = maxam;
+   maxam = bs4_.nonnull()?bs4_->max_angular_momentum():-1;
+   if (maxl_ < maxam) maxl_ = maxam;
+ 
+#ifdef INTV3_ORDER
+
+   // INTV3 version
+   st_ = new SphericalTransform**[maxl_+1];
+   ist_ = new ISphericalTransform**[maxl_+1];
+   int i,j;
+   for (i=0; i<=maxl_; i++) {
+       st_[i] = new SphericalTransform*[i/2+1];
+       ist_[i] = new ISphericalTransform*[i/2+1];
+       for (j=0; j<=i/2; j++) {
+           st_[i][j] = new SphericalTransformV3(i,i-2*j);
+           ist_[i][j] = new ISphericalTransformV3(i,i-2*j);
+         }
+     }
+
+#else
+
+  // CINTS version
+  if (maxl_ >= 0) {
+    st_ = new SphericalTransform**[maxl_+1];
+    ist_ = new ISphericalTransform**[maxl_+1];
+    int i,j;
+    for (i=0; i<=maxl_; i++) {
+      st_[i] = new SphericalTransform*[i/2+1];
+      ist_[i] = new ISphericalTransform*[i/2+1];
+      for (j=0; j<=i/2; j++) {
+        st_[i][j] = new SphericalTransformCCA(i,i-2*j);
+        ist_[i][j] = new ISphericalTransformCCA(i,i-2*j);
+      }
+    }
+  }
+  else {
+    st_ = NULL;
+    ist_ = NULL;
+  }
+
+#endif
+
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+// Local Variables:
+// mode: c++
+// c-file-style: "CLJ"
+// End:
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/intcca.h
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/intcca.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/intcca.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,150 @@
+//
+// intcca.h
+//
+// Copyright (C) 2004 Sandia National Laboratories
+//
+// Author: Joe Kenny <jpkenny@sandia.gov>
+// Maintainer: Joe Kenny
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifndef _chemistry_qc_intcca_intcca_h
+#define _chemistry_qc_intcca_intcca_h
+
+#include <gov_cca.hh>
+#include <chemistry/qc/basis/integral.h>
+#include <Chemistry_QC_GaussianBasis_IntegralEvaluatorFactory.hh>
+#include <Chemistry_Chemistry_Molecule.hh>
+#include <chemistry/molecule/molecule.h>
+#include <chemistry/qc/basis/transform.h>
+#include <chemistry/qc/basis/cartiter.h>
+
+using namespace Chemistry::QC::GaussianBasis;
+
+namespace sc {
+
+/** IntegralCCA provides an SC client for CCA IntegralEvaluator components. */
+class IntegralCCA : public Integral {
+  private:
+    int maxl_;
+    bool use_opaque_;
+    gov::cca::ComponentID fac_id_;
+    gov::cca::ConnectionID fac_con_;
+    Ref<Molecule> sc_molecule_;
+    Chemistry::Chemistry_Molecule molecule_;
+    std::string factory_type_;
+    std::string package_;
+
+    SphericalTransform ***st_;
+    ISphericalTransform ***ist_;
+
+    void free_transforms();
+    void initialize_transforms();
+    IntegralEvaluatorFactory eval_factory_;
+
+  public:
+
+    /** This constructor is used when the framework is not embedded. */
+    IntegralCCA(IntegralEvaluatorFactory eval_factory, bool use_opaque,
+                const Ref<GaussianBasisSet> &b1=0,
+                const Ref<GaussianBasisSet> &b2=0,
+                const Ref<GaussianBasisSet> &b3=0,
+                const Ref<GaussianBasisSet> &b4=0);
+
+    IntegralCCA(StateIn&);
+
+    /** The KeyVal constructor.
+        This constructor is used when the framework is embedded.
+        The following keywords are read:
+
+        <dl>
+        <dt><tt>evaluator_factory</tt><dd> This gives the symbol name of a 
+        CCA IntegralEvaluatorFactory component.  This symbol name should
+        also appear in the cca-load argument.  The default is
+        <tt>MPQC.IntegralEvaluatorFactory</tt>.
+
+        <dt><tt>integral_package</tt><dd> If the default 
+        <tt>MPQC.IntegralEvaluatorFactory</tt> is used, then this 
+        option may be used to specify the integrals package to use
+        (<tt>intv3</tt> or <tt>cints</tt>).  The default is <tt>intv3</tt>.
+
+        <dt><tt>molecule</tt><dd> This gives a molecule object, it is required.
+        </dl>
+    */
+
+    IntegralCCA(const Ref<KeyVal>&);
+
+    ~IntegralCCA();
+
+    void save_data_state(StateOut&);
+
+    Integral* clone();
+   
+    CartesianIter * new_cartesian_iter(int);
+    RedundantCartesianIter * new_redundant_cartesian_iter(int);
+    RedundantCartesianSubIter * new_redundant_cartesian_sub_iter(int);
+    SphericalTransformIter * new_spherical_transform_iter(int l,
+                                                          int inv=0,
+                                                          int subl=-1);
+    const SphericalTransform * spherical_transform(int l,
+                                                   int inv=0, int subl=-1);
+
+    Ref<OneBodyInt> overlap();
+
+    Ref<OneBodyInt> kinetic();
+
+    Ref<OneBodyInt> point_charge(const Ref<PointChargeData>& =0);
+
+    Ref<OneBodyInt> nuclear();
+
+    Ref<OneBodyInt> hcore();
+
+    Ref<OneBodyInt> efield_dot_vector(const Ref<EfieldDotVectorData>& =0);
+
+    Ref<OneBodyInt> dipole(const Ref<DipoleData>& =0);
+
+    Ref<OneBodyInt> quadrupole(const Ref<DipoleData>& =0);
+
+    Ref<OneBodyDerivInt> overlap_deriv();
+                                     
+    Ref<OneBodyDerivInt> kinetic_deriv();
+                                     
+    Ref<OneBodyDerivInt> nuclear_deriv();
+                                     
+    Ref<OneBodyDerivInt> hcore_deriv();
+                                     
+    Ref<TwoBodyInt> electron_repulsion();
+
+    Ref<TwoBodyDerivInt> electron_repulsion_deriv();
+
+    void set_basis(const Ref<GaussianBasisSet> &b1,
+                   const Ref<GaussianBasisSet> &b2 = 0,
+                   const Ref<GaussianBasisSet> &b3 = 0,
+                   const Ref<GaussianBasisSet> &b4 = 0);
+};
+
+}
+
+#endif
+
+// Local Variables:
+// mode: c++
+// c-file-style: "CLJ"
+// End:
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/linkage.h
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/linkage.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/linkage.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,40 @@
+//
+// linkage.h
+//
+// Copyright (C) 2001 Edward Valeev
+//
+// Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
+// Maintainer: EV
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifndef _chemistry_qc_intcca_linkage_h
+#define _chemistry_qc_intcca_linkage_h
+
+#include <util/class/class.h>
+#include <chemistry/qc/intcca/intcca.h>
+
+namespace sc {
+
+static ForceLink<IntegralCCA> cca_force_link_a_;
+
+}
+
+#endif
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/macros.h
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/macros.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/macros.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,189 @@
+//
+// macros.h
+//
+// Copyright (C) 2001 Edward Valeev
+//
+// Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
+// Maintainer: EV
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+/* True if the integral is nonzero. */
+#define INT_NONZERO(x) (((x)< -1.0e-15)||((x)> 1.0e-15))
+
+/* Computes an index to a Cartesian function within a shell given
+ * am = total angular momentum
+ * i = the exponent of x (i is used twice in the macro--beware side effects)
+ * j = the exponent of y
+ * formula: (am - i + 1)*(am - i)/2 + am - i - j unless i==am, then 0
+ * The following loop will generate indices in the proper order:
+ *  cartindex = 0;
+ *  for (i=am; i>=0; i--) {
+ *    for (j=am-i; j>=0; j--) {
+ *      do_it_with(cartindex);
+ *      cartindex++;
+ *      }
+ *    }
+ */
+#define INT_CARTINDEX(am,i,j) (((i) == (am))? 0 : (((((am) - (i) + 1)*((am) - (i)))>>1) + (am) - (i) - (j)))
+
+/* This sets up the above loop over cartesian exponents as follows
+ * FOR_CART(i,j,k,am)
+ *   Stuff using i,j,k.
+ *   END_FOR_CART
+ */
+#define FOR_CART(i,j,k,am) for((i)=(am);(i)>=0;(i)--) {\
+                           for((j)=(am)-(i);(j)>=0;(j)--) \
+                           { (k) = (am) - (i) - (j);
+#define END_FOR_CART }}
+
+/* This sets up a loop over all of the generalized contractions
+ * and all of the cartesian exponents.
+ * gc is the number of the gen con
+ * index is the index within the current gen con.
+ * i,j,k are the angular momentum for x,y,z
+ * sh is the shell pointer
+ */
+#define FOR_GCCART(gc,index,i,j,k,sh)\
+    for ((gc)=0; (gc)<(sh)->ncon; (gc)++) {\
+    (index)=0;\
+    FOR_CART(i,j,k,(sh)->type[gc].am)
+
+#define FOR_GCCART_GS(gc,index,i,j,k,sh)\
+    for ((gc)=0; (gc)<(sh)->ncontraction(); (gc)++) {\
+    (index)=0;\
+    FOR_CART(i,j,k,(sh)->am(gc))
+
+#define END_FOR_GCCART(index)\
+    (index)++;\
+    END_FOR_CART\
+    }
+
+#define END_FOR_GCCART_GS(index)\
+    (index)++;\
+    END_FOR_CART\
+    }
+
+/* These are like the above except no index is kept track of. */
+#define FOR_GCCART2(gc,i,j,k,sh)\
+    for ((gc)=0; (gc)<(sh)->ncon; (gc)++) {\
+    FOR_CART(i,j,k,(sh)->type[gc].am)
+
+#define END_FOR_GCCART2\
+    END_FOR_CART\
+    }
+
+/* These are used to loop over shells, given the centers structure
+ * and the center index, and shell index. */
+#define FOR_SHELLS(c,i,j) for((i)=0;(i)<(c)->n;i++) {\
+                          for((j)=0;(j)<(c)->center[(i)].basis.n;j++) {
+#define END_FOR_SHELLS }}
+
+/* Computes the number of Cartesian function in a shell given
+ * am = total angular momentum
+ * formula: (am*(am+1))/2 + am+1;
+ */
+#define INT_NCART(am) ((am>=0)?((((am)+2)*((am)+1))>>1):0)
+
+/* Like INT_NCART, but only for nonnegative arguments. */
+#define INT_NCART_NN(am) ((((am)+2)*((am)+1))>>1)
+
+/* For a given ang. mom., am, with n cartesian functions, compute the
+ * number of cartesian functions for am+1 or am-1
+ */
+#define INT_NCART_DEC(am,n) ((n)-(am)-1)
+#define INT_NCART_INC(am,n) ((n)+(am)+2)
+
+/* Computes the number of pure angular momentum functions in a shell
+ * given am = total angular momentum
+ */
+#define INT_NPURE(am) (2*(am)+1)
+
+/* Computes the number of functions in a shell given
+ * pu = pure angular momentum boolean
+ * am = total angular momentum
+ */
+#define INT_NFUNC(pu,am) ((pu)?INT_NPURE(am):INT_NCART(am))
+
+/* Given a centers pointer and a shell number, this evaluates the
+ * pointer to that shell. */
+#define INT_SH(c,s) ((c)->center[(c)->center_num[s]].basis.shell[(c)->shell_num[s]])
+
+/* Given a centers pointer and a shell number, get the angular momentum
+ * of that shell. */
+#define INT_SH_AM(c,s) ((c)->center[(c)->center_num[s]].basis.shell[(c)->shell_num[s]].type.am)
+
+/* Given a centers pointer and a shell number, get pure angular momentum
+ * boolean for that shell. */
+#define INT_SH_PU(c,s) ((c)->center[(c)->center_num[s]].basis.shell[(c)->shell_num[s]].type.puream)
+
+/* Given a centers pointer, a center number, and a shell number,
+ * get the angular momentum of that shell. */
+#define INT_CE_SH_AM(c,a,s) ((c)->center[(a)].basis.shell[(s)].type.am)
+
+/* Given a centers pointer, a center number, and a shell number,
+ * get pure angular momentum boolean for that shell. */
+#define INT_CE_SH_PU(c,a,s) ((c)->center[(a)].basis.shell[(s)].type.puream)
+
+/* Given a centers pointer and a shell number, compute the number
+ * of functions in that shell. */
+/* #define INT_SH_NFUNC(c,s) INT_NFUNC(INT_SH_PU(c,s),INT_SH_AM(c,s)) */
+#define INT_SH_NFUNC(c,s) ((c)->center[(c)->center_num[s]].basis.shell[(c)->shell_num[s]].nfunc)
+
+/* These macros assist in looping over the unique integrals
+ * in a shell quartet.  The exy variables are booleans giving
+ * information about the equivalence between shells x and y.  The nx
+ * variables give the number of functions in each shell, x. The
+ * i,j,k are the current values of the looping indices for shells 1, 2, and 3.
+ * The macros return the maximum index to be included in a summation
+ * over indices 1, 2, 3, and 4.
+ * These macros require canonical integrals.  This requirement comes
+ * from the need that integrals of the shells (1 2|2 1) are not
+ * used.  The integrals (1 2|1 2) must be used with these macros to
+ * get the right nonredundant integrals.
+ */
+#define INT_MAX1(n1) ((n1)-1)
+#define INT_MAX2(e12,i,n2) ((e12)?(i):((n2)-1))
+#define INT_MAX3(e13e24,i,n3) ((e13e24)?(i):((n3)-1))
+#define INT_MAX4(e13e24,e34,i,j,k,n4) \
+  ((e34)?(((e13e24)&&((k)==(i)))?(j):(k)) \
+        :((e13e24)&&((k)==(i)))?(j):(n4)-1)
+/* A note on integral symmetries:
+ *  There are 15 ways of having equivalent indices.
+ *  There are 8 of these which are important for determining the
+ *  nonredundant integrals (that is there are only 8 ways of counting
+ *  the number of nonredundant integrals in a shell quartet)
+ * Integral type   Integral    Counting Type
+ *     1           (1 2|3 4)      1
+ *     2           (1 1|3 4)      2
+ *     3           (1 2|1 4)       ->1
+ *     4           (1 2|3 1)       ->1
+ *     5           (1 1|1 4)      3
+ *     6           (1 1|3 1)       ->2
+ *     7           (1 2|1 1)       ->5
+ *     8           (1 1|1 1)      4
+ *     9           (1 2|2 4)       ->1
+ *    10           (1 2|3 2)       ->1
+ *    11           (1 2|3 3)      5
+ *    12           (1 1|3 3)      6
+ *    13           (1 2|1 2)      7
+ *    14           (1 2|2 1)      8    reduces to 7 thru canonicalization
+ *    15           (1 2|2 2)       ->5
+ */
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/obintcca.cc
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/obintcca.cc	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/obintcca.cc	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,166 @@
+//
+// obintcca.cc
+//
+// Copyright (C) 2004 Sandia National Laboratories
+//
+// Author: Joe Kenny <jpkenny@sandia.gov>
+// Maintainer: Joe Kenny
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include <chemistry/qc/intcca/obintcca.h>
+#include <util/class/scexception.h>
+#include <Chemistry_Chemistry_QC_GaussianBasis_DerivCenters.hh>
+
+using namespace std;
+using namespace Chemistry;
+using namespace Chemistry::QC::GaussianBasis;
+using namespace sc;
+
+////////////////////////////////////////////////////////////////////////////
+// OneBodyIntCCA
+
+OneBodyIntCCA::OneBodyIntCCA(Integral* integral,
+                           const Ref<GaussianBasisSet>&bs1,
+                           const Ref<GaussianBasisSet>&bs2,
+			   IntegralEvaluatorFactory eval_factory,
+                           IntegralFunction ifunc,
+                           bool use_opaque ):
+  OneBodyInt(integral,bs1,bs2), intfunc_(ifunc), eval_factory_(eval_factory), 
+  use_opaque_(use_opaque) 
+{
+  std::string int_type;
+  if( ifunc == &Int1eCCA::overlap ) int_type = "overlap";
+  else if (ifunc == &Int1eCCA::kinetic ) int_type = "kinetic";
+  else if (ifunc == &Int1eCCA::nuclear ) int_type = "nuclear";
+  else if (ifunc == &Int1eCCA::hcore ) int_type = "1eham";
+  int1ecca_ = new Int1eCCA(integral,bs1,bs2,0,eval_factory,int_type,use_opaque);
+  buffer_ = int1ecca_->buffer();
+}
+
+OneBodyIntCCA::~OneBodyIntCCA()
+{
+}
+
+void
+OneBodyIntCCA::compute_shell(int i, int j)
+{
+  (int1ecca_.pointer()->*intfunc_)(i, j);
+}
+
+bool
+OneBodyIntCCA::cloneable()
+{
+  return true;
+}
+
+Ref<OneBodyInt>
+OneBodyIntCCA::clone()
+{
+  return new OneBodyIntCCA(integral_, bs1_, bs2_, 
+                           eval_factory_, intfunc_, use_opaque_ );
+}
+
+// ////////////////////////////////////////////////////////////////////////////
+// // OneBodyDerivIntCCA
+
+OneBodyDerivIntCCA::OneBodyDerivIntCCA(Integral *integral,
+                                       const Ref<GaussianBasisSet>&bs1,
+                                       const Ref<GaussianBasisSet>&bs2,
+                                       IntegralEvaluatorFactory eval_factory,
+                                       bool use_opaque,
+                                       string eval_type ):
+  OneBodyDerivInt(integral,bs1,bs2), eval_factory_(eval_factory),
+  use_opaque_(use_opaque), eval_type_(eval_type)
+{
+  int1ecca_ = new Int1eCCA(integral,bs1,bs2,1,eval_factory,eval_type,use_opaque);
+  buffer_ = int1ecca_->buffer();
+}
+
+OneBodyDerivIntCCA::~OneBodyDerivIntCCA()
+{
+}
+
+void
+OneBodyDerivIntCCA::compute_shell(int i, int j, DerivCenters& c)
+{
+  c.clear();
+  c.add_center(0,basis1(),i);
+  c.add_omitted(1,basis2(),j);
+  Chemistry_QC_GaussianBasis_DerivCenters cca_dc;
+  cca_dc = Chemistry_QC_GaussianBasis_DerivCenters::_create();
+  for( int id=0; id<c.n(); ++id ) {
+     if( id == c.omitted_center() )
+       cca_dc.add_omitted(c.center(id),c.atom(id));
+     else
+       cca_dc.add_center(c.center(id),c.atom(id));
+  }
+  
+  if( eval_type_ == "overlap_1der" )
+    int1ecca_->overlap_1der(i,j,cca_dc);
+  else if( eval_type_ == "kinetic_1der" )  
+    int1ecca_->kinetic_1der(i,j,cca_dc);
+  else if( eval_type_ == "nuclear_1der" )
+    int1ecca_->nuclear_1der(i,j,cca_dc);
+  else if( eval_type_ == "hcore_1der" )
+    int1ecca_->hcore_1der(i,j,cca_dc);
+}
+
+void 
+OneBodyDerivIntCCA::compute_shell(int i, int j, int c) {
+
+  Chemistry_QC_GaussianBasis_DerivCenters cca_dc;
+  cca_dc = Chemistry_QC_GaussianBasis_DerivCenters::_create();
+  if( basis1()->shell_to_center(i) == basis2()->shell_to_center(j) ) {
+    cca_dc.add_center(0,c);
+    cca_dc.add_omitted(1,c);
+  }
+  else if( basis1()->shell_to_center(i) == c ) {
+    cca_dc.add_center(0,c);
+    cca_dc.add_omitted( 1, basis2()->shell_to_center(j) );
+  }
+  else {
+    cca_dc.add_center(1,c);
+    cca_dc.add_omitted( 0, basis1()->shell_to_center(i) );
+  }
+ 
+  std::cerr << "setting omitted atom to " << basis2()->shell_to_center(j) << std::endl;
+  cca_dc.add_omitted(1,basis2()->shell_to_center(j));
+  
+  if( eval_type_ == "overlap_1der" )
+    int1ecca_->overlap_1der(i,j,cca_dc);
+  else if( eval_type_ == "kinetic_1der" )
+    int1ecca_->kinetic_1der(i,j,cca_dc);
+  else if( eval_type_ == "nuclear_1der" )
+    int1ecca_->nuclear_1der(i,j,cca_dc);
+  else if( eval_type_ == "hcore_1der" )
+    int1ecca_->hcore_1der(i,j,cca_dc);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+// Local Variables:
+// mode: c++
+// c-file-style: "CLJ"
+// End:
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/obintcca.h
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/obintcca.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/obintcca.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,98 @@
+//
+// obintcca.h
+//
+// Copyright (C) 2004, Sandia National Laboratories
+//
+// Author: Joe Kenny <jpkenny@sandia.gov>
+// Maintainer: Joe Kenny
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#ifndef _chemistry_qc_intcca_obintcca_h
+#define _chemistry_qc_intcca_obintcca_h
+
+#include <chemistry/qc/basis/obint.h>
+#include <chemistry/qc/intcca/int1e.h>
+#include <Chemistry_QC_GaussianBasis_IntegralEvaluatorFactory.hh>
+#include <Chemistry_QC_GaussianBasis_DerivCenters.hh>
+
+using namespace Chemistry::QC::GaussianBasis;
+
+namespace sc {
+
+// /////////////////////////////////////////////////////////////////////////
+
+/** This implements one body integrals through the CCA interface. It is
+    given a function pointer to the IntCCA member that computes the
+    particular integral of interest. */
+class OneBodyIntCCA : public OneBodyInt {
+  private:
+    IntegralEvaluatorFactory eval_factory_;
+    bool use_opaque_;
+  protected:
+    Ref<sc::Int1eCCA> int1ecca_;
+    typedef void (sc::Int1eCCA::*IntegralFunction)(int,int);
+    IntegralFunction intfunc_;
+  public:
+    OneBodyIntCCA(Integral*,
+                 const Ref<GaussianBasisSet>&, const Ref<GaussianBasisSet>&,
+                 IntegralEvaluatorFactory, IntegralFunction, bool );
+    ~OneBodyIntCCA();
+    void compute_shell(int,int);
+    bool cloneable();
+    Ref<OneBodyInt> clone();
+};
+
+///////////////////////////////////////////////////////////////////////////////
+
+ /** This implements one body derivative integrals. It
+     is given a function pointer to the Int1eCCA member that computes the
+     particular integral of interest. */
+class OneBodyDerivIntCCA : public OneBodyDerivInt {
+  private:
+    IntegralEvaluatorFactory eval_factory_;
+    bool use_opaque_;
+    string eval_type_;
+  protected:
+    Ref<Int1eCCA> int1ecca_;
+    typedef void (Int1eCCA::*IntegralFunction)(int, int, DerivCenters&);
+  public:
+    OneBodyDerivIntCCA(Integral*,
+                      const Ref<GaussianBasisSet>&,
+                      const Ref<GaussianBasisSet>&,
+                      IntegralEvaluatorFactory,
+                      bool, string);
+    ~OneBodyDerivIntCCA();
+    void compute_shell(int, int, DerivCenters&);
+    void compute_shell(int, int, int);
+};
+
+}
+
+#endif
+
+// Local Variables:
+// mode: c++
+// c-file-style: "CLJ"
+// End:
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/tbintcca.cc
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/tbintcca.cc	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/tbintcca.cc	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,124 @@
+//
+// tbintcca.cc
+//
+// Copyright (C) 2004 Sandia National Laboratories
+//
+// Author: Joe Kenny <jpkenny@sandia.gov>
+// Maintainer: Joe Kenny
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include <chemistry/qc/intcca/tbintcca.h>
+#include <Chemistry_Chemistry_QC_GaussianBasis_DerivCenters.hh>
+#include <util/class/scexception.h>
+
+using namespace Chemistry::QC::GaussianBasis;
+using namespace sc;
+
+////////////////////////////////////////////////////////////////////////////
+// TwoBodyIntCCA
+
+TwoBodyIntCCA::TwoBodyIntCCA(Integral* integral,
+                             const Ref<GaussianBasisSet> &bs1,
+                             const Ref<GaussianBasisSet> &bs2,
+			     const Ref<GaussianBasisSet> &bs3,
+			     const Ref<GaussianBasisSet> &bs4,
+			     size_t storage,
+			     IntegralEvaluatorFactory eval_factory, 
+                             bool use_opaque, string eval_type) :
+  TwoBodyInt(integral,bs1,bs2,bs3,bs4) 
+{
+  int2ecca_ = new Int2eCCA(integral,bs1,bs2,bs3,bs4,0,storage,
+                           eval_factory,use_opaque,eval_type);
+  buffer_ = int2ecca_->buffer();
+  int2ecca_->set_redundant(redundant_);
+}
+
+void
+TwoBodyIntCCA::compute_shell(int is, int js, int ks, int ls)
+{
+  int2ecca_->compute_erep(is,js,ks,ls);
+}
+
+int
+TwoBodyIntCCA::log2_shell_bound(int is, int js, int ks, int ls)
+{
+  return 256;
+}
+
+void
+TwoBodyIntCCA::set_integral_storage(size_t storage)
+{
+//  throw FeatureNotImplemented("set_integral_storage needs to be implemented",
+//                              __FILE__,__LINE__);
+}
+
+
+////////////////////////////////////////////////////////////////////////////
+// TwoBodyDerivIntCCA
+
+TwoBodyDerivIntCCA::TwoBodyDerivIntCCA(Integral* integral,
+                             const Ref<GaussianBasisSet> &bs1,
+                             const Ref<GaussianBasisSet> &bs2,
+                             const Ref<GaussianBasisSet> &bs3,
+                             const Ref<GaussianBasisSet> &bs4,
+                             size_t storage,
+                             IntegralEvaluatorFactory eval_factory,
+                             bool use_opaque, string eval_type) :
+  TwoBodyDerivInt(integral,bs1,bs2,bs3,bs4)
+{
+  int2ecca_ = new Int2eCCA(integral,bs1,bs2,bs3,bs4,1,storage,
+                           eval_factory,use_opaque,eval_type);
+  buffer_ = int2ecca_->buffer();
+  int2ecca_->set_redundant(0);
+}
+
+void
+TwoBodyDerivIntCCA::compute_shell(int is, int js, int ks, int ls,
+                                  DerivCenters &dc )
+{
+  Chemistry::QC::GaussianBasis::DerivCenters cca_dc;
+  cca_dc = Chemistry_QC_GaussianBasis_DerivCenters::_create();
+  for( int id=0; id<cca_dc.n(); ++id ) {
+    if( id == cca_dc.omitted_center() )
+       dc.add_omitted(cca_dc.center(id),cca_dc.atom(id));
+     else
+       dc.add_center(cca_dc.center(id),cca_dc.atom(id));
+  }
+
+  int2ecca_->compute_erep_1der(is,js,ks,ls,cca_dc);
+
+}
+
+int
+TwoBodyDerivIntCCA::log2_shell_bound(int is, int js, int ks, int ls)
+{
+  return 256;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Local Variables:
+// mode: c++
+// c-file-style: "CLJ"
+// End:
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/tbintcca.h
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/tbintcca.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/tbintcca.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,99 @@
+//
+// tbintcca.h
+//
+// Copyright (C) 2004, Sandia National Laboratories
+//
+// Author: Joe Kenny <jpkenny@sandia.gov>
+// Maintainer: Joe Kenny
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#ifndef _chemistry_qc_intcca_tbintcca_h
+#define _chemistry_qc_intcca_tbintcca_h
+
+#include <chemistry/qc/basis/tbint.h>
+#include <chemistry/qc/intcca/int2e.h>
+#include <Chemistry_QC_GaussianBasis_IntegralEvaluatorFactory.hh>
+
+using namespace std;
+using namespace Chemistry::QC::GaussianBasis;
+
+namespace sc {
+
+/** This implements two body integrals through the CCA interface. */
+class TwoBodyIntCCA : public TwoBodyInt {
+  protected:
+    Ref<Int2eCCA> int2ecca_;
+
+  public:
+    TwoBodyIntCCA(Integral*,
+		  const Ref<GaussianBasisSet>&b1, 
+		  const Ref<GaussianBasisSet>&b2,
+		  const Ref<GaussianBasisSet>&b3, 
+		  const Ref<GaussianBasisSet>&b4,
+                  size_t storage, IntegralEvaluatorFactory, 
+                  bool, string );
+    ~TwoBodyIntCCA() {};
+
+    int log2_shell_bound(int,int,int,int);
+    void compute_shell(int,int,int,int);
+    
+    size_t storage_used();
+    void set_integral_storage(size_t storage);
+    int redundant() const { return int2ecca_->redundant(); }
+    void set_redundant(int i) { int2ecca_->set_redundant(i); }
+};
+
+/** This implements two body derivative integrals 
+    through the CCA interface. */
+class TwoBodyDerivIntCCA : public TwoBodyDerivInt {
+  protected:
+    Ref<Int2eCCA> int2ecca_;
+
+  public:
+    TwoBodyDerivIntCCA(Integral*,
+                  const Ref<GaussianBasisSet>&b1,
+                  const Ref<GaussianBasisSet>&b2,
+                  const Ref<GaussianBasisSet>&b3,
+                  const Ref<GaussianBasisSet>&b4,
+                  size_t storage, IntegralEvaluatorFactory, bool, string);
+    ~TwoBodyDerivIntCCA() {};
+
+    int log2_shell_bound(int,int,int,int);
+    void compute_shell(int,int,int,int,DerivCenters&);
+
+    size_t storage_used();
+    void set_integral_storage(size_t storage);
+    int redundant() const { return int2ecca_->redundant(); }
+    void set_redundant(int i) { int2ecca_->set_redundant(i); }
+};
+
+}
+
+#endif
+
+// Local Variables:
+// mode: c++
+// c-file-style: "CLJ"
+// End:
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/tform.h
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/tform.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/tform.h	(revision 860145ede0311b3539e419277d8ca4a3091f40b2)
@@ -0,0 +1,83 @@
+//
+// tform.h
+//
+// Copyright (C) 2001 Edward Valeev
+//
+// Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
+// Maintainer: EV
+//
+// This file is part of the SC Toolkit.
+//
+// The SC Toolkit is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// The SC Toolkit is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
+// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// The U.S. Government is granted a limited license as per AL 91-7.
+//
+
+#ifndef _chemistry_qc_cints_tform_h
+#define _chemistry_qc_cints_tform_h
+
+#include <chemistry/qc/basis/gaussshell.h>
+#include <chemistry/qc/basis/transform.h>
+#include <chemistry/qc/intcca/macros.h>
+
+namespace sc {
+
+class Integral;
+
+class SphericalTransformComponentCCA : public SphericalTransformComponent {
+  public:
+    void init(int a, int b, int c, double coef, int pureindex) {
+      a_ = a;
+      b_ = b;
+      c_ = c;
+      // Modify the coefficient here to conform the normalization 
+      // convention of cints
+      coef_ = coef;
+
+      pureindex_ = pureindex;
+      cartindex_ = INT_CARTINDEX(a+b+c,a,b);
+    }
+};
+
+class SphericalTransformCCA : public SphericalTransform {
+  public:
+    SphericalTransformCCA(int l, int subl=-1):SphericalTransform(l,subl) {
+      init();
+    }
+
+    SphericalTransformComponent * new_components() {
+      return new SphericalTransformComponentCCA[n_+1];
+    }
+};
+
+class ISphericalTransformCCA : public ISphericalTransform {
+  public:
+    ISphericalTransformCCA(int l, int subl=-1):ISphericalTransform(l,subl) {
+      init();
+    }
+
+    SphericalTransformComponent * new_components() {
+      return new SphericalTransformComponentCCA[n_+1];
+    }
+};
+
+}
+
+#endif
+
+// Local Variables:
+// mode: c++
+// c-file-style: "CLJ"
+// End:
