source: src/documentation/constructs/potentials.dox@ caece4

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since caece4 was caece4, checked in by Frederik Heber <heber@…>, 11 years ago

Enhanced documentation significantly.

  • went through all of the constructs and updated each.
  • enhanced documentation ofr Fragmentation::FragmentMolecule().
  • Property mode set to 100644
File size: 7.0 KB
Line 
1/*
2 * Project: MoleCuilder
3 * Description: creates and alters molecular systems
4 * Copyright (C) 2010 University of Bonn. All rights reserved.
5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
6 */
7
8/**
9 * \file potentials.dox
10 *
11 * Created on: Nov 28, 2012
12 * Author: heber
13 */
14
15/** \page potentials Empirical Potentials and FunctionModels
16 *
17 * On this page we explain what is meant with the Potentials sub folder.
18 *
19 * First, we are based on fragmenting a molecular system, i.e. dissecting its
20 * bond structure into connected subgraphs, calculating the energies of the
21 * fragments (ab-initio) and summing up to a good approximation of the total
22 * energy of the whole system, \sa fragmentation.
23 * Second, having calculated these energies, there quickly comes up the thought
24 * that one actually calculates quite similar systems all time and if one could
25 * not cache results in an intelligent (i.e. interpolating) fashion ...
26 *
27 * That's where so-called empirical potentials come into play. They are
28 * functions depending on a number of "fitted" parameters and the variable
29 * distances within a molecular fragment (i.e. the bond lengths) in order to
30 * give a value for the total energy without the need to solve a complex
31 * ab-initio model (essentially, not solving the electronic Schrödinger equation
32 * anymore).
33 *
34 * Empirical potentials have been thought of by fellows such as Lennard-Jones,
35 * Morse, Tersoff, Stillinger and Weber, etc. And in their honor, the
36 * potential form is named after its inventor. Hence, we speak e.g. of a
37 * Lennard-Jones potential.
38 *
39 * So, what we have to do in order to cache results is the following procedure:
40 * -# gather similar fragments
41 * -# perform a fit procedure to obtain the parameters for the empirical
42 * potential
43 * -# evaluate the potential instead of an ab-initio calculation
44 *
45 * The terms we use, model the classes that are implemented:
46 * -# EmpiricalPotential: Contains the interface to a function that can be
47 * evaluated given a number of arguments_t, i.e. distances. Also, one might
48 * want to evaluate derivatives.
49 * -# FunctionModel: Is a function that can be fitted, i.e. that has internal
50 * parameters to be set and got.
51 * -# argument_t: The Argument stores not only the distance but also the index
52 * pair of the associated atoms and also their charges, to let the potential
53 * check on validity.
54 * -# SerializablePotential: Eventually, one wants to store to or parse from
55 * a file all potential parameters. This functionality is encoded in this
56 * class.
57 * -# HomologyGraph: "Similar" fragments in our case have to have the same bond
58 * graph. It is stored in the HomologyGraph that acts as representative
59 * -# HomologyContainer: This container combines, in multimap fashion, all
60 * similar fragments with their energies together, with the HomologyGraph
61 * as their "key".
62 * -# TrainingData: Here, we combine InputVector and OutputVector that contain
63 * the set of distances required for the FunctionModel (e.g. only a single
64 * distance/argument for a pair potential, three for an angle potential,
65 * etc.) and also the expected OutputVector. This in combination with the
66 * FunctionModel is the basis for the non-linear regression used for the
67 * fitting procedure.
68 * -# Extractors: These set of functions yield the set of distances from a
69 * given fragment that is stored in the HomologyContainer.
70 * -# FunctionApproximation: Contains the interface to the levmar package where
71 * the Levenberg-Marquardt (Newton + Trust region) algorithm is used to
72 * perform the fit.
73 *
74 * \section potentials-howto-use Howto use the potentials
75 *
76 * We just give a brief run-down in terms of code on how to use the potentials.
77 * Here, we just describe what to do in order to perform the fitting. This is
78 * basically what is implemented in FragmentationFitPotentialAction.
79 *
80 * \code
81 * // we need the homology container and the representative graph we want to
82 * // fit to.
83 * HomologyContainer homologies;
84 * const HomologyGraph graph = getSomeGraph(homologies);
85 * Fragment::charges_t h2o;
86 * h2o += 8,1,1;
87 * // TrainingData needs so called Extractors to get the required distances
88 * // from the stored fragment. These functions are bound via boost::bind.
89 * TrainingData AngleData(
90 * boost::bind(&Extractors::gatherDistancesFromFragment,
91 * boost::bind(&Fragment::getPositions, _1),
92 * boost::bind(&Fragment::getCharges, _1),
93 * boost::cref(h2o),
94 * _2)
95 * );
96 * // now we extract the distances and energies and store them
97 * AngleData(homologies.getHomologousGraphs(graph));
98 * // give ParticleTypes of this potential to make it unique
99 * PairPotential_Angle::ParticleTypes_t types =
100 * boost::assign::list_of<PairPotential_Angle::ParticleType_t>
101 * (8)(1)(1)
102 * ;
103 * PairPotential_Angle angle(types);
104 * // give initial parameter
105 * FunctionModel::parameters_t params(PairPotential_Angle::MAXPARAMS, 0.);
106 * // ... set some potential-specific initial parameters in params struct
107 * angle.setParameters(params);
108 *
109 * // use the potential as a FunctionModel along with prepared TrainingData
110 * FunctionModel &model = angle;
111 * FunctionApproximation approximator(AngleData, model);
112 * approximator(FunctionApproximation::ParameterDerivative);
113 *
114 * // obtain resulting parameters and check remaining L_2 and L_max error
115 * angleparams = model.getParameters();
116 * LOG(1, "INFO: L2sum = " << AngleData(model)
117 * << ", LMax = " << AngleData(model) << ".");
118 * \endcode
119 *
120 * The evaluation of the fitted potential is then trivial, e.g.
121 * \code
122 * // constructed someplace
123 * PairPotential_Angle angle(...);
124 *
125 * // evaluate
126 * FunctionModel::arguments_t args;
127 * // .. initialise args to the desired distances
128 * const double value = angle(args)[0]; // output is a vector!
129 * \endcode
130 *
131 * \section potentials-stability-of-fit note in stability of fit
132 *
133 * As we always start from random initial parameters (within a certain sensible
134 * range at least), the non-linear fit does not always converge. For this case
135 * the FragmentationFitPotentialAction has the option "take-best-of" to allow
136 * for multiple fits where the best (in terms of l2 error) is taken eventually.
137 *
138 * \section potentials-howto-add Howto add new potentials
139 *
140 * Adding a new potential requires the following:
141 * -# Add the new modules to Potentials/Specifics
142 * -# Add a unit test on the potential in Potentials/Specifics/unittests
143 * -# Give the potential a type name and add it to PotentialTypes.def. Note
144 * that the name must not contain white space.
145 * -# Add the potential name as case to PotentialFactory such that it knows
146 * how to instantiate your new potential when requested.
147 *
148 * PotentialTypes.def contains a boost::preprocessor sequence of all
149 * potential names. PotentialFactory uses this sequence to build its enum to
150 * type map and inverse which the user sees when specifying the potential to
151 * fit via PotentialTypeValidator.
152 *
153 *
154 * \date 2013-04-09
155 */
Note: See TracBrowser for help on using the repository browser.