Index: src/Fragmentation/Homology/unittests/HomologyGraphUnitTest.cpp
===================================================================
--- src/Fragmentation/Homology/unittests/HomologyGraphUnitTest.cpp	(revision 2bde72f96c32ee086640c592c1e1c843c1e21b8a)
+++ src/Fragmentation/Homology/unittests/HomologyGraphUnitTest.cpp	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
@@ -44,7 +44,4 @@
 #include <boost/archive/text_iarchive.hpp>
 
-#include "Fragmentation/Homology/HomologyGraph.hpp"
-#include "Fragmentation/Graph.hpp"
-
 #include "HomologyGraphUnitTest.hpp"
 
@@ -53,4 +50,7 @@
 #include <boost/assign.hpp>
 #include <sstream>
+
+#include "Fragmentation/Homology/HomologyGraph.hpp"
+#include "Fragmentation/Graph.hpp"
 
 using namespace boost::assign;
Index: src/Fragmentation/Homology/unittests/HomologyGraphUnitTest.hpp
===================================================================
--- src/Fragmentation/Homology/unittests/HomologyGraphUnitTest.hpp	(revision 2bde72f96c32ee086640c592c1e1c843c1e21b8a)
+++ src/Fragmentation/Homology/unittests/HomologyGraphUnitTest.hpp	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
@@ -19,6 +19,5 @@
 #include "Fragmentation/Homology/FragmentEdge.hpp"
 #include "Fragmentation/Homology/FragmentNode.hpp"
-
-class HomologyGraph;
+#include "Fragmentation/Homology/HomologyGraph.hpp"
 
 /********************************************** Test classes **************************************/
Index: src/Potentials/CompoundPotential.cpp
===================================================================
--- src/Potentials/CompoundPotential.cpp	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
+++ src/Potentials/CompoundPotential.cpp	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
@@ -0,0 +1,280 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2013 University of Bonn. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder 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 General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * CompoundPotential.cpp
+ *
+ *  Created on: May 8, 2013
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "Potentials/CompoundPotential.hpp"
+
+#include <algorithm>
+#include <boost/bind.hpp>
+#include <boost/foreach.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <iterator>
+#include <numeric>
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+
+#include "Element/element.hpp"
+#include "Fragmentation/Homology/HomologyGraph.hpp"
+#include "Fragmentation/Summation/SetValues/Fragment.hpp"
+#include "FunctionApproximation/Extractors.hpp"
+#include "Potentials/EmpiricalPotential.hpp"
+#include "Potentials/PotentialRegistry.hpp"
+
+
+CompoundPotential::CompoundPotential(const HomologyGraph &graph)
+{
+  LOG(1, "INFO: Creating CompoundPotential for graph " << graph << ".");
+  // look though graph and place all matching FunctionModel's in
+  // PotentialRegistry in models
+  PotentialRegistry::const_iterator potentialiter =
+      PotentialRegistry::getInstance().getBeginIter();
+  while (potentialiter != PotentialRegistry::getInstance().getEndIter()) {
+    // get model and types
+    EmpiricalPotential * const potential = potentialiter->second;
+    const SerializablePotential::ParticleTypes_t &types =
+        potential->getParticleTypes();
+
+    // create charges
+    Fragment::charges_t charges;
+    charges.resize(types.size());
+    std::transform(types.begin(), types.end(),
+        charges.begin(), boost::lambda::_1);
+    // convert into count map
+    Extractors::elementcounts_t counts_per_charge =
+        Extractors::_detail::getElementCounts(charges);
+    ASSERT( !counts_per_charge.empty(),
+        "getFirstGraphwithSpecifiedElements() - charge counts are empty?");
+    LOG(2, "DEBUG: counts_per_charge is " << counts_per_charge << ".");
+
+    // check whether graph contains suitable types
+    Extractors::elementcounts_t::const_iterator countiter = counts_per_charge.begin();
+    for (; countiter != counts_per_charge.end(); ++countiter)
+      if (!graph.hasTimesAtomicNumber(
+          static_cast<size_t>(countiter->first),
+          static_cast<size_t>(countiter->second))
+          )
+        break;
+    // if we have a match for every count, store model
+    if( countiter == counts_per_charge.end()) {
+      LOG(1, "INFO: Potential " << potentialiter->first << " matches with fragment.");
+      models.push_back(static_cast<FunctionModel*>(potential));
+      particletypes_per_model.push_back(types);
+    }
+    ++potentialiter;
+  }
+
+  // check that models and particletypes_per_model match
+  ASSERT( models.size() == particletypes_per_model.size(),
+      "CompoundPotential::CompoundPotential() - particletypes not stored for all models?");
+}
+
+CompoundPotential::~CompoundPotential()
+{
+  // clear all models and internally stored particletypes
+  models.clear();
+  particletypes_per_model.clear();
+}
+
+void CompoundPotential::setParameters(const parameters_t &_params)
+{
+  size_t dim = _params.size();
+  parameters_t::const_iterator iter = _params.begin();
+  BOOST_FOREACH( FunctionModel* model, models) {
+    const parameters_t &model_params = model->getParameters();
+    const size_t model_dim = model_params.size();
+    if (dim > 0) {
+      parameters_t subparams;
+      if (dim < model_dim) {
+        std::copy(iter, iter+dim, std::back_inserter(subparams));
+        dim = 0;
+      } else {
+        std::copy(iter, iter+model_dim, std::back_inserter(subparams));
+        dim -= model_dim;
+      }
+      model->setParameters(subparams);
+    }
+  }
+}
+
+CompoundPotential::parameters_t CompoundPotential::getParameters() const
+{
+  const size_t dimension = getParameterDimension();
+  CompoundPotential::parameters_t parameters(dimension);
+  CompoundPotential::parameters_t::iterator iter = parameters.begin();
+  BOOST_FOREACH( const FunctionModel* model, models) {
+    const CompoundPotential::parameters_t &params = model->getParameters();
+    std::copy(params.begin(), params.end(), iter);
+    ASSERT( iter != parameters.end(),
+        "CompoundPotential::getParameters() - iter already at end.");
+  }
+  return parameters;
+}
+
+void CompoundPotential::setParametersToRandomInitialValues(const TrainingData &data)
+{
+  std::for_each(models.begin(), models.end(),
+      boost::bind(&FunctionModel::setParametersToRandomInitialValues, _1, boost::cref(data))
+  );
+}
+
+size_t CompoundPotential::getParameterDimension() const
+{
+  std::vector<size_t> dimensions(models.size(), 0);
+  std::transform(models.begin(), models.end(), dimensions.begin(),
+      boost::bind(&FunctionModel::getParameterDimension, _1));
+  return std::accumulate(dimensions.begin(), dimensions.end(), 0, std::plus<size_t>());
+}
+
+void CompoundPotential::setTriplefunction(triplefunction_t &_triplefunction)
+{
+  std::for_each(models.begin(), models.end(),
+      boost::bind(&FunctionModel::setTriplefunction, _1, boost::ref(_triplefunction))
+  );
+}
+
+CompoundPotential::results_t CompoundPotential::operator()(const arguments_t &arguments) const
+{
+  results_t results(1,0.);
+  std::vector<results_t> partial_results(models.size());
+  std::transform(models.begin(), models.end(), partial_results.begin(),
+          boost::bind(&FunctionModel::operator(), _1, boost::cref(arguments))
+  );
+  std::for_each(partial_results.begin(), partial_results.end(),
+      results[0] += (boost::lambda::_1)[0]);
+  return results;
+}
+
+CompoundPotential::results_t CompoundPotential::parameter_derivative(const arguments_t &arguments, const size_t index) const
+{
+  // get parameter dimensions per model
+  std::vector<size_t> dimensions(models.size(), 0);
+  std::transform(models.begin(), models.end(), dimensions.begin(),
+      boost::bind(&FunctionModel::getParameterDimension, _1));
+
+  // convert to index end+1 per model
+  std::partial_sum(dimensions.begin(), dimensions.end(), dimensions.begin());
+
+  // look for value not less than index
+  std::vector<size_t>::const_iterator iter =
+      std::lower_bound(dimensions.begin(), dimensions.end(), index);
+  models_t::const_iterator modeliter = models.begin();
+
+  // step forward to same model
+  std::advance(modeliter,
+      std::distance(const_cast<const std::vector<size_t> &>(dimensions).begin(), iter) );
+
+  // evaluate with correct relative index and return
+  const size_t indexbase = (iter == dimensions.begin()) ? 0 : *(--iter);
+  CompoundPotential::results_t results =
+      (*modeliter)->parameter_derivative(arguments, index-indexbase);
+  return results;
+}
+
+bool CompoundPotential::isBoxConstraint() const
+{
+  std::vector<bool> constraints(models.size(), 0);
+  std::transform(models.begin(), models.end(), constraints.begin(),
+      boost::bind(&FunctionModel::getParameterDimension, _1));
+  return std::accumulate(constraints.begin(), constraints.end(), true,
+      std::logical_and<bool>());
+}
+
+CompoundPotential::parameters_t CompoundPotential::getLowerBoxConstraints() const
+{
+  const size_t dimension = getParameterDimension();
+  CompoundPotential::parameters_t constraints(dimension);
+  CompoundPotential::parameters_t::iterator iter = constraints.begin();
+  BOOST_FOREACH( FunctionModel* model, models) {
+    const CompoundPotential::parameters_t params = model->getLowerBoxConstraints();
+    std::copy(params.begin(), params.end(), iter);
+    ASSERT( iter != constraints.end(),
+        "CompoundPotential::getParameters() - iter already at end.");
+  }
+  return constraints;
+}
+
+CompoundPotential::parameters_t CompoundPotential::getUpperBoxConstraints() const
+{
+  const size_t dimension = getParameterDimension();
+  CompoundPotential::parameters_t constraints(dimension);
+  CompoundPotential::parameters_t::iterator iter = constraints.begin();
+  BOOST_FOREACH( FunctionModel* model, models) {
+    const CompoundPotential::parameters_t params = model->getUpperBoxConstraints();
+    std::copy(params.begin(), params.end(), iter);
+    ASSERT( iter != constraints.end(),
+        "CompoundPotential::getParameters() - iter already at end.");
+  }
+  return constraints;
+}
+
+FunctionModel::extractor_t CompoundPotential::getFragmentSpecificExtractor() const
+{
+  // create initial returnfunction
+  particletypes_per_model_t::const_iterator typesiter = particletypes_per_model.begin();
+  Fragment::charges_t charges;
+  {
+    charges.resize((*typesiter).size());
+    std::transform((*typesiter).begin(), (*typesiter).end(),
+        charges.begin(), boost::lambda::_1);
+  }
+  FunctionModel::extractor_t returnfunction =
+    boost::bind(&Extractors::gatherAllDistancesFromFragment,
+        boost::bind(&Fragment::getPositions, _1),
+        boost::bind(&Fragment::getCharges, _1),
+        charges,  // no crefs here as are temporaries!
+        _2);
+
+  // every following fragments combines its arguments with the initial function
+  for (; typesiter != particletypes_per_model.end(); ++typesiter) {
+    Fragment::charges_t charges;
+    {
+      charges.resize((*typesiter).size());
+      std::transform((*typesiter).begin(), (*typesiter).end(),
+          charges.begin(), boost::lambda::_1);
+    }
+
+    returnfunction =
+          boost::bind(&Extractors::combineArguments,
+              boost::bind(returnfunction, _1, _2),
+              boost::bind(&Extractors::gatherAllDistancesFromFragment,
+                  boost::bind(&Fragment::getPositions, _1),
+                  boost::bind(&Fragment::getCharges, _1),
+                  charges,  // no crefs here as are temporaries!
+                  _2)
+        );
+  }
+  return returnfunction;
+}
Index: src/Potentials/CompoundPotential.hpp
===================================================================
--- src/Potentials/CompoundPotential.hpp	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
+++ src/Potentials/CompoundPotential.hpp	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
@@ -0,0 +1,148 @@
+/*
+ * CompoundPotential.hpp
+ *
+ *  Created on: May 8, 2013
+ *      Author: heber
+ */
+
+#ifndef COMPOUNDPOTENTIAL_HPP_
+#define COMPOUNDPOTENTIAL_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "FunctionApproximation/FunctionModel.hpp"
+#include "Potentials/SerializablePotential.hpp"
+
+#include <vector>
+
+class CompoundPotentialTest;
+class HomologyGraph;
+class TrainingData;
+
+/** CompoundPotential combines several FunctionModel's as one to allow for
+ * simultaneous FunctionApproximation to a single fragment/graph.
+ *
+ * The CompoundPotential obtains a Graph as parameter to cstor and looks through
+ * the PotentialRegistry marking all potentials whose ParticleTypes_t signature
+ * matches. All of these are placed into an internal vector and used for
+ * fitting.
+ */
+class CompoundPotential :
+    public FunctionModel
+{
+  //!> grant unit test access to internal parts
+  friend class CompoundPotentialTest;
+  // some repeated typedefs to avoid ambiguities
+  typedef FunctionModel::arguments_t arguments_t;
+  typedef FunctionModel::result_t result_t;
+  typedef FunctionModel::results_t results_t;
+  typedef FunctionModel::parameters_t parameters_t;
+public:
+  /** Constructor for class CompoundPotential.
+   *
+   * \param graph graph to be checked against present ParticleTypes_t signatures
+   *        of potentials in PotentialRegistry
+   */
+  CompoundPotential(const HomologyGraph &graph);
+
+  /** Destructor for class CompoundPotential.
+   *
+   */
+  virtual ~CompoundPotential();
+
+  /** Setter for parameters as required by FunctionModel interface.
+   *
+   * \param _params given set of parameters
+   */
+  void setParameters(const parameters_t &_params);
+
+  /** Getter for parameters as required by FunctionModel interface.
+   *
+   * \return set of parameters
+   */
+  parameters_t getParameters() const;
+
+  /** Sets the parameter randomly within the sensible range of each parameter.
+   *
+   * \param data container with training data for guesstimating range
+   */
+  void setParametersToRandomInitialValues(const TrainingData &data);
+
+  /** Getter for the number of parameters of this model function.
+   *
+   * \return number of parameters
+   */
+  size_t getParameterDimension() const;
+
+  /** Sets the magic triple function that we use for getting angle distances.
+   *
+   * @param _triplefunction function that returns a list of triples (i.e. the
+   *        two remaining distances) to a given pair of points (contained as
+   *        indices within the argument)
+   */
+  void setTriplefunction(triplefunction_t &_triplefunction);
+
+  /** Evaluates the harmonic potential function for the given arguments.
+   *
+   * @param arguments single distance
+   * @return value of the potential function
+   */
+  results_t operator()(const arguments_t &arguments) const;
+
+  /** Evaluates the derivative of the function with the given \a arguments
+   * with respect to a specific parameter indicated by \a index.
+   *
+   * \param arguments set of arguments as input variables to the function
+   * \param index derivative of which parameter
+   * \return result vector containing the derivative with respect to the given
+   *         input
+   */
+  results_t parameter_derivative(const arguments_t &arguments, const size_t index) const;
+
+  /** States whether lower and upper boundaries should be used to constraint
+   * the parameter search for this function model.
+   *
+   * \return true - constraints should be used, false - else
+   */
+  bool isBoxConstraint() const;
+
+  /** Returns a vector which are the lower boundaries for each parameter_t
+   * of this FunctionModel.
+   *
+   * \return vector of parameter_t resembling lowest allowed values
+   */
+  parameters_t getLowerBoxConstraints() const;
+
+  /** Returns a vector which are the upper boundaries for each parameter_t
+   * of this FunctionModel.
+   *
+   * \return vector of parameter_t resembling highest allowed values
+   */
+  parameters_t getUpperBoxConstraints() const;
+
+  /** Returns a bound function to be used with TrainingData, extracting distances
+   * from a Fragment.
+   *
+   * \return bound function extracting distances from a fragment
+   */
+  FunctionModel::extractor_t getFragmentSpecificExtractor() const;
+
+private:
+  //!> typedef for internal vector of simultaneously fitted models.
+  typedef std::vector<FunctionModel*> models_t;
+  //!> Internal vector of FunctionModels to fit simultaneously.
+  models_t models;
+
+  //!> typedef for storing internally the ParticleTypes of each model.
+  typedef std::vector<SerializablePotential::ParticleTypes_t> particletypes_per_model_t;
+  //!> Internal vector of ParticleTypes for each model to use when constructing extractor
+  particletypes_per_model_t particletypes_per_model;
+
+  //!> static token of this potential type
+  static const std::string potential_token;
+};
+
+#endif /* COMPOUNDPOTENTIAL_HPP_ */
Index: src/Potentials/Makefile.am
===================================================================
--- src/Potentials/Makefile.am	(revision 2bde72f96c32ee086640c592c1e1c843c1e21b8a)
+++ src/Potentials/Makefile.am	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
@@ -3,9 +3,10 @@
 
 POTENTIALSSOURCE = \
-  Potentials/Specifics/ManyBodyPotential_Tersoff.cpp \
+  Potentials/CompoundPotential.cpp \
   Potentials/ParticleTypeCheckers.cpp \
   Potentials/PotentialFactory.cpp \
   Potentials/PotentialRegistry.cpp \
   Potentials/SerializablePotential.cpp \
+  Potentials/Specifics/ManyBodyPotential_Tersoff.cpp \
   Potentials/Specifics/PairPotential_Angle.cpp \
   Potentials/Specifics/PairPotential_Harmonic.cpp \
@@ -15,4 +16,5 @@
 
 POTENTIALSHEADER = \
+  Potentials/CompoundPotential.hpp \
   Potentials/EmpiricalPotential.hpp \
   Potentials/Exceptions.hpp \
Index: src/Potentials/unittests/CompoundPotentialUnitTest.cpp
===================================================================
--- src/Potentials/unittests/CompoundPotentialUnitTest.cpp	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
+++ src/Potentials/unittests/CompoundPotentialUnitTest.cpp	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
@@ -0,0 +1,230 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2013 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder 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 General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * CompoundPotentialUnitTest.cpp
+ *
+ *  Created on: May 08, 2013
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "CompoundPotentialUnitTest.hpp"
+
+#include <boost/assign.hpp>
+
+#include "CodePatterns/Assert.hpp"
+
+#include "FunctionApproximation/FunctionArgument.hpp"
+#include "Potentials/CompoundPotential.hpp"
+#include "Potentials/helpers.hpp"
+#include "Potentials/PotentialFactory.hpp"
+#include "Potentials/PotentialRegistry.hpp"
+#include "Potentials/Specifics/PairPotential_Morse.hpp"
+
+using namespace boost::assign;
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( CompoundPotentialTest );
+
+
+void CompoundPotentialTest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+
+  // register MorsePotential with registry
+  {
+    PairPotential_Morse::ParticleTypes_t types =
+        boost::assign::list_of<PairPotential_Morse::ParticleType_t>
+          (0)(1)
+        ;
+    EmpiricalPotential *morse =
+        PotentialFactory::getInstance().createInstance(
+            std::string("morse"), types);
+    PotentialRegistry::getInstance().registerInstance(morse);
+    morse = NULL;
+  }
+
+  // create graph
+  {
+    // add nodes
+    nodes +=
+        std::make_pair(FragmentNode(0,1),1),
+        std::make_pair(FragmentNode(1,1),1);
+
+    // add edges
+    edges +=
+        std::make_pair(FragmentEdge(0,1),1);
+
+    // construct graph
+    graph = new HomologyGraph(nodes, edges);
+  }
+
+  // data is taken from gnuplot via set table "morse.dat" with
+  // g(x)=D*(1- exp(-a*(x-c)))**2+d
+  a = 0.897888;
+  c = 2.92953;
+  d = -78.9883;
+  D = 0.196289;
+  input +=
+      1.89012,
+      2.17632,
+      2.46253,
+      2.74873,
+      3.03493,
+      3.32114,
+      3.60734,
+      3.89354,
+      4.17974,
+      4.46595;
+  output +=
+      -78.5211,
+      -78.8049,
+      -78.935,
+      -78.9822,
+      -78.9867,
+      -78.971,
+      -78.9475,
+      -78.9225,
+      -78.899,
+      -78.8784;
+
+  CPPUNIT_ASSERT_EQUAL( input.size(), output.size() );
+}
+
+
+void CompoundPotentialTest::tearDown()
+{
+  delete graph;
+  PotentialFactory::purgeInstance();
+  PotentialRegistry::getInstance().cleanup();
+  PotentialRegistry::purgeInstance();
+}
+
+/** UnitTest for operator()
+ */
+void CompoundPotentialTest::operatorTest()
+{
+  CompoundPotential compound(*graph);
+  CompoundPotential::parameters_t params;
+  params += a,c,D,d;
+  compound.setParameters(params);
+  for (size_t index = 0; index < input.size(); ++index) {
+    argument_t arg(argument_t::indices_t(0,1), argument_t::types_t(0,1), input[index]);
+    CPPUNIT_ASSERT(
+        Helpers::isEqual(
+            output[index],
+            compound( FunctionModel::arguments_t(1,arg) )[0],
+            1.e-4/std::numeric_limits<double>::epsilon() // only compare four digits
+        )
+    );
+  }
+}
+
+/** UnitTest for derivative()
+ */
+//void CompoundPotentialTest::derivativeTest()
+//{
+//  CompoundPotential compound(*graph);
+//  CompoundPotential::parameters_t params;
+//  params += a,c,D,d;
+//  compound.setParameters(params);
+//  argument_t arg(argument_t::indices_t(0,1), argument_t::types_t(0,1), c);
+//  CPPUNIT_ASSERT(
+//      Helpers::isEqual(
+//          0.,
+//          compound.derivative(
+//              FunctionModel::arguments_t(1,arg)
+//          )[0],
+//          1.e+6
+//      )
+//  );
+//}
+
+
+/** UnitTest for parameter_derivative()
+ */
+void CompoundPotentialTest::parameter_derivativeTest()
+{
+  CompoundPotential compound(*graph);
+  CompoundPotential::parameters_t params;
+  params += a,c,D,d;
+  compound.setParameters(params);
+  argument_t arg(argument_t::indices_t(0,1), argument_t::types_t(0,1), c);
+  CPPUNIT_ASSERT(
+      Helpers::isEqual(
+          0.,
+          compound.parameter_derivative(
+              FunctionModel::arguments_t(1,arg),
+              0
+          )[0],
+          1.e+6
+      )
+  );
+  CPPUNIT_ASSERT(
+      Helpers::isEqual(
+          0.,
+          compound.parameter_derivative(
+              FunctionModel::arguments_t(1,arg),
+              1
+          )[0],
+          1.e+6
+      )
+  );
+  CPPUNIT_ASSERT(
+      Helpers::isEqual(
+          0.,
+          compound.parameter_derivative(
+              FunctionModel::arguments_t(1,arg),
+              2
+          )[0],
+          1.e+6
+      )
+  );
+  CPPUNIT_ASSERT(
+      Helpers::isEqual(
+          1.,
+          compound.parameter_derivative(
+              FunctionModel::arguments_t(1,arg),
+              3
+          )[0],
+          1.e+6
+      )
+  );
+}
Index: src/Potentials/unittests/CompoundPotentialUnitTest.hpp
===================================================================
--- src/Potentials/unittests/CompoundPotentialUnitTest.hpp	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
+++ src/Potentials/unittests/CompoundPotentialUnitTest.hpp	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
@@ -0,0 +1,55 @@
+/*
+ * CompoundPotentialUnitTest.hpp
+ *
+ *  Created on: May 08, 2013
+ *      Author: heber
+ */
+
+#ifndef COMPOUNDPOTENTIALUNITTEST_HPP_
+#define COMPOUNDPOTENTIALUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "Fragmentation/Homology/FragmentEdge.hpp"
+#include "Fragmentation/Homology/FragmentNode.hpp"
+#include "Fragmentation/Homology/HomologyGraph.hpp"
+
+class CompoundPotential;
+
+/********************************************** Test classes **************************************/
+
+class CompoundPotentialTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( CompoundPotentialTest) ;
+    CPPUNIT_TEST ( operatorTest );
+//    CPPUNIT_TEST ( derivativeTest );
+    CPPUNIT_TEST ( parameter_derivativeTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void operatorTest();
+//      void derivativeTest();
+      void parameter_derivativeTest();
+
+private:
+      HomologyGraph *graph;
+      HomologyGraph::nodes_t nodes;
+      HomologyGraph::edges_t edges;
+      HomologyGraph::nodes_t othernodes;
+      HomologyGraph::edges_t otheredges;
+
+      typedef std::vector<double> data_t;
+      data_t input;
+      data_t output;
+      double a,c,d,D;
+};
+
+#endif /* COMPOUNDPOTENTIALUNITTEST_HPP_ */
Index: src/Potentials/unittests/Makefile.am
===================================================================
--- src/Potentials/unittests/Makefile.am	(revision 2bde72f96c32ee086640c592c1e1c843c1e21b8a)
+++ src/Potentials/unittests/Makefile.am	(revision 154e88d6d6cb3f0007aab8009f1e97262d02e3fa)
@@ -3,10 +3,13 @@
 
 POTENTIALSTESTSSOURCES = \
+	../Potentials/unittests/CompoundPotentialUnitTest.cpp \
 	../Potentials/unittests/SerializablePotentialUnitTest.cpp
 
 POTENTIALSTESTSHEADERS = \
+	../Potentials/unittests/CompoundPotentialUnitTest.hpp \
 	../Potentials/unittests/SerializablePotentialUnitTest.hpp
 
 POTENTIALSTESTS = \
+	CompoundPotentialUnitTest \
 	SerializablePotentialUnitTest
 
@@ -17,4 +20,18 @@
 POTENTIALSLIBS = \
 	../libMolecuilderPotentials.la \
+	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
+	${CodePatterns_LIBS} \
+  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
+	$(BOOST_LIB)
+
+CompoundPotentialUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../Potentials/unittests/CompoundPotentialUnitTest.cpp \
+	../Potentials/unittests/CompoundPotentialUnitTest.hpp
+CompoundPotentialUnitTest_LDADD = \
+	../libMolecuilderPotentials.la \
+	../libMolecuilderFragmentation.la \
+	../libMolecuilderFragmentationSummation.la \
+	../libMolecuilderFunctionApproximation.la \
+	../libMolecuilderFragmentation_getFromKeysetStub.la \
 	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
 	${CodePatterns_LIBS} \
