source: doc/userguide/userguide.xml@ 1ba51c

Action_Thermostats Add_AtomRandomPerturbation Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.1 ChangeBugEmailaddress ChemicalSpaceEvaluator EmpiricalPotential_contain_HomologyGraph_documentation Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph Fix_Verbose_Codepatterns ForceAnnealing_oldresults ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks StoppableMakroAction TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps
Last change on this file since 1ba51c was 1ba51c, checked in by Frederik Heber <frederik.heber@…>, 8 years ago

Updated userguide with lots of notes on using geometry object.

  • Property mode set to 100644
File size: 162.5 KB
Line 
1<?xml version='1.0' encoding='UTF-8'?>
2<!-- This document was created with Syntext Serna Free. --><!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
3<!ENTITY molecuilder_logo SYSTEM "pictures/molecuilder_logo.png" NDATA PNG>
4<!ENTITY dialog_box SYSTEM "pictures/dialog_box.png" NDATA PNG>
5<!ENTITY dialog_add-atom_tooltip SYSTEM "pictures/dialog_add-atom_tooltip.png" NDATA PNG>
6<!ENTITY dialog_complex SYSTEM "pictures/dialog_complex.png" NDATA PNG>
7<!ENTITY dialog_exit SYSTEM "pictures/dialog_exit.png" NDATA PNG>
8<!ENTITY example_basic_view SYSTEM "pictures/example_basic_view.png" NDATA PNG>
9]>
10<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:svg="http://www.w3.org/2000/svg" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook" version="5.0">
11 <info>
12 <title>MoleCuilder - a Molecule Builder</title>
13 <author>
14 <personname>
15 <firstname>Frederik</firstname>
16 <surname>Heber</surname>
17 </personname>
18 <affiliation>
19 <orgname>heber@ins.uni-bonn.de</orgname>
20 </affiliation>
21 </author>
22 <pubdate>07/03/14</pubdate>
23 </info>
24 <chapter>
25 <title>Introduction</title>
26 <figure>
27 <title>MoleCuilder logo depicting a tesselated buckyball and a benzene molecule</title>
28 <mediaobject>
29 <imageobject>
30 <imagedata width="100%" scalefit="1" entityref="molecuilder_logo"/>
31 </imageobject>
32 </mediaobject>
33 </figure>
34 <section xml:id="whatis">
35 <title xml:id="whatis.title">What is MoleCuilder?</title>
36 <para>In Short,<command> MoleCuilder</command> is a concatenation of
37 molecule and builder.</para>
38 <para>In more words, molecular dynamics simulations are frequently
39 employed to simulate material behavior under stress, chemical reactions
40 such as of cementitious materials, or folding pathways and docking
41 procedures of bio proteins. Even if the computational load, due to the
42 large number of atoms, is very demanding, nonetheless they may serve as
43 a starting point, e.g. extracting parameters for a coarser model.
44 However, what is on the other hand the starting point of molecular
45 dynamics simulations? It is the coordinate and element of each atom
46 combined with potential functions that model the interactions.</para>
47 <para>MoleCuilder allows to fully construct such a starting point:
48 letting the user construct atomic and molecular geometries by a simple
49 point&amp;click approach, a CAD-pendant on the nanoscale. Creating
50 suitable empirical potentials by fitting parameters to ab-initio
51 calculations within hours. Specific emphasis is placed on a
52 simple-to-use interface, allowing for the quick-and-dirty building of
53 molecular systems, and on scriptability. The last being important a eventually not a single, but
54 many, related molecular systems have to be created.</para>
55 <para>We hope you will enjoy using MoleCuilder as much as we had creating it and still continue extending it. It obtains its flexibility from the use of agile programming techniques and state-of-the-art libraries such as Boost. If you feel dissatiesfied with certain parts, please do not hesitate to give feedback (see below).</para>
56 <section xml:id="installation">
57 <title xml:id="installation.title">Installation requirements</title>
58 <para>For installations requirements and instructions we refer to the
59 internal documentation of MoleCuilder, created via <productname>doxygen</productname>. from the
60 source code.</para>
61 </section>
62 <section xml:id="license">
63 <title xml:id="license.title">License</title>
64 <para>As long as no other license statement is given, MoleCuilder is
65 free for user under the GNU Public License (GPL) Version 2 (see
66 <uri>www.gnu.de/documents/gpl-2.0.de.html</uri>).</para>
67 </section>
68 <section xml:id="disclaimer">
69 <title xml:id="disclaimer.title">Disclaimer</title>
70 <para>We quote section 11 from the GPLv2 license:</para>
71 <remark>Because the program is licensed free of charge, there is not warranty for the program, to the extent permitted by applicable law. Except when otherwise stated in writing in the copyright holders and/or other parties provide the program &quot;as is&quot; without warranty of any kind, either expressed or implied. Including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. Should the program prove defective, you assume the cost of all necessary servicing, repair, or correction.</remark>
72 </section>
73 <section xml:id="feedback">
74 <title xml:id="feedback.title">Feedback</title>
75 <para>If you encounter any bugs, errors, or would like to submit
76 feature request, please use the email address provided at the very
77 beginning of this user guide. The author is especially thankful for
78 any description of all related events prior to occurrence of the
79 error, saved &quot;session scripts&quot; (see below) and auxiliary files. Please
80 mind sensible space restrictions of email attachments.</para>
81 </section>
82 <section xml:id="notation">
83 <title xml:id="notation.title">Notation</title>
84 <para>We briefly explain a few specific wordings associated with the
85 program:</para>
86 <itemizedlist>
87 <listitem>
88 <para><emphasis>Action</emphasis> is a command that allows for
89 undoing and redoing, i.e. a single atomic procedure for
90 manipulating the molecular system. Here, atomic refers to indivisible and not to atoms. It is also referred to as a command.</para>
91 </listitem>
92 <listitem>
93 <para>Selection refers to a subsets from the set of instances of a
94 particular type, e.g. atoms, molecules, shapes, ...</para>
95 </listitem>
96 <listitem>
97 <para>Shape means a specific region of the domain that can be
98 described in the way of constructive geometry, i.e. as the
99 intersection, negation, and combination of primitives such as
100 spheres, cubes, or cylinders.</para>
101 </listitem>
102 <listitem>World refers to the whole of the molecular system, i.e. all
103 atoms with coordinates and element type (over all time steps), all
104 bonds between pairs of atoms, the size of the simulation domain.
105 This is also referred to as the state.</listitem>
106 <listitem>Time step is the current discrete position in time. Molecular
107 dynamics simulations are executed in discrete (but very small) time
108 steps. Each atom has a distinct position per time step. The discrete
109 positions over the discrete time steps samples its trajectory during a
110 simulation.</listitem>
111 </itemizedlist>
112 </section>
113 <section xml:id="completeness">
114 <title xml:id="completeness.title">Completeness</title>
115 <para>This documentation takes quite some effort to write. Hence, the
116 described features and especially the actions herein are settled with
117 respect to their functionality, while newer features or actions are
118 probably missing. This should be a clear sign to you that these are
119 probably not safe to use yet. If you nonetheless require them, you
120 should acquire some familiarity with the code itself. This suggests
121 changing to the developer documentation which is maintained along
122 with the source code with <productname>doxygen</productname>.
123 </para>
124 </section>
125 </section>
126 </chapter>
127 <chapter>
128 <title>Features</title>
129 <para>Basically, <command>MoleCuilder</command> parses geometries from
130 files, manipulates them, and stores them again in files. The manipulation
131 can be done either via a command-line interface or via the graphical user
132 interface.</para>
133 <section xml:id="concepts">
134 <title xml:id="concepts.title">Concepts</title>
135 <para>In general, we divide the molecular systems into three different
136 components or scales.</para>
137 <orderedlist>
138 <listitem>
139 <para>Atoms</para>
140 <para>Atoms are the undividable objects of the molecular systems.
141 They have at least an element <quote>Z</quote> and three coordinates
142 <quote>(x,y,z)</quote>.</para>
143 </listitem>
144 <listitem>
145 <para>Molecules</para>
146 <para>Molecules are bound conglomeration of atoms. They contain a
147 number of atoms, i.e. by beginning at an arbitrary atom of the molecule and traversing its bond graph eventually all of the molecule&apos;s atoms are visited. Currently, a bond refers to a covalent bonding between atoms. Also, molecules may have a
148 bounding box, i.e. a subdomain that contains all of the atoms in the
149 molecule.</para>
150 <para>Note that the molecular structure of the system, i.e. the
151 bonding graph, is determined by MoleCuilder and used to dissect the
152 system into distinct molecules on request.</para>
153 </listitem>
154 <listitem>
155 <para>Clusters</para>
156 <para>Clusters are unbound conglomeration of atoms. Clusters serves
157 as groups of atoms for specific operations that would be to
158 restricted if they worked on just molecules.</para>
159 </listitem>
160 <listitem>
161 <para>Domain</para>
162 <para>The domain refers to the simulation domain. It is the
163 parallelepiped in <inlineequation>
164 <m:math display="inline">
165 <m:mi>\mathbb{R}^3</m:mi>
166 </m:math>
167 </inlineequation>where either periodic, wrapped, or open boundary
168 conditions apply. The domain contains all atoms, i.e. the box
169 containing all atoms.</para>
170 </listitem>
171 </orderedlist>
172 </section>
173 <section xml:id="interfaces">
174 <title xml:id="interfaces.title">Interfaces</title>
175 <para>MoleCuilder has four different interfaces: Command-line, text
176 menu, graphical user interface, and python interface.</para>
177 <orderedlist>
178 <listitem>
179 <para>Command-Line</para>
180 <para>The command-line interface allows to use MoleCuilder
181 non-interactively via a terminal session. The program is executed by
182appending to the shell command a number of commands including all
183 required options that are then executed one after the other. After
184 execution of the last command, the program quits. The command-line
185 interface usually works on a specific file that is given as input,
186 manipulated, analysed, ... via the sequence of commands and
187 eventually all changes are stored in the this file. Hence, the input
188 file acts as the state of the starting configuration that is
189 modified via MoleCuilder.</para>
190 </listitem>
191 <listitem>
192 <para>Text menu</para>
193 <para>The text-menu is similar to the command-line interface with
194 the exception that it allows for interactive sessions. Commands are
195 chosen from a text menu and executed directly after selection by the
196 user.</para>
197 </listitem>
198 <listitem>
199 <para>Graphical interface</para>
200 <para>The graphical interface is based on Qt. It features a full graphical, three-dimensional
201representation of the simulation domain with atoms and
202 their bonds. It allows manipulation in point&amp;click fashion.
203 Commands are selected from pull-down menus and dialogs are used to
204 query the user for all required parameters to such a command.</para>
205 </listitem>
206 <listitem>
207 <para>Python interface</para>
208 <para>The last interface is accessible only within the python
209 programming language. MoleCuilder can be loaded as a module and its
210 commands can be executed with either the python interpreter
211 interactively or via python scripts non-interactively. Note that
212 this allows auxiliary calculations to be performed in pythons whose
213 results may be used as parameters in subsequent commands.</para>
214 </listitem>
215 </orderedlist>
216 </section>
217 <section xml:id="fileformats">
218 <title xml:id="fileformats.title">Known File formats</title>
219 <para>We briefly list the file formats MoleCuilder can parse and
220 store. We refer to external websites for more detailed information where appropriate.</para>
221 <itemizedlist>
222 <listitem>
223 <para>XYZ, <filename>.xyz</filename> (simplest of all formats,
224 line-wise element and three coordinates with two line header, number
225 of lines and a comment line)</para>
226 </listitem>
227 <listitem>
228 <para><link xlink:href="http://www.mpqc.org/">
229 <productname>MPQC </productname>
230 </link>, <filename>.in</filename></para>
231 </listitem>
232 <listitem>
233 <para><link xlink:href="http://www.pdb.org/">PDB</link>, <filename> .pdb</filename></para>
234 </listitem>
235 <listitem>
236 <para><productname>ESPACK</productname>, <filename>.conf</filename>
237 (electronic structure package by Institute for Numerical Simulation,
238 University of Bonn, code not in circulation)</para>
239 </listitem>
240 <listitem>
241 <para><link xlink:href="http://www.psicode.org/">
242 <productname>PSI4 </productname>
243 </link>, <filename>.psi</filename></para>
244 </listitem>
245 <listitem>
246 <para><link xlink:href="http://www.tremolo-x.org/">
247 <productname> TREMOLO</productname>
248 </link>, <filename>.data</filename></para>
249 </listitem>
250 <listitem>
251 <para>XML, <filename>.xml</filename> (XML as read by
252 <link xlink:href="http://www.scafacos.org/">ScaFaCoS</link>
253 project)</para>
254 </listitem>
255 </itemizedlist>
256 <para>These are identified via their suffixes and can be converted from
257 one into another (with possible loss of data outside of the intersection of
258 stored properties of the two involved file formats).</para>
259 </section>
260 </chapter>
261 <chapter>
262 <title>Interfaces</title>
263 <para>In this chapter, we explain the intention and use of the four
264 interfaces.</para>
265 <para>We will give the most extensive explanation of the command-line
266 interface, all subsequent interfaces are explained in highlighting their
267 differences with respect to the command-line interface. This is because
268 the command-line lends itself very well to representation in this textual
269 user guide. Although some images of the graphical interface are given
270 below, they would blow the size of the guide out of proportion.</para>
271 <para>In any case, you should make yourself familiar with at least one of
272 the interactive (text menu, GUI) and one of the non-interactive
273 (command-line, python) interfaces to use MoleCuilder to its full potential:
274 The interactive interface gives you the immediate feedback in constructing
275 &quot;synthesis&quot; (build) chains (of commands) for constructing your specific
276 molecular system in the computer. The non-interactive interface lends
277 itself to quick creation of related systems that differ only by specific
278 parameters you have modified in the script (command-line can be used in
279 shell scripts, python itself is a scripted language). Also, the
280 non-interactive interfaces are used for storing sessions which helps you
281 in documentation your experiments and later on understanding of what has
282 been actually created by the prescribed commands, i.e. debugging.</para>
283 <section xml:id="command-line-interface">
284 <title xml:id="command-line-interface.title">Command-line interface</title>
285 <para>The command-line interface reads options and commands from the
286 command line and executes them sequentially. This may be for example:
287 Open an empty file, add 2 hydrogen atoms and add 1 oxygen atom, recognize the bond graph, choose a
288 simulation box, fill the box with this given &quot;filler&quot; molecule, save the
289 file. This enables the use of MoleCuilder in simple script-files to
290 create a whole range of geometries that only differ in a few parameters
291 automatically.</para>
292 <para>Traditionally, <command>MoleCuilder</command> operates on a single
293 configuration file - the state - which may also store additional
294 information depending on the chosen file format such as parameters for
295 ab-initio computations. To some small extent <command>MoleCuilder</command> also allows manipulation of these paramters. An example for the above procedure is given
296 below:</para>
297 <programlisting>
298 ./molecuilder \
299 -i sample.xyz \
300 --add-atom H \
301 --domain-position &quot;0.,0.,0.&quot; \
302 ...
303 </programlisting>
304 <para>The first argument is the executable itself. Second, there is a
305 slew of arguments -- one per line split with a backslash telling the comman
306 shell that the line still continues -- consisting of the input action and
307 an arbitrarily named file <filename>sample.xyz</filename>, which may be
308 empty and whose file format is chosen by the given extension. The third
309 is the add-atom action following by an option that gives the position in
310 the domain where to add the &quot;H&quot;ydrogen atom. An action is always
311 introduced via a double hyphen and its full name (containing just
312 non-capital letters and hyphens) or a single hyphen and a single letter
313 for its shortform, such as <emphasis role="bold"> -a</emphasis> for adding an atom to the system. It is
314 followed by a fixed number of options. Most of these have default values
315 and in this do not have to be specified.</para>
316 <formalpara><title>Invalid values</title><para>Certain options accept only very specific input. For example, the option value associated with <emphasis role="bold">add-atom</emphasis></para>, i.e. the chemical element, can only be one of the chemical symbols that exist and not any arbitrary string. Each option value is checked on parsing the command-line. If any value is not valid, an error message is given and none of the actions is executed.</formalpara>
317 <formalpara>
318 <title>Shortforms of Actions</title>
319 <para>Note that not all action have shortforms and it is best practice
320 to have the full action name instead of its shortform to make the
321 command-line comprehendable to you in years to come.</para>
322 </formalpara>
323 <note>
324 <para>Note further that when placing a slew of commands in a script file
325 it is generally recommended to use the above formatting: One command
326 or option per line and each receives an extra tab for indentation.</para>
327 </note>
328 <section xml:id="preliminaries">
329 <title xml:id="preliminaries.title">Preliminaries</title>
330 <para>Some preliminary remarks are in order which we have gathered
331 here on how these actions work in general.</para>
332 <para>We first delve into some details about secondary structure
333 such as selections, shapes, and randomization required to specify
334 subsets of atoms and molecules you wish to manipulate. Then, we have
335give the details on the manipulation ordered by the
336 scale they act upon - single atoms, multiple atoms organized as
337 molecules, and all atoms organized by their containing domain.</para>
338 <para>In the following we will always give a command to illustrate the
339 procedure but just its necessary parts, i.e. &quot;...&quot; implies to prepend
340 it with the executable and input command for a specific configuration
341 file, for storing the manipulated state of the molecular system. </para>
342 <para>So if we write</para>
343 <programlisting>... --help</programlisting>
344 <para>Then we actually mean you to write</para>
345 <programlisting>./molecuilder --help</programlisting>
346 <para>Note that this specific exemplary command is very useful as it will always give you a list of all available actions and also a
347 brief explanation on how to properly enter values of a specific type,
348 e.g. an element, a vector, or a list of numbers. Details to a specific
349 action can be requested when its full name is known, e.g. for
350 &quot;add-atom&quot;,</para>
351 <programlisting>./molecuilder --help add-atom</programlisting>
352 <para>which fills you in on each option to the action: its full name,
353 its expected type, and a possibly present default value, and a brief
354 description of the option.</para>
355 <para>An Action can be undone and redone, e.g. undo adding an atom as
356 follows,</para>
357 <programlisting>... --add-atom H --domain-position &quot;0,0,0&quot; --undo</programlisting>
358 <para>and redo as follows</para>
359 <programlisting>... --add-atom H --domain-position &quot;0,0,0&quot; --undo --redo</programlisting>
360 <para>With the non-interactive interfaces this may seem rather
361 superfluous but it comes in very handy in the interactive ones. Also
362 this should tell you that actions are placed internally in a queue, i.e. a history,
363 that undo and redo manipulate.</para>
364 <para>Due to a current limitation of the implementation each command can be used on the command-line only once. Note that this <emphasis role="italic">only</emphasis> applies to the command-line interface. All other interfaces, especially all interactive ones, do not have such a restriction. For the command-line interface there are several ways to work around it. Either by splitting the whole chain of commands into several chunks, each using only unique commands and using the input file (the state) to contain and transport the intermediate stages as input for the next stage. Or to switch to other commands: often there are several possible ways of achieving a goal, especially when using selections.</para>
365 <para>Being done now with the preliminaries we now go through all available actions present in MoleCuilder.</para>
366 </section>
367 <section xml:id="fileparsers">
368 <title xml:id="fileparsers.title">File parsers</title>
369 <para>We have already given a list of all known file formats, see
370 <link linkend="fileformats">File formats</link>. Next, we explain how these
371 file formats are picked and manipulated.</para>
372 <section xml:id="fileparsers.parsing">
373 <title xml:id="fileparsers.parsing.title">Parsing files</title>
374 <para>We already discussed that the command-line interface works
375 state-based and hence you should supply it with a file to work
376 on.</para>
377 <programlisting>... --input water.data</programlisting>
378 <para>This will load all information, especially atoms with their
379 element and position, from the file <filename>water.data</filename>
380 into the state. Most importantly, all changes will eventually be stored to this file,
381 or to files with the prefix <filename>water</filename> and suffixes
382 of desired file formats, e.g. <filename>water.in</filename> if you
383 specified <productname>MPQC</productname>.</para>
384 <programlisting>... --load morewater.xyz</programlisting>
385 <para>This will load another file <filename>water.xyz</filename>,
386 however changes will still be written to files prefixed with
387 <filename>water</filename> as designated by the <emphasis role="bold">input</emphasis> command. Note that now already two state files
388 will stored, <filename>water.data</filename> and
389 <filename>water.xyz</filename> as these two different file formats
390 have been used. This is the default behavior: any additional file format used in loading is registered internally and the output file will then be written in all registered formats on exit.</para>
391 </section>
392 <section xml:id="fileparsers.set-output">
393 <title xml:id="fileparsers.set-output.tile">Adding output file formats</title>
394 <para>We already know that loading a file also picks a file format
395 by its suffix. We may add further file formats to which the state of
396 the molecular system is written to on program exit.</para>
397 <programlisting>... --set-output mpqc tremolo</programlisting>
398 <para>This will store the final state of the molecular systems as
399 <productname>MPQC</productname> and as
400 <productname>TREMOLO</productname> configuration file. See
401 <link linkend="fileformats">File formats</link> for the list of all file formats available.</para>
402 </section>
403 <section xml:id="fileparsers.output-as">
404 <title xml:id="fileparsers.output-as.title">Output the World</title>
405 <para>This will store the current World, i.e. all its atoms, to a
406 given file, where the output format is determined from the file
407 suffix.</para>
408 <programlisting>... --output-as world.xyz</programlisting>
409 <para>This will be automatically done on program exit, but in case an intermediate state is required (making sense for interactive and python interfaces), this command can be used.</para>
410 </section>
411 <section xml:id="fileparsers.save-selected-molecules">
412 <title xml:id="fileparsers.save-selected-molecules.title">Output the current molecular system</title>
413 <para>This will store all atoms contained in the currently selected
414 molecules to file. This is different to<emphasis role="bold">store-saturated-fragment</emphasis>
415 as it will not saturate dangling bonds because only whole molecules,
416 i.e. whose bond graph is connected, will be stored.</para>
417 <programlisting>... --save-selected-molecules waters.pdb
418 </programlisting>
419 </section>
420 </section>
421 <section xml:id="selections">
422 <title xml:id="selections.title">Selections and unselections</title>
423 <para>In order to tell MoleCuilder on what subset of atoms a specific
424 Action is to be performed, there are <emphasis>selection actions</emphasis>. Note that a selection per se does not change
425 anything in the state of the molecular system in any way. Essentially, it is just a filter.</para>
426 <para>Selections either work on atoms, on molecules, or on shapes
427 (this we explain later on). A given selection is maintained from the
428 execution of the selection action to the end of program or until
429 modified by another selection applied on the same type (atom,
430 molecule, shape). Selections are not stored to file (i.e. do not belong to the state).</para>
431 <para>We only give here a brief list on the available kind of selections for each of the three types they work on.
432Each action is executed either as follows, exemplified by selecting
433 all atoms.</para>
434 <programlisting>.... --select-all-atoms</programlisting>
435 <para>or, exemplified by unselecting the last molecule,</para>
436 <programlisting>... --unselect-molecule-by-order -1</programlisting>
437 <para>i.e. they are prepended by either <emphasis role="bold">select</emphasis> or <emphasis role="bold">unselect</emphasis>.</para>
438 <itemizedlist>
439 <listitem>
440 <para>Atoms</para>
441 <itemizedlist>
442 <listitem>
443 <para>All</para>
444 <programlisting>
445 ... --select-all-atoms
446 </programlisting>
447 </listitem>
448 <listitem>
449 <para>None</para>
450 <programlisting>
451 ... --unselect-all-atoms
452 </programlisting>
453 <programlisting>
454 ... --clear-atom-selection
455 </programlisting>
456 </listitem>
457 <listitem>
458 <para>Invert selection</para>
459 <programlisting>
460 ... --invert-atoms
461 </programlisting>
462 </listitem>
463 <listitem>
464 <para>By Element (all hydrogen atoms, all sulphur atoms,
465 ...)</para>
466 <programlisting>
467 ... --select-atom-by-element 1
468 </programlisting>
469 <programlisting>
470 ... --unselect-atom-by-element 1
471 </programlisting>
472 </listitem>
473 <listitem>
474 <para>By Id (atom with id 76)</para>
475 <programlisting>
476 ... --select-atom-by-id 76
477 </programlisting>
478 <programlisting>
479 ... --unselect-atom-by-id 76
480 </programlisting>
481 </listitem>
482 <listitem>
483 <para>By Order (the first (1), the second, ... the last
484 created(-1), the last but one)</para>
485 <programlisting>
486 ... --select-atom-by-order 1
487 </programlisting>
488 <programlisting>
489 ... --unselect-atom-by-order -2
490 </programlisting>
491 </listitem>
492 <listitem>
493 <para>By Shape (all atoms inside the volume specified by the currently selected shape)</para>
494 <programlisting>
495 ... --select-atom-inside-volume
496 </programlisting>
497 <programlisting>
498 ... --unselect-atoms-inside-volume
499 </programlisting>
500 </listitem>
501 <listitem>
502 <para>By Molecule (all atoms belonging to currently selected
503 molecules)</para>
504 <programlisting>
505 ... --select-molecules-atoms
506 </programlisting>
507 <programlisting>
508 ... --unselect-molecules-atoms
509 </programlisting>
510 </listitem>
511 <listitem>
512 <para>Push/Pop the current selection to/from a stack to store
513 it momentarily and allow modifications in MakroActions (this is very specific and used mostly internally).</para>
514 <programlisting>
515 ... --push-atom-selection
516 </programlisting>
517 <programlisting>
518 ... --pop-atom-selection
519 </programlisting>
520 </listitem>
521 </itemizedlist>
522 </listitem>
523 <listitem>
524 <para>Molecules</para>
525 <itemizedlist>
526 <listitem>
527 <para>All</para>
528 <programlisting>
529 ... --select-all-molecules
530 </programlisting>
531 </listitem>
532 <listitem>
533 <para>None</para>
534 <programlisting>
535 ... --unselect-all-molecules
536 </programlisting>
537 <programlisting>
538 ... --clear-molecule-selection
539 </programlisting>
540 </listitem>
541 <listitem>
542 <para>Invert selection</para>
543 <programlisting>
544 ... --invert-molecules
545 </programlisting>
546 </listitem>
547 <listitem>
548 <para>By Id (molecule with id 4)</para>
549 <programlisting>
550 ... --select-molecule-by-id 2
551 </programlisting>
552 <programlisting>
553 ... --unselect-molecule-by-id 2
554 </programlisting>
555 </listitem>
556 <listitem>
557 <para>By Order (first created molecule, second created
558 molecule, ...)</para>
559 <programlisting>
560 ... --select-molecule-by-order 2
561 </programlisting>
562 <programlisting>
563 ... --unselect-molecule-by-order -2
564 </programlisting>
565 </listitem>
566 <listitem>
567 <para>By Formula (molecule with H2O as formula)</para>
568 <programlisting>
569 ... --select-molecules-by-formula &quot;H2O&quot;
570 </programlisting>
571 <programlisting>
572 ... --unselect-molecules-by-formula &quot;H2O&quot;
573 </programlisting>
574 </listitem>
575 <listitem>
576 <para>By Name (all molecules named &quot;water4&quot;)</para>
577 <programlisting>
578 ... --select-molecules-by-name &quot;water4&quot;
579 </programlisting>
580 <programlisting>
581 ... --unselect-molecules-by-name &quot;water4&quot;
582 </programlisting>
583 </listitem>
584 <listitem>
585 <para>By Atom (all molecules for which at least one atom is
586 currently selected)</para>
587 <programlisting>
588 ... --select-atoms-molecules
589 </programlisting>
590 <programlisting>
591 ... --unselect-atoms-molecules
592 </programlisting>
593 </listitem>
594 <listitem>
595 <para>Push/Pop the current selection to/from a stack to store
596 it momentarily and allow modifications in MakroActions.</para>
597 <programlisting>
598 ... --push-molecule-selection
599 </programlisting>
600 <programlisting>
601 ... --pop-molecule-selection
602 </programlisting>
603 </listitem>
604 </itemizedlist>
605 </listitem>
606 <listitem>
607 <para>Shapes</para>
608 <itemizedlist>
609 <listitem>
610 <para>All</para>
611 <programlisting>
612 ... --select-all-shapes
613 </programlisting>
614 </listitem>
615 <listitem>
616 <para>None</para>
617 <programlisting>
618 ... --unselect-all-shapes
619 </programlisting>
620 </listitem>
621 <listitem>
622 <para>By Name (all shapes named &quot;sphere1&quot;)</para>
623 <programlisting>
624 ... --select-shape-by-name &quot;sphere1&quot;
625 </programlisting>
626 <programlisting>
627 ... --unselect-shape-by-name &quot;sphere1&quot;
628 </programlisting>
629 </listitem>
630 </itemizedlist>
631 </listitem>
632 </itemizedlist>
633 <remark>Note that an unselected instance (e.g. an atom) remains unselected upon further unselection and vice versa with selection.</remark>
634 <para>These above selections work then in conjunction with other
635 actions and make them very powerful, e.g. you can remove all atoms
636 inside a sphere by a selecting the spherical shape and subsequently
637 selecting all atoms inside the shape and then removing them.</para>
638 </section>
639 <section xml:id="shapes">
640 <title xml:id="shapes.title">Shapes</title>
641 <para>Shapes are specific regions of the domain. There are just a few
642 so-called <emphasis>primitive</emphasis> shapes such as cuboid,
643 sphere, cylinder, the whole domain, or none of it. However, these can be
644 combined via boolean operations such as and, or, and not. This
645 approach is called <emphasis>constructive geometry</emphasis>. E.g. by
646 combining a sphere with the negated (<emphasis role="italic">not</emphasis> operation) of a smaller sphere, we
647 obtain a spherical surface of specific thickness.</para>
648 <section xml:id="shapes.create-shape">
649 <title xml:id="shapes.create-shape.title">Creating shapes</title>
650 <para>Primitive shapes can be created as follows,</para>
651 <programlisting>
652 ... --create-shape \
653 --shape-type sphere \
654 --shape-name &quot;sphere1&quot; \
655 --stretch &quot;2,2,2&quot; \
656 --translation &quot;5,5,5&quot;
657 </programlisting>
658 <para>This will create a sphere of radius 2 (initial radius is 1)
659 with name &quot;sphere1&quot; that is centered at (5,5,5). Other primitives are
660 cuboid and cylinder, where a rotation can be specified as
661 follows.</para>
662 <programlisting><programlisting>
663 ... --create-shape \
664 --shape-type cuboid \
665 --shape-name &quot;box&quot; \
666 --stretch &quot;1,2,2&quot; \
667 --translation &quot;5,5,5&quot; \
668 --angle-x &quot;90&quot;
669 </programlisting>
670 ... --create-shape \
671 --shape-type cylinder \
672 --shape-name &quot;cylinder&quot; \
673 --stretch &quot;1,2,2&quot; \
674 --translation &quot;5,5,5&quot; \
675 --angle-y &quot;90&quot;
676 </programlisting>
677 </section>
678 <section xml:id="shapes.combine-shapes">
679 <title xml:id="shapes.combine-shapes.title">Combining shapes</title>
680 <para>Any two shapes can be combined by boolean operations as follows</para>
681 <programlisting>
682 ... --combine-shapes \
683 --shape-name &quot;combinedshape&quot; \
684 --shape-op &quot;AND&quot;
685 </programlisting>
686 <para>This will combine two currently selected shapes vis the &quot;AND&quot; operation
687 and create a new shape called &quot;combinedshape&quot;. Note that the two old shapes
688 are still present after this operation. We briefly explain each operation:
689 </para>
690 <itemizedlist>
691 <listitem>
692 <para><emphasis>AND</emphasis> combines two currently selected shapes
693 into a new shape that consists of only the volume where shapes overlap.</para>
694 </listitem>
695 <listitem>
696 <para><emphasis>OR</emphasis> combines two currently selected shapes
697 into a new shape that consists of all the volume that either shape
698 occupies.</para>
699 </listitem>
700 <listitem>
701 <para><emphasis>NOT</emphasis> creates the inverse to a currently selected
702 single shape that contains the volume with respect to the simulation domain
703 that the present one does not.</para>
704 </listitem>
705 </itemizedlist>
706 </section>
707 <section xml:id="shapes.remove-shape">
708 <title xml:id="shapes.remove-shape.title">Removing shapes</title>
709 <para>Removing a shape is as simple as removing an atom.</para>
710 <programlisting>... --remove-shape </programlisting>
711 <para>This removes all currently selected shapes.</para>
712 </section>
713 <section xml:id="shapes.manipulation">
714 <title xml:id="shapes.manipulation.title">Manipulating shapes</title>
715 <para>Shapes can be stretched, scaled, rotated, and translated to
716 modify primitives or combined primitive shapes. As you have seen
717 this manipulation could have occurred already at creation but we may also
718do it later on. As usual, we just list examples of the various manipulations
719 below, each of them works on the currently selected shapes.</para>
720 <programlisting>
721 ... --stretch-shapes &quot;1,1,2&quot; \
722 --stretch-center &quot;5,5,5&quot;
723 </programlisting>
724 <para>This stretches the shapes relative to the center at (5,5,5)
725 (default is origin) by a factor of 2 in the z direction.</para>
726 <programlisting>
727 ... --rotate-shapes \
728 --center &quot;10,2,2&quot; \
729 --angle-x 90 \
730 --angle-y 0 \
731 --angle-z 0
732 </programlisting>
733 <para>This way all selected shapes are rotated by 90 degrees around
734 the x axis with respect to the center at (10,2,2).</para>
735 <programlisting>... --translate-shapes &quot;5,0,0&quot; </programlisting>
736 <para>This translates all selected shapes by 5 along the x
737 axis.</para>
738 </section>
739 </section>
740 <section xml:id="geometry">
741 <title xml:id="geometry.title">Geometry Objects</title>
742 <para>Although we use the term geometry objects in the title, we
743 actually mean vectors, i.e. a position or direction in the
744 three-dimensional space. But maybe we have need for the more
745 general term in the future.</para>
746 <para>Vectors are required as input to many of the Actions further
747 below: translating atoms, rotating atoms around a specific axis,
748 aligning a molecule with a vector, ...</para>
749 <para>Therefore, vectors can be stored and referenced using a given
750 name. This allows for a very powerful and handy manipulation of the
751 molecular system afterwards. And to give a concrete example, let's have
752 a look at translating a set of selected atoms, see subsection on
753 <link linkend='atoms.translate-atom'>Translating atoms</link>. </para>
754 <programlisting>
755... --translate-atoms &quot;unitVectorX&quot;
756 </programlisting>
757 <para>This would use the automatically created reference
758 &quot;unitVectorX&quot;, i.e. the vector with components (1,0,0) as
759 the translation vector for the given set of atoms. In other words, all
760 selected atoms get shifted by 1 unit (e.g. Angstr&ouml;m) in +X
761 direction.</para>
762 <para>We have the following automatically created geometry objects
763 whose names are self-explanatory:</para>
764 <itemizedlist>
765 <listitem>zeroVector</listitem>
766 <listitem>unitVectorX</listitem>
767 <listitem>unitVectorY</listitem>
768 <listitem>unitVectorZ</listitem>
769 </itemizedlist>
770 <para>However, more vectors can be simply constructed from atomic
771 positions, such as the position of an atom directly, the distance between
772 two atoms (in case they are bonded, then this would be the bond vector)
773 or from three atoms, defining a plane and giving its normal vector.
774 </para>
775 <remark>We have refrained from giving automated names to vectors and even
776 keeping them up-to-date automatically, i.e. the distance between two atoms
777 O1 and O2 could be named &quot;distance_O1_O2&quot; or similar. However, we want
778 the user to have full control and maybe come up with more suitable names
779 such as &quot;rotation_axis&quot; in this case.</remark>
780 <warning>Note that names have to be unique and the Action will fail if
781 the name is already used.</warning>
782 <section xml:id="geometry.distance-to.vector">
783 <title xml:id="geometry.distance-to-vector.title">Atomic distance to stored vector</title>
784 <para>The distance between two selected atoms is stored as a vector as follows,</para>
785 <programlisting>
786 ... --distance-to-vector &quot;distance_vec&quot; \
787 </programlisting>
788 <para>where the distance vector can be referenced by &quot;distance_vec&quot;
789 from then on in other Actions requiring a vector as input.</para>
790 </section>
791 <section xml:id="geometry.input-to.vector">
792 <title xml:id="geometry.input-to-vector.title">Coordinates to stored vector</title>
793 <para>We may also create a geometry vector simply by supplying the
794 three coordinates of a vector.</para>
795 <programlisting>
796 ... --input-to-vector &quot;vector&quot; \
797 --position &quot;1,2,3&quot;
798 </programlisting>
799 <para>where the vector with components (1,2,3) can be referenced
800 by &quot;vector&quot; .</para>
801 </section>
802 <section xml:id="geometry.plane-to.vector">
803 <title xml:id="geometry.plane-to-vector.title">Normal of plane to stored vector</title>
804 <para>Three positions in space (if they are not linear dependent)
805 define a plane in three-dimensional space.</para>
806 <para>Therefore, when exactly three atoms are selected, this Action
807 will construct the resulting plane and store its normal vector as a
808 geometry object for later reference.</para>
809 <programlisting>
810 ... --plane-to-vector &quot;planenormal&quot; \
811 </programlisting>
812 <para>where the plane's normal vector can be referenced by
813 &quot;planenormal&quot;.</para>
814 </section>
815 <section xml:id="geometry.position-to.vector">
816 <title xml:id="geometry.position-to-vector.title">Atomic position to stored vector</title>
817 <para>Storing the position of a singly selected atom as a vector is simply done as follows,</para>
818 <programlisting>
819 ... --position-to-vector &quot;vector_O1&quot; \
820 </programlisting>
821 <para>where the vector can be referenced by &quot;vector_O1&quot;
822 from then on.</para>
823 </section>
824 </section>
825 <section xml:id="randomization">
826 <title xml:id="randomization.title">Randomization</title>
827 <para>Some operations require randomness as input, e.g. when filling a
828 domain with molecules these may be randomly translated and rotated.
829 Random values are obtained by a random number generator that consists
830 of two parts: engine and distribution. The engine yields a <emphasis role="italic">uniform</emphasis> set
831 of random numbers in a specific interval, the distribution modifies
832 them, e.g. to become gaussian.</para>
833 <para>There are several Actions to modify the specific engine and
834 distribution and their parameters. One example usage is that with the
835 aforementioned filling of the domain (see below) molecules are rotated randomly.
836 If you specify a random number generator that randomly just spills out
837 values 0,1,2,3, then the randomness is just the orientation of the
838 molecule with respect to a specific axis: x,y,z. (rotation is at most
839 360 degrees and 0,1,2,3 act as divisor, hence rotation angle will then be always
840 a multiple of 90 degrees).</para>
841 <programlisting>
842 ... --set-random-number-distribution &quot;uniform_int&quot; \
843 --random-number-distribution-parameters &quot;p=1&quot;
844 </programlisting>
845 <para>This changes the distribution to &quot;uniform_int&quot;, i.e. integer
846 numbers that are distributed uniformly.</para>
847 <programlisting>
848 ... --set-random-number-engine &quot;mt19937&quot; \
849 --random-numner-engine-parameters &quot;seed=10&quot;
850 </programlisting>
851 <para>Specifying the seed allows you to obtain the same sequence of
852 random numbers for testing purposes.</para>
853 </section>
854 <section xml:id="atoms">
855 <title xml:id="atoms.title">Manipulate atoms</title>
856 <para>Here, we explain in detail how to add, remove atoms, change its
857 element type, scale the bond in between or measure the bond length or
858 angle.</para>
859 <section xml:id="atoms.add-atom">
860 <title xml:id="atoms.add-atom.title">Adding atoms</title>
861 <para>Adding an atom to the domain requires the element of the atom
862 and its coordinates as follows,</para>
863 <programlisting>
864 ... --add-atom O \
865 --domain-position &quot;2.,3.,2.35&quot;
866 </programlisting>
867 <para>where the element is given via its chemical symbol and the
868 vector gives the position within the domain</para>
869 <para>Note that instead of giving an explicit vector you may also use
870 a vector stored as a geometry object, see section
871 <link linkend='geometry'>Geometry</link>.</para>
872 </section>
873 <section xml:id="atoms.remove-atom">
874 <title xml:id="atoms.remove-atom.title">Removing atoms</title>
875 <para>Removing atom(s) does not need any option and operates on the
876 currently selected ones.</para>
877 <programlisting>... --remove-atom</programlisting>
878 </section>
879 <section xml:id="atoms.saturate-atom">
880 <title xml:id="atoms.saturate-atom.title">Saturating atoms</title>
881 <para>Newly instantiated atoms have no bonds to any other atom. If
882 you want to fill up their valence by a slew of hydrogen atoms
883 residing on a sphere around this atom, use this action.</para>
884 <programlisting>
885 ... --saturate-atoms
886 </programlisting>
887 <para>A number of hydrogen atoms is added around each selected atom
888 corresponding to the valence of the chemical element. The hydrogen
889 atoms are placed in the same distance to this atom and approximately
890 with same distance to their nearest neighbors. Already present bonds
891 (i.e. the position of neighboring atoms) is taken into account.</para>
892 </section>
893 <section xml:id="atoms.translate-atom">
894 <title xml:id="atoms.translate-atom.title">Translating atoms</title>
895 <para>In order to translate the current selected subset of atoms you
896have to specify a translation vector.</para>
897 <programlisting>
898 ... --translate-atoms &quot;-1,0,0&quot; \
899 --periodic 0
900 </programlisting>
901 <para>This translates all atoms by &quot;-1&quot; along the x axis and does not
902 mind the boundary conditions, i.e. it might shift atoms outside of the
903 domain.</para>
904 <para>Again, note that instead of giving an explicit vector you may
905 also use a vector stored as a geometry object, see section
906 <link linkend='geometry'>Geometry</link>.</para>
907 </section>
908 <section xml:id="atoms.mirror-atoms">
909 <title xml:id="atoms.mirror-atoms.title">Mirroring atoms</title>
910 <para>Present (and selected) atoms can be mirrored with respect to
911 a certain plane. You have to specify the normal vector of the plane
912 and the offset with respect to the origin as follows</para>
913 <programlisting>
914 ... --mirror-atoms &quot;1,0,0&quot; \
915 --plane-offset 10.1 \
916 --periodic 0
917 </programlisting>
918 <para>And of course instead of giving an explicit vector you may also
919 use a vector stored as a geometry object, see section
920 <link linkend='geometry'>Geometry</link>.</para>
921 </section>
922 <section xml:id="atoms.translate-to-origin">
923 <title xml:id="atoms.translate-to-origin.title">Translating atoms to origin</title>
924 <para>The following Action is convenient to place a subset of atoms
925 at a known position, the origin, and then translate them to some other
926 absolute coordinate. It calculates the average position of the set
927 of selected atoms and then translates all atoms by the negative of
928 this center, i.e. the center over all selected atoms is afterwards at the origin.</para>
929 <programlisting>... --translate-to-origin</programlisting>
930 <para>Note that this naturally does not heed the boundary conditions of the simulation domain.</para>
931 </section>
932 <section xml:id="atoms.change-element">
933 <title xml:id="atoms.change-element.title">Changing an atoms element </title>
934 <para>You can easily turn lead or silver into gold, by selecting the
935 silver atom and calling the change element action.</para>
936 <programlisting>... --change-element Au</programlisting>
937 </section>
938 </section>
939 <section xml:id="bond">
940 <title xml:id="bond.title">Bond-related manipulation</title>
941 <para>Atoms can also be manipulated with respect to the bonds.
942 <remark>Note that with bonds we always mean covalent bonds.</remark> First, we explain how to modify the bond structure itself, then we go
943 in the details of using the bond information to change bond distance
944 and angles.</para>
945 <section xml:id="bond.create-adjacency">
946 <title xml:id="bond.create-adjacency.title">Creating a bond graph </title>
947 <para>In case you have loaded a configuration file with no bond
948 information, e.g. XYZ, it is necessary to create the bond graph.
949 This is done by a heuristic distance criterion.</para>
950 <programlisting>... --create-adjacency</programlisting>
951 <para>This uses by default a criterion based on van-der-Waals radii,
952 i.e. if we look at two atoms indexed by &quot;a&quot; and &quot;b&quot;</para>
953 <equation>
954 <title>V(a) + V(b) - \tau &lt; R_{ab} &lt; V(a) + V(b) + \tau</title>
955 <m:math display="block">
956 <m:mi>where V(.) is the lookup table for the radii for a given element and \tau is a threshold value, set to 0.4.</m:mi>
957 </m:math>
958 </equation>
959 <para>As a second option, you may load a file containing bond table
960 information.</para>
961 <programlisting>... --bond-table table.dat</programlisting>
962 <para>which would parse a file <filename>table.dat</filename> for a
963 table giving typical bond distances between elements a and b. These
964 are used in the above criterion as <inlineequation>
965 <m:math display="inline">
966 <m:mi>V(a,b)</m:mi>
967 </m:math>
968 </inlineequation> in place of <inlineequation>
969 <m:math display="inline">
970 <m:mi>V(a)+V(b)</m:mi>
971 </m:math>
972 </inlineequation>.</para>
973 </section>
974 <section xml:id="bond.destroy-adjacency">
975 <title xml:id="bond.destroy-adjacency.title">Destroying the bond graph</title>
976 <para>The bond graph can be removed completely (and all bonds along
977 with it).</para>
978 <programlisting>... --destroy-adjacency</programlisting>
979 </section>
980 <section xml:id="bond.correct-bonddegree">
981 <title xml:id="bond.correct-bonddegree.title">Correcting bond degrees</title>
982 <para>Typically, after loading an input file with bond information, e.g.
983 a PDB file, the bond graph is complete but we lack the weights. That
984 is we do not know whether a bond is single, double, triple, ...
985 This action corrects the bond degree by enforcing charge neutrality
986 among the connected atoms.
987 </para>
988 <para>This action is in fact quadratically scaling in the number of
989 atoms. Hence, for large systems this may take longer than expected.
990 </para>
991 <programlisting>... --correct-bonddegree</programlisting>
992 <para>However, in normal use scenarios the action is fast and linear scaling.</para>
993 </section>
994 <section xml:id="bond.depth-first-search">
995 <title xml:id="bond.depth-first-search.title">Analysing a bond graph</title>
996 <para>You can perform a depth-first search analysis that reveals
997 cycles and other graph-related information.</para>
998 <programlisting>... --depth-first-search</programlisting>
999 <para>Note that this will only print some information and has no other impact on the state.</para>
1000 </section>
1001 <section xml:id="bond.subgraph-dissection">
1002 <title xml:id="bond.subgraph-dissection.title">Dissecting the molecular system into molecules</title>
1003 <para>The bond graph information can be used to recognize the
1004 molecules within the system. Imagine you have just loaded a PDB file
1005 containing bond information. However, initially all atoms are dumped
1006 into the same molecule. Before you can start manipulating, you need
1007 to dissect the system into individual molecules. Note that this is
1008 just structural information and does not change the state of the
1009 system.</para>
1010 <programlisting>... --subgraph-dissection</programlisting>
1011 <para>This analyses the bond graph, removes all currently present molecules and creates new molecules that each contain a single connected
1012 subgraph, hence the naming of the Action.</para>
1013 </section>
1014 <section xml:id="bond.update-molecules">
1015 <title xml:id="bond.update-molecules.title">Updating molecule structure</title>
1016 <para>When the bond information has changed, new molecules might
1017 have formed, this action updates all the molecules by scanning
1018 the connectedness of the bond graph of the molecular system.
1019 </para>
1020 <programlisting>... --update-molecules</programlisting>
1021 </section>
1022 <section xml:id="bond.adds-bond">
1023 <title xml:id="bond.adds-bond.title">Adding a bond manually</title>
1024 <para>When the automatically created adjacency or bond graph
1025 contains faulty bonds or lacks some, you can add them manually.
1026 </para>
1027 <programlisting>... --add-bonds</programlisting>
1028 <para>If two atoms are selected, the single bond in between is added, if not
1029already present. If more than two atoms are selected, than the
1030 bond between any pair of these is added.</para>
1031 <note>
1032 <para>This is especially useful in conjunction with the
1033 fragmentation scheme (explained later on). If you want to know the contribution from
1034 certain fragments whose subgraph is not connected, you can simply
1035 make the associated subset of atoms connected by selecting all
1036 bonds and adding the bonds.</para>
1037 </note>
1038 </section>
1039 <section xml:id="bond.remove-bonds">
1040 <title xml:id="bond.remove-bonds.title">Removing a bond manually </title>
1041 <para>In much the same way as adding a bond, you can also remove a
1042 bond.</para>
1043 <programlisting>... --remove-bonds</programlisting>
1044 <para>Similarly, if more than two atoms are selected, then all bonds
1045 found between any pair of these is removed.</para>
1046 </section>
1047 <section xml:id="bond.set-bond-degree">
1048 <title xml:id="bond.set-bond-degree.title">Setting the bond degree manually </title>
1049 <para>The bond degrees are usually automatically set to fulfill the
1050 valency constraints of each bond partner. However, degrees can also be
1051 set manually for a set of selected atoms. Note that the degree is set
1052 to the given value for all bonds in between any pair of atoms within
1053 the set.</para>
1054 <programlisting>... --set-bond-degree 2</programlisting>
1055 <para>Similarly, if more than two atoms are selected, then all bonds
1056 found between any pair of these are modified.</para>
1057 </section>
1058 <section xml:id="bond.save-bonds">
1059 <title xml:id="bond.save-bonds.title">Saving bond information </title>
1060 <para>Bond information can be saved to a file in <link xlink:href="http://www.molecuilder.com/">
1061 <productname>TREMOLO </productname>
1062 </link>&apos;s dbond style.</para>
1063 <programlisting>... --save-bonds system.dbonds</programlisting>
1064 <para>Similarly is the following Action which saves the bond
1065 information as a simple list of one atomic id per line and in
1066 the same line, separated by spaces, the ids of all atoms connected
1067 to it.</para>
1068 <programlisting>... --save-adjacency system.adj</programlisting>
1069 <para>This corresponds to the <emphasis role="bold">bond-file</emphasis> Action.</para>
1070 </section>
1071 <section xml:id="fileparsers.bond-file">
1072 <title xml:id="fileparsers.bond-file.title">Load extra bond information</title>
1073 <para>The reverse Action of <emphasis role="bold">save-bonds</emphasis> is the following which loads bond information from the file <emphasis role="bold">water.dbond</emphasis>.</para>
1074 <programlisting>... --bond-file water.dbond</programlisting>
1075 <para>Note that because of the use of ids the bond file is intimately connected to the associated input file containing the atomic coordinates and thus both should parsed right after another and to the very beginning of any sequence of Actions.</para>
1076 </section>
1077 <section xml:id="bond.stretch-bond">
1078 <title xml:id="bond.stretch-bond.title">Stretching a bond</title>
1079 <para>Stretching a bond actually refers to translation of the
1080 associated pair of atoms. However, this action will keep the rest of
1081 the molecule to which both atoms belong to invariant as well.</para>
1082 <programlisting>... --stretch-bond 1.2</programlisting>
1083 <para>This scales the original bond distance to the new bond
1084 distance 1.2, shifting the right hand side and the left hand side of
1085 the molecule accordingly.</para>
1086 <warning>
1087 <para>this fails with aromatic rings (but you can always
1088 undo).</para>
1089 </warning>
1090 </section>
1091 <section xml:id="bond.change-bond-angle">
1092 <title xml:id="bond.change-bond-angle.title">Changing a bond angle </title>
1093 <para>In the same way as stretching a bond, you can change the angle
1094 in between two bonds. This works if exactly three atoms are selected
1095 and two pairs are bonded.</para>
1096 <programlisting>... --change-bond-angle 90</programlisting>
1097 <para>This will change the angle from its value to 90 degrees by
1098 translating the two outer atoms of this triangle (the atom connected
1099 to both other atoms serves as rotation joint).</para>
1100 </section>
1101 </section>
1102 <section xml:id="molecule">
1103 <title xml:id="molecule.title">Manipulate molecules</title>
1104 <para>Molecules are agglomerations of atoms that are (covalently) bonded. Hence,
1105 the Actions working on molecules differ from those working on atoms.
1106 Joining two molecules can only be accomplished by adding a bond in
1107 between, and in the reverse fashion splitting a molecule by removing
1108some or even all bonds in between. The Actions below mostly deal with copying
1109 molecules. Removing of molecules is done via selecting the molecule&apos;s
1110 atoms and removing them, which removes the atoms as well.</para>
1111 <note>
1112 <para>Initially when you load a file via the input action all atoms
1113 are placed in a single molecule despite any present bond
1114 information, see <link linkend="fragmentation">Dissecting the molecular system into molecules</link></para>
1115 </note>
1116 <section xml:id="molecule.copy">
1117 <title xml:id="molecule.copy.title">Copy molecules</title>
1118 <para>A basic operation is to duplicate a molecule. This works on a
1119 single, currently selected molecule. Afterwards, we elaborate on a
1120 more complex manner of copying, filling a specific shape with
1121 molecules.</para>
1122 <programlisting>
1123 ... --copy-molecule \
1124 --position &quot;10,10,10&quot;
1125 </programlisting>
1126 <para>This action copies the selected molecule and inserts it at the
1127 position (10,10,10) in the domain with respect to the molecule&apos;s
1128 center. In effect, it copies all the atoms of the original molecule
1129 and adds new bonds in between these copied atoms such that their
1130 bond subgraphs are identical.</para>
1131 <para>Here, instead of giving an explicit vector you may also use
1132 a vector stored as a geometry object, see section
1133 <link linkend='geometry'>Geometry</link>.</para>
1134 </section>
1135 <section xml:id="molecule.change-molname">
1136 <title xml:id="molecule.change-molname.title">Change a molecules name</title>
1137 <para>You can change the name of a molecule which is important for
1138 selection.</para>
1139 <programlisting>... -change-molname &quot;test</programlisting>
1140 <para>This will change the name of the (only) selected molecule to
1141 &quot;test&quot;.</para>
1142 <para>Connected with this is the default name an unknown molecule
1143 gets.</para>
1144 <programlisting>... --default-molname test</programlisting>
1145 <para>This will change the default name of new molecules to
1146 &quot;test&quot;.</para>
1147 <note>
1148 <para>Note that a molecule loaded from file gets the filename
1149 (without suffix) as its name.</para>
1150 </note>
1151 </section>
1152 <section xml:id="molecule.remove-molecule">
1153 <title xml:id="molecule.remove-molecule.title">Remove molecules </title>
1154 <para>This removes one or multiple selected molecules.</para>
1155 <programlisting>... -remove-molecule</programlisting>
1156 <para>This essentially just removes all of the molecules&apos; atoms
1157 which in turn also causes the removal of the molecule.</para>
1158 </section>
1159 <section xml:id="molecule.translate-molecules">
1160 <title xml:id="molecule.translate-molecules.title">Translate molecules </title>
1161 <para>This translates one or multiple selected molecules by a
1162 specific offset..</para>
1163 <programlisting>... -translate-molecules</programlisting>
1164 <para>As before, this is actually just an operation on all of the
1165 molecule&apos;s atoms, namely translating them.</para>
1166 <para>Same as with <link linkend='atoms.translate-atom'>translate-atoms</link>
1167 instead of giving an explicit vector you may also use a vector stored
1168 as a geometry object, see section
1169 <link linkend='geometry'>Geometry</link>.</para>
1170 </section>
1171 <section xml:id="molecule.rotate-around-self">
1172 <title xml:id="molecule.rotate-around-self.title">Rotate around self </title>
1173 <para>You can rotate a molecule around its own axis.</para>
1174 <programlisting>
1175 ... --rotate-around-self &quot;90&quot; \
1176 --axis &quot;0,0,1&quot;
1177 </programlisting>
1178 <para>This rotates the molecule around the z axis by 90 degrees as
1179 if the origin were at its wn center of origin.</para>
1180 </section>
1181 <section xml:id="molecule.rotate-around-origin">
1182 <title xml:id="molecule.rotate-around-origin.title">Rotate around origin</title>
1183 <para>In the same manner the molecule can be rotated around an
1184 external origin.</para>
1185 <programlisting>
1186 ... --rotate-around-origin 90 \
1187 --position &quot;0,0,1&quot;\
1188 </programlisting>
1189 <para>This rotates the molecule around an axis from the origin to
1190 the position (0,0,1), i.e. around the z axis, by 90 degrees, where
1191 for the position you may also use a stored vector, see section
1192 <link linkend='geometry'>Geometry</link>.</para>
1193 </section>
1194 <section xml:id="molecule.rotate-to-principal-axis-system">
1195 <title xml:id="molecule.rotate-to-principal-axis-system.title"> Rotate to principal axis system</title>
1196 <para>The principal axis system is given by an ellipsoid that mostly
1197 matches the molecules shape. The principal axis system can be
1198 simply determined by</para>
1199 <programlisting>... --principal-axis-system</programlisting>
1200 <para>To rotate the molecule around itself to align with this system
1201 do as follows</para>
1202 <programlisting>... --rotate-to-principal-axis-system &quot;0,0,1&quot;
1203 </programlisting>
1204 <para>This rotates the molecule in such a manner that the ellipsoids
1205 largest axis is aligned with the z axis. <remark>Note that
1206 &quot;0,0,-1&quot; would align anti-parallel.</remark></para>
1207 <para>Again instead of giving the coordinates explicitly you may also
1208 use a vector stored as a geometry object, see section
1209 <link linkend='geometry'>Geometry</link>.</para>
1210 </section>
1211 <section xml:id="molecule.verlet-integration">
1212 <title xml:id="molecule.verlet-integration.title">Perform verlet integration</title>
1213 <para>Atoms not only have a position, but each instance also stores
1214 velocity and a force vector. These can be used in a velocity verlet
1215 integration step. Velocity verlet is an often employed time
1216 integration algorithm in molecular dynamics simulations.</para>
1217 <programlisting>
1218 ... --verlet-integration \
1219 --deltat 0.1 \
1220 --keep-fixed-CenterOfMass 0
1221 </programlisting>
1222 <para>This will integrate with a timestep of <inlineequation>
1223 <m:math display="inline">
1224 <m:mi>\Delta_t = 0.1</m:mi>
1225 </m:math>
1226 </inlineequation>and correcting forces and velocities such that
1227 the sum over all atoms is zero.</para>
1228 </section>
1229 <section xml:id="molecule.force-annealing">
1230 <title xml:id="molecule.force-annealing.title">Anneal the atomic forces</title>
1231 <para>This will shift the atoms in a such a way as to decrease (or
1232 anneal) the forces acting upon them.</para>
1233 <para>Forces may either be already present for the set of atoms by
1234 some other way (e.g. from a prior fragmentation calculation) or,
1235 as shown here, loaded from an external file. We anneal the forces for
1236 one step with a certain initial step width of 0.5 atomic time
1237 units and do not create a new timestep for each optimization
1238 step.</para>
1239 <programlisting>
1240 ... --force-annealing \
1241 --forces-file test.forces \
1242 --deltat 0.5 \
1243 --steps 1 \
1244 --output-every-step 0
1245 </programlisting>
1246 </section>
1247 <section xml:id="molecule.linear-interpolation-of-trajectories">
1248 <title xml:id="molecule.linear-interpolation-of-trajectories.title"> Linear interpolation between configurations</title>
1249 <para>This is similar to verlet integration, only that it performs
1250 a linear integration irrespective of the acting atomic forces.
1251 </para>
1252 <para>The following call will produce an interpolation between the
1253 configurations in time step 0 and time step 1 with 98 intermediate
1254 steps, i.e. current step 1 will end up in time step 99. In this
1255 case an identity mapping is used to associated atoms in start and
1256 end configuration.</para>
1257 <programlisting>
1258 ... --linear-interpolation-of-trajectories \
1259 --start-step 0 \
1260 --end-step 1 \
1261 --interpolation-steps 100 \
1262 --id-mapping 1
1263 </programlisting>
1264 </section>
1265 </section>
1266 <section xml:id="domain">
1267 <title xml:id="domain.title">Manipulate domain</title>
1268 <para>Here, we elaborate on how to duplicate all the atoms inside the
1269 domain, how to scale the coordinate system, how to center the atoms
1270 with respect to certain points, how to realign them by given
1271 constraints, how to mirror and most importantly how to specify the
1272 domain.</para>
1273 <section xml:id="domain.change-box">
1274 <title xml:id="domain.change-box.title">Changing the domain</title>
1275 <para>The domain is specified by a symmetric 3x3 matrix. The
1276 eigenvalues (diagonal entries in case of a diagonal matrix) give the
1277 length of the edges, additional entries specify transformations of
1278 the box such that it becomes a more general parallelepiped.</para>
1279 <programlisting>... change-box &quot;20,0,20,0,0,20&quot;</programlisting>
1280 <para>As the domain matrix is symmetric, six values suffice to fully
1281 specify it. We have to give the six components of the lower triangle matrix. Here, we change the box to a cuboid of equal edge length of
1282 20.<warning>
1283 <para>In case of the python interface an upper triangle matrix is given. Hence, the above would read &quot;20,0,0,20,0,20&quot;.</para>
1284 </warning></para>
1285 </section>
1286 <section xml:id="domain.bound-in-box">
1287 <title xml:id="domain.bound-in-box.title">Bound atoms inside box </title>
1288 <para>The following applies the current boundary conditions to the
1289 atoms. In case of periodic or wrapped boundary conditions the atoms
1290 will be periodically translated to be inside the domain
1291 again.</para>
1292 <programlisting>... --bound-in-box</programlisting>
1293 </section>
1294 <section xml:id="domain.center-in-box">
1295 <title xml:id="domain.center-in-box.title">Center atoms inside the domain</title>
1296 <para>This is a combination of changing the box and bounding the
1297 atoms inside it.</para>
1298 <programlisting>... --center-in-box &quot;20,0,20,0,0,20&quot;</programlisting>
1299 </section>
1300 <section xml:id="domain.center-edge">
1301 <title xml:id="domain.center-edge.title">Center the atoms at an edge</title>
1302 <para>MoleCuilder can calculate the minimum box (parallel to the
1303 cardinal axis) all atoms would fit in and translate all atoms in
1304 such a way that the lower, left, front edge of this minimum is at
1305 the origin (0,0,0).</para>
1306 <programlisting>... --center-edge</programlisting>
1307 </section>
1308 <section xml:id="domain.add-empty-boundary">
1309 <title xml:id="domain.add-empty-boundary.title">Extending the boundary by adding an empty boundary</title>
1310 <para>In the same manner as above a minimum box is determined that
1311 is subsequently expanded by a boundary of the given additional
1312 thickness. This applies to either side, i.e. left and right, top and bottom, front and back.</para>
1313 <programlisting>... --add-empty-boundary &quot;5,5,5&quot;</programlisting>
1314 <para>This will enlarge the box in such a way that every atom is at
1315 least by a distance of 5 away from the boundary of the domain (in
1316 the infinity norm).</para>
1317 </section>
1318 <section xml:id="domain.scale-box">
1319 <title xml:id="domain.scale-box.title">Scaling the box</title>
1320 <para>You can enlarge the domain by simple scaling factors.</para>
1321 <programlisting>... --scale-box &quot;1,1,2.5&quot;</programlisting>
1322 <para>Here, the domain is stretched in the z direction by a factor
1323 of 2.5.</para>
1324 </section>
1325 <section xml:id="domain.repeat-box">
1326 <title xml:id="domain.repeat-box.title">Repeating the box</title>
1327 <para>Under periodic boundary conditions often only the minimal
1328 periodic cell is stored. E.g. for a crystallic system this minimal cell is all that&apos;s needed to completely specify a larger body. If need be, multiple images can be easily
1329 added to the current state of the system by repeating the box, i.e.
1330 the box along with all contained atoms is copied and placed
1331 adjacently.</para>
1332 <programlisting>... --repeat-box &quot;1,2,2&quot;</programlisting>
1333 <para>This will create a 2x2 grid of the current domain, replicating
1334 it along the y and z direction along with all atoms. If the domain
1335 contained before a single water molecule, we will now have four of
1336 them.</para>
1337 </section>
1338 <section xml:id="domain.set-boundary-conditions">
1339 <title xml:id="domain.set-boundary-conditions.title">Change the boundary conditions</title>
1340 <para>Various boundary conditions can be applied that affect how
1341 certain Actions work, e.g. translate-atoms. We briefly give a list
1342 of all possible conditions:</para>
1343 <itemizedlist>
1344 <listitem>
1345 <para>Wrap</para>
1346 <para>Coordinates are wrapped to the other side of the domain,
1347 i.e. periodic boundary conditions.</para>
1348 </listitem>
1349 <listitem>
1350 <para>Bounce</para>
1351 <para>Coordinates are bounced back into the domain, i.e. they
1352 are reflected from the domain walls.</para>
1353 </listitem>
1354 <listitem>
1355 <para>Ignore</para>
1356 <para>No boundary conditions apply.</para>
1357 </listitem>
1358 </itemizedlist>
1359 <para>The following will set the boundary conditions to periodic.
1360 </para>
1361 <programlisting>... --set-boundary-conditions &quot;Wrap Wrap Wrap&quot;</programlisting>
1362 <para>Note that boundary conditions are not enforced unless explicitly requested, e.g. by the <emphasis role="bold">bound-in-box</emphasis> action</para>
1363 </section>
1364 </section>
1365 <section xml:id="filling">
1366 <title xml:id="filling.title">Filling</title>
1367 <para>Filling a specific part of the domain with one type of
1368 molecule, e.g. a water molecule, is the more advanced type of
1369 copying of a molecule (see <emphasis role="bold">copy-molecule</emphasis>) and for this we need several
1370 ingredients.</para>
1371 <para>First, we need to specify the part of the domain. This is done
1372 via a shape. We have already learned how to create and select
1373 shapes. The currently selected shape will serve as the fill-in
1374 region.</para>
1375 <para>Then, there are three types of filling: domain, volume, and
1376 surface. The domain is filled with a regular grid of fill-in points.
1377 A volume and a surface are filled by a set of equidistant points
1378 distributed within the volume or on the surface of a selected
1379 shape. The latter is closed connected to the respective shape selected. Molecules will then be copied and translated points when they
1380 &quot;fit&quot;. Note that not only primitive shape can be used for filling in molecules inside their volume or on their surface but also any kind of combined shape. </para>
1381 <remark>Note however that not all combinations may already be fully working.</remark>
1382 <para>The filler procedure checks each fill-in point whether there
1383 is enough space for the set of atoms. To this end, we require a cluster
1384 instead of a molecule. A cluster is more general than a molecule as it is not restricted to a connected subgraph with respect to the bond graph. A cluster is just a general agglomeration of atoms
1385 combined with a bounding box that contains all of them and serves as
1386 its minimal volume. I.e. we need such a cluster. For this a number of
1387 atoms have to be specified, the minimum bounding box is generated
1388 automatically by which it is checked whether sufficient space is available at the fill-in point.</para>
1389 <para>On top of that, molecules can be selected whose volume is
1390 additionally excluded from the filling region.</para>
1391 <section xml:id="filling.fill-regular-grid">
1392 <title xml:id="filling.fill-regular-grid.title">Fill the domain with molecules</title>
1393 <para>The call to fill the volume of the selected shape with the
1394 selected atoms is then as follows,</para>
1395 <programlisting>
1396 ... --fill-regular-grid \
1397 --mesh-size &quot;5,5,5&quot; \
1398 --mesh-offset &quot;.5,.5,.5&quot; \
1399 --DoRotate 1 \
1400 --min-distance 1. \
1401 --random-atom-displacement 0.05 \
1402 --random-molecule-displacement 0.4 \
1403 --tesselation-radius 2.5
1404 </programlisting>
1405 <para>This generates a cardinal grid of 5x5x5 fill-in points within the
1406 sphere that are offset such as to lie centered within the sphere, defined by a relative offset per axis in [0,1]. Hence, with an offset of &quot;0&quot; we have the points left-aligned, with &quot;0.5&quot; centered, and with &quot;1&quot; right-aligned. Additionally, each molecule is rotated
1407 by a random rotation matrix, each atom is translated randomly by at
1408 most 0.05, each molecule&apos;s center similarly but at most by 0.4. The selected
1409 molecules&apos; volume is obtained by tesselating their surface and
1410 excluding every fill-in point whose distance to this surface does
1411 not exceed 1. We refer to our comments in
1412 <link linkend="randomization">Randomization</link>for details on
1413 changing the randomness and obtaining some extra flexibility thereby.</para>
1414 </section>
1415 <section xml:id="filling.fill-volume">
1416 <title xml:id="filling.fill-volume.title">Fill a shape&apos;s volume with molecules</title>
1417 <para>More specifically than filling the whole domain with molecules,
1418 maybe except areas where other molecules already are, we also can
1419 fill only specific parts by selecting a shape and calling upon
1420 the following action:</para>
1421 <programlisting>
1422 ... --fill-volume \
1423 --counts 12 \
1424 --min-distance 1. \
1425 --DoRotate 1 \
1426 --random-atom-displacement 0.05 \
1427 --random-molecule-displacement 0.4 \
1428 --tesselation-radius 2.5
1429 </programlisting>
1430 <para>The specified option all have the same function as before. Here, we specified to generate 12 points inside the volume of the selected shape.</para>
1431 </section>
1432 <section xml:id="filling.fill-surface">
1433 <title xml:id="filling.fill-surface.title">Fill a shape&apos;s surface with molecules</title>
1434 <para>Filling a surface is very similar to filling its volume.
1435 Again the number of equidistant points has to be specified.
1436 However, randomness is constrained as the molecule has to be aligned
1437 with the surface in a specific manner. The idea is to have the molecules point away from the surface in a similar way. This is done by aligning an axis with the surface normal. The alignment axis refers
1438 to the largest principal axis of the filler molecule and will
1439 be aligned parallel to the surface normal at the fill-in point.
1440This is the same syntax as with <emphasis role="bold">rotate-around-self</emphasis>. </para>
1441 <para>The call below will fill in 12 points with a minimum distance
1442 between the instances of 1 angstroem. We allow for certain random
1443 displacements and use the z-axis for aligning the molecules on
1444 the surface.</para>
1445 <programlisting>
1446 ... --fill-surface \
1447 --counts 12 \
1448 --min-distance 1. \
1449 --DoRotate 1 \
1450 --random-atom-displacement 0.05 \
1451 --random-molecule-displacement 0.4 \
1452 --Alignment-Axis &quot;0,0,1&quot;
1453 </programlisting>
1454 <para>Note that instead of giving an explicit axis you may also use
1455 a vector stored as a geometry object, see section
1456 <link linkend='geometry'>Geometry</link>.</para>
1457 </section>
1458 <section xml:id="filling.suspend-in-molecule">
1459 <title xml:id="filling.suspend-in-molecule.title">Suspend in molecule </title>
1460 <para>Add a given molecule in the simulation domain in such a way
1461 that the total density is as desired.</para>
1462 <programlisting>
1463 ... --suspend-in-molecule 1.
1464 </programlisting>
1465 </section>
1466 <section xml:id="filling.fill-molecule">
1467 <title xml:id="filling.fill-molecule.title">Fill in molecule</title>
1468 <para>This action will be soon be removed.</para>
1469 <programlisting>
1470 ... --fill-molecule
1471 </programlisting>
1472 </section>
1473 <section xml:id="filling.fill-void">
1474 <title xml:id="filling.fill-void.title">Fill void with molecule </title>
1475 <para>This action will be soon be removed.</para>
1476 <programlisting>
1477 ... --fill-void
1478 </programlisting>
1479 </section>
1480 </section>
1481 <section xml:id="analysis">
1482 <title xml:id="analysis.title">Analysis</title>
1483 <para>If atoms are manipulated and molecules are filled in, it is also a good idea to check on the manner of the filling. This can be done by for example looking at the pair correlation or angular correlation function. This may be useful in checking what is the mean distance between water molecules and how they are aligned with respect to each other.</para>
1484 <section xml:id="analysis.pair-correlation">
1485 <title xml:id="analysis.pair-correlation.title">Pair Correlation </title>
1486 <para>For two given elements Pair correlation checks on the typical
1487 distance in which they can be found with respect to one another. E.g. for
1488 water one might be interested what is the typical distance for
1489 hydrogen and oxygen atoms.</para>
1490 <programlisting>
1491 ... --pair-correlation \
1492 --elements 1 8 \
1493 --bin-start 0 \
1494 --bin-width 0.7 \
1495 --bin-end 10 \
1496 --output-file histogram.dat \
1497 --bin-output-file bins.dat \
1498 --periodic 0
1499 </programlisting>
1500 <para>This will compile a histogram for the interval [0,10] in steps
1501 of 0.7 and increment a specific bin if the distance of one such pair
1502 of a hydrogen and an oxygen atom can be found within its distance
1503 interval. These data files can be used for plotting the distribution right away in order to check on the correlation between the elements.</para>
1504 </section>
1505 <section xml:id="analysis.dipole-correlation">
1506 <title xml:id="analysis.dipole-correlation.title">Dipole Correlation </title>
1507 <para>The dipole correlation is similar to the pair correlation, only
1508 that it correlates the orientation of dipoles in the molecular
1509 system with one another.</para>
1510 <para>Note that the dipole correlation works on the currently
1511 selected molecules, e.g. all water molecules if so selected.</para>
1512 <programlisting>
1513 ... --dipole-correlation \
1514 --bin-start 0 \
1515 --bin-width 0.7 \
1516 --bin-end 10 \
1517 --output-file histogram.dat \
1518 --bin-output-file bins.dat \
1519 --periodic 0
1520 </programlisting>
1521 <para>Hence, instead of calculating a function of the distance in [0,infinity), it calculates the angular histogram in [0,2pi).</para>
1522 </section>
1523 <section xml:id="analysis.dipole-angular-correlation">
1524 <title xml:id="analysis.dipole-angular-correlation.title">Dipole Angular Correlation</title>
1525 <para>The dipole angular correlation looks at the angles of a
1526 dipole over time. It takes the orientation of a certain time step
1527 as the zero angle and bins all other orientations found in later
1528 time steps relative to it.
1529 </para>
1530 <para>Note that in contrast to the dipole correlation the dipole
1531 angular correlation works on the molecules determined by a formula.
1532 This is because selections do not work over time steps as molecules
1533 might change.
1534 </para>
1535 <programlisting>
1536 ... --dipole-angular-correlation H2O \
1537 --bin-start 0 \
1538 --bin-width 5 \
1539 --bin-end 360 \
1540 --output-file histogram.dat \
1541 --bin-output-file bins.dat \
1542 --periodic 0 \
1543 --time-step-zero 0
1544 </programlisting>
1545 </section>
1546 <section xml:id="analysis.point-correlation">
1547 <title xml:id="analysis.point-correlation.title">Point Correlation </title>
1548 <para>Point correlation is very similar to pair correlation, only
1549 that it correlates not positions of atoms among one another but
1550 against a fixed, given point.</para>
1551 <programlisting>
1552 ... --point-correlation \
1553 --elements 1 8 \
1554 --position &quot;0,0,0&quot; \
1555 --bin-start 0 \
1556 --bin-width 0.7 \
1557 --bin-end 10 \
1558 --output-file histogram.dat \
1559 --bin-output-file bins.dat \
1560 --periodic 0
1561 </programlisting>
1562 <para>This would calculate the correlation of all hydrogen and
1563 oxygen atoms with respect to the origin.</para>
1564 <para>Naturally, instead of giving explicit coordinates you may also
1565 use a vector stored as a geometry object for position, see section
1566 <link linkend='geometry'>Geometry</link>.</para>
1567 </section>
1568 <section xml:id="analysis.surface-correlation">
1569 <title xml:id="analysis.surface-correlation.title">Surface Correlation</title>
1570 <para>The surface correlation calculates the distance of a set
1571 of atoms with respect to a tesselated surface.</para>
1572 <programlisting>
1573 ... --surface-correlation \
1574 --elements 1 8 \
1575 --bin-start 0 \
1576 --bin-width 0.7 \
1577 --bin-end 10 \
1578 --output-file histogram.dat \
1579 --bin-output-file bins.dat \
1580 --periodic 0
1581 </programlisting>
1582 </section>
1583 <section xml:id="analysis.molecular-volume">
1584 <title xml:id="analysis.molecular-volume.title">Molecular Volume </title>
1585 <para>This simply calculates the volume that a selected molecule
1586 occupies. For this the molecular surface is determined via a
1587(convex) tesselation of its surface. Note that this surface is minimal is that aspect
1588 that each node of the tesselation consists of an atom of the
1589 molecule.</para>
1590 <programlisting>... --molecular-volume</programlisting>
1591 </section>
1592 <section xml:id="analysis.average-molecule-force">
1593 <title xml:id="analysis.average-molecule-forcetitle">Average force acting on a molecule</title>
1594 <para>This sums up all the forces of each atom of a currently
1595 selected molecule and returns the average force vector. This should
1596 give you the general direction of acceleration of the molecule.
1597 </para>
1598 <programlisting>... --molecular-volume</programlisting>
1599 </section>
1600 </section>
1601 <section xml:id="fragmentation">
1602 <title xml:id="fragmentation.title">Fragmentation</title>
1603 <para>Fragmentation refers to a so-called linear-scaling method called
1604 &quot;Bond-Order diSSection in an ANOVA-like fashion&quot; (BOSSANOVA),
1605 developed by <personname>Frederik Heber</personname>. In this section
1606 we briefly explain what the method does and how the associated actions
1607 work.</para>
1608 <para>The central idea behind the BOSSANOVA scheme is to fragment the
1609 graph of the molecular system into connected subgraphs of a certain
1610 number of vertices, namely a fixed number of atoms. To give an example, loading a ethane atom
1611 with the chemical formula C2H6, fragmenting the molecule up to order 1
1612 means creating two fragments, both methane-like from either carbon
1613 atom including surrounding hydrogen atoms. Fragmenting up to order 2
1614 would return both the methane fragments and additionally the full
1615 ethane molecule as it resembles a fragment of order 2, namely
1616 containing two (non-hydrogen) atoms.</para>
1617 <para>The reason for doing this is that usual ab-initio calculations
1618 of molecular systems via methods such as Density Functional Theory or
1619 Hartree-Fock scale at least as <inlineequation>
1620 <m:math display="inline">
1621 <m:mi>{\cal O}(M^3}</m:mi>
1622 </m:math>
1623 </inlineequation>with the number of atoms <inlineequation>
1624 <m:math display="inline">
1625 <m:mi>M</m:mi>
1626 </m:math>
1627 </inlineequation>. In general, this cost is prohibitive for calculating ground state energies and forces (required for molecular dynamics simulations) for larger molecules such as bio proteins. By fragmenting the molecular system and looking at fragments of fixed size, calculating the ground state energy of a
1628 number of fragment molecules becomes a linear scaling operation with the number of atoms. In the doctoral thesis of Frederik
1629 Heber, it is explained why this is a sensible ansatz mathematically
1630 and shown that it delivers a very good accuracy if electrons (and
1631 hence interactions) are in general localized.</para>
1632 <para>Long-range interactions (e.g. Coulomb or van-der-Waals interactions) are artificially truncated, however,
1633 with this fragmentation ansatz. It can be obtained in a perturbation manner
1634 by sampling the resulting electronic and nuclei charge density on a
1635 grid, summing over all fragments, and solving the associated Poisson
1636 equation. Such a calculation is implemented via the solver
1637 <productname>vmg</productname> by Julian Iseringhausen that is
1638 contained in the <link xlink:href="http://www.scafacos.org/">
1639 <productname>ScaFaCoS</productname>
1640 </link>. This enhancement is currently implemented via another program package named <productname>JobMarket</productname> that is at the moment not available publicly (contact the author Frederik Heber if interested).</para>
1641 <para>Note that we treat hydrogen special (but can be switched off) as
1642 fragments are calculated as closed shell (total spin equals zero).
1643 Also, we use hydrogen to saturate any dangling bonds that occur as
1644 bonds are cut when fragmenting a molecule (this, too, can be switched
1645 off).</para>
1646 <para>Eventually, the goal of fragmentation is to yield an energy and gradients with respect to nuclear positions per atom for each fragment. These forces can be used for molecular dynamics simulations, for structure optimization or for fitting empirical potential functions. The underlying operation consists of three parts. The first part is always the act of splitting up the selected atoms in the molecular system into fragments. The energies of the fragments are calculated in the second part via an external ab-initio solver, where the actual solver used is arbitrary and to some extent up to the user (<productname>MPQC </productname> is used by default). The second part of the fragmentation is to combine fragment results to energy and gradients for the total molecular system.</para>
1647 <para>Note that the molecular system itself is not touched in any way by this fragmentation. </para>
1648 <section xml:id="fragmentation.fragment-molecule">
1649 <title xml:id="fragmentation.fragment-molecule.title">Fragmenting a molecular system</title>
1650 <para>For the current selection of atoms, all fragments consisting
1651 of these (sub)set of atoms are created in the following
1652 manner.</para>
1653 <programlisting>
1654 ... --fragment-molecule &quot;BondFragment&quot; \
1655 --DoCyclesFull 1 \
1656 --distance 3. \
1657 --order 3 \
1658 --grid-level 5 \
1659 --output-types xyz mpqc
1660 </programlisting>
1661 <para>We go through each of the options one after the other. During
1662 fragmentation some files are created storing state information, i.e.
1663 the vertex/atom indices per fragment and so on. These files are used when re-performing the fragmentation on a slightly modified state (e.g. after a time integration step with essentially the same bond graph) for faster operation. These files all need
1664 a common prefix, here &quot;BondFragment&quot;. Then, we specify that cycles
1665 should be treated fully. This compensates for electrons in aromatic
1666 rings being delocalized over the ring. If cycles in the graph,
1667 originating from aromatic rings, are always calculated fully, i.e.
1668 the whole ring becomes a fragment, we partially overcome these
1669 issues. This does however not work indefinitely and accuracy of the
1670 approximation is limited (<inlineequation>
1671 <m:math display="inline">
1672 <m:mi>&gt;10^{-4}</m:mi>
1673 </m:math>
1674 </inlineequation>) in systems with many interconnected aromatic
1675 rings, such as graphene. Next, we give a distance cutoff of 3 angstroem used
1676 in bond graph creation. Then, we specify the maximum order, i.e. the
1677 maximum number of (non-hydrogen) atoms per fragment, here 3. The
1678 higher this number the more expensive the calculation becomes
1679 (because substantially more fragments are created) but also the more
1680 accurate. The grid level refers to the part where long-range Coulomb
1681 interactions are calculated. This is done via solving the associated
1682 Poisson equation with a multigrid solver -- however, this requires the <productname>JobMarket</productname> package. As input the solver
1683 requires the density which is sampled on a cartesian grid whose
1684 resolution these parameter defines (<inlineequation>
1685 <m:math display="inline">
1686 <m:mi>2^{\mathrm{level}}</m:mi>
1687 </m:math>
1688 </inlineequation>). And finally, we give the output file formats,
1689 i.e. which file formats are used for writing each fragment
1690 configuration (prefix is &quot;BondFragment&quot;, remember?). Here, we use
1691 XYZ (mainly for checking the configurations visually) and MPQC,
1692 which is a very robust Hartree-Fock solver. We refer to the
1693 discussion of the <link linkend="fileparsers">Parsers</link>
1694 on how to change the parameters of the ab-initio calculation. That is to the extent implemented in Molecuilder the created configuration files for the specific solver are manipulated with the options also manipulating the state file written on program exit.</para>
1695 <para>After having written all fragment configuration files, you
1696 need to calculate each fragment, grab the resulting energy (and
1697 force vectors) and place them into a result file manually. This at
1698 least is necessary if you have specified output-types above. If not,
1699 the fragments are not written to file but stored internally. Read
1700 on.</para>
1701 <para>All created fragments, i.e. their id sets, are stored in an
1702 internal structure that associates each atom with all fragments it
1703 is contained in. This AtomFragments container structure can be parsed
1704 and stored, see <link linkend="atomfragments">AtomFragments</link>.
1705 They are used e.g. for fitting partial charges. There, a selection of
1706 atoms is used to fit partial charges to all fragments (and the charge
1707 grids obtained from long-range calculations, see <link linkend="fragmentation.fragment-automation">FragmentAutomation</link>,
1708 and the container is needed to know all fragments.
1709 <note>This structure is cleared by this action and created fragment
1710 information is inserted afterwards, i.e. it contains only the
1711 associations from the current fragmentation.</note>
1712 </para>
1713 </section>
1714 <section xml:id="fragmentation.fragment-automation">
1715 <title xml:id="fragmentation.fragment-automation.title">Calculating fragment energies automatically</title>
1716 <para>Another way of doing this is enabled if you have
1717the <productname>JobMarket</productname> package. Initially, the package was required but now it is only recommended as then calculations can be performed in parallel or arbitrarily many cores (and also the long-range calculation are only available then). JobMarket implements a
1718 client/server ansatz, i.e. two (or more) independent programs are
1719 running (even on another computer but connected via an IP network),
1720 namely a server and at least one client. The server receives
1721 fragment configurations from MoleCuilder and assigns these to a
1722 client who is not busy. The client launches an executable that is
1723 specified in the work package he is assigned and gathers after
1724 calculation a number of values, likewise specified in the package.
1725 The results are gathered together by the server and can be requested
1726 from MoleCuilder once they are done. This essentially describes what
1727 is happening during the execution of this action.</para>
1728 <para>Stored fragment jobs can also be parsed again, i.e. reversing
1729 the effect of having output-types specified in <link linkend="fragmentation.fragment-molecule">Fragmenting a molecule </link>.</para>
1730 <programlisting>
1731 ... --parse-fragment-jobs \
1732 --fragment-jobs &quot;BondFragment00.in&quot; &quot;BondFragment01.in&quot; \
1733 --fragment-path &quot;./&quot; \
1734 --grid-level 5
1735 </programlisting>
1736 <para>Here, we have specified two files, namely
1737 <filename>BondFragment00.in</filename> and
1738 <filename>BondFragment01.in</filename>, to be parsed from the path
1739 &quot;./&quot;, i.e. the current directory. Also, we have specified to sample
1740 the electronic charge density obtained from the calculated ground
1741 state energy solution with a resolution of 5 (see fragment molecule
1742 and also below).</para>
1743 <para>This allows for automated and parallel calculation of all
1744 fragment energies and forces directly within MoleCuilder. The
1745 FragmentationAutomation action takes the fragment configurations
1746 from an internal storage wherein they are placed if in
1747 FragmentMolecule no output-types have been specified.</para>
1748 <programlisting>
1749 ... --fragment-automation \
1750 --fragment-executable mpqc \
1751 --DoLongrange 1 \
1752 --DoValenceOnly 1 \
1753 --grid-level 5 \
1754 --interpolation-degree 3 \
1755 --near-field-cells 4 \
1756 --server-address 127.0.0.1 \
1757 --server-port 1025
1758 </programlisting>
1759 <para>Again, we go through each of the action&apos;s options step by
1760 step.</para>
1761 <para>The executable is required if you do not have a patched
1762 version of <productname>MPQC</productname> that may directly act as
1763 a client to JobMarket&apos;s server.</para>
1764 <note>
1765 <para>Long-calculations are only possible with a client that knows
1766 how to handle VMG jobs. If you encounter failures, then it is most
1767 likely that you do not have a suitable client.</para>
1768 </note>
1769 <para>In the next line, we have all options related to calculation
1770 of long-range interactions. We only sample valence charges on the
1771 grid, i.e. not core electrons and the nuclei charges are reduced
1772 suitably. This avoids problems with sampling highly localized
1773 charges on the grid and is in general recommended. Next, there
1774 follow parameters for the multi grid solver, namely the resolution
1775 of the grid, see under fragmenting the molecule, the interpolation
1776 degree and the number of near field cells. A grid level of 6 is
1777 recommended but costly in terms of memory, the other values are at
1778 their recommend values.</para>
1779 <para>In the last line, parameters are given on how to access the
1780 JobMarket server, namely it address and its port. If the JobMarket
1781 package is not available, then these option values cannot be given.
1782 Instead the solver is called internally on the same machine and one
1783 fragment energy is calculated after the other.</para>
1784 <note>The structure storing the fragment results internally is
1785 cleared prior to this action and calculated fragment results
1786 is inserted afterwards, i.e. it contains only the
1787 calculations from the current run.</note>
1788 <note>All calculated results may be placed in a result file for
1789 later parsing, see
1790 <link linkend="molecule.save-fragment-results">save fragment results</link>
1791 .</note>
1792 </section>
1793 <section xml:id="fragmentation.analyse-fragment-results">
1794 <title xml:id="fragmentation.analyse-fragment-results.title"> Analyse fragment results</title>
1795 <para>After the energies and force vectors of each fragment have
1796 been calculated, they need to be summed up to an approximation for
1797 the energy and force vectors of the whole molecular system. This is
1798 done by calling this action.</para>
1799 <programlisting>
1800 ... --analyse-fragment-results \
1801 --fragment-prefix &quot;BondFragment&quot; \
1802 --store-grids 1
1803 </programlisting>
1804 <para>The purpose of the prefix should already be known to you. The
1805 last option states that the sampled charge densities and the
1806 calculated potential from the long-range calculations should be
1807 stored with the summed up energies and forces. Note that this makes
1808 the resulting files substantially larger (Hundreds of megabyte or
1809 even gigabytes as currently the densities are stored on the full cartesian grid). Fragment energies and forces are stored in
1810 so-called internal homology containers. These are explained in the
1811 next section.</para>
1812 <para>Note that this action sets the force vector if these have been
1813 calculated for the fragment. Hence, a
1814 <link linkend="molecule.verlet-integration">verlet integration</link>
1815 is possible afterwards.</para>
1816 <note>If not obtained by
1817 <link linkend="molecule.fragment-automation">fragment automation</link>
1818 then fragment results need to be parsed from file, see
1819 <link linkend="molecule.parse-fragment-results">parse fragment results</link>
1820 .</note>
1821 </section>
1822 <section xml:id="fragmentation.store-saturated-fragment">
1823 <title xml:id="fragmentation.store-saturated-fragment.title">Store a saturated fragment</title>
1824 <para>This will store the currently selected atoms as a fragment
1825 where all dangling bonds (by atoms that are connected in the bond
1826 graph but have not been selected as well) are saturated with
1827 additional hydrogen atoms. The output formats are set to just xyz.
1828 </para>
1829 <programlisting>
1830 ... --store-saturated-fragment \
1831 --DoSaturate 1 \
1832 --output-types xyz
1833 </programlisting>
1834 </section>
1835 <section xml:id="fragmentation.parse-fragment-jobs">
1836 <title xml:id="fragmentation.parse-fragment-jobs.title">Parse fragment jobs from files</title>
1837 <para>The fragment jobs that are created by
1838 <link linkend="molecule.fragment-molecule">fragment molecule</link>
1839 may also be placed in a file for later retrieval. See the details of
1840 this action on how to create one file per job.</para>
1841 <para>Later, for parsing these job files, we need to use the parse
1842 fragment jobs action as follows:</para>
1843 <programlisting>
1844 ... --parse-fragment-jobs \
1845 --fragment-jobs &quot;BondFragment00.in&quot; &quot;BondFragment01.in&quot; \
1846 --fragment-path &quot;./&quot;
1847 </programlisting>
1848 <para>Here, we give a list of files by the first option and the second
1849 option gives an optional path where all these files are stored.</para>
1850 </section>
1851 <section xml:id="fragmentation.parse-fragment-results">
1852 <title xml:id="fragmentation.parse-fragment-results.title">Parse calculated fragment results from file</title>
1853 <para>Fragment results can either be obtained directly from
1854 solving the associated electronic structure problem for each
1855 of the fragment jobs. Or if that has been done at some earlier
1856 stage and results have been written to a file, see
1857 <link linkend="molecule.save-fragment-results">save fragment results</link>
1858 , then we may also parse these results.</para>
1859 <programlisting>
1860 ... --parse-fragment-results &quot;results.dat&quot;
1861 </programlisting>
1862 </section>
1863 <section xml:id="fragmentation.save-fragment-results">
1864 <title xml:id="fragmentation.save-fragment-results.title">Save calculated fragment results to file</title>
1865 <para>Calculated fragment results may be stored to a single file
1866 for later analysis as follows:</para>
1867 <programlisting>
1868 ... --save-fragment-results &quot;results.dat&quot;
1869 </programlisting>
1870 <note>Beware though that files from long-range calculations may be
1871 very large and are stored quite inefficiently at the moment.</note>
1872 </section>
1873 </section>
1874 <section xml:id="homology">
1875 <title xml:id="homology.title">Homologies</title>
1876 <para>After a fragmentation procedure has been performed fully, what
1877 to do with the results? The forces can be used for time integration and structure optimization but what about
1878 the energies? The energy value is basically the function evaluation of
1879 the Born-Oppenheimer surface of the molecular system. For molecular dynamics simulations
1880 continuous ab-initio calculations to evaluate the Born-Oppenheimer
1881 surface, especially the gradient at the current position of the molecular system&apos;s configuration, is not feasible. Instead usually empirical potential functions
1882 are fitted as to resemble the Born-Oppenheimer surface to a sufficient
1883 degree.</para>
1884 <para>One frequently employed method is the many-body expansion of said surface
1885 which is basically nothing else than the fragmentation ansatz described
1886 above. Potential functions resemble a specific term in this many-body
1887 expansion. These are discussed in the next section.</para>
1888 <para>For each of these terms all homologous fragments (i.e. having
1889 the same atoms with respect to the present elements and bonded in the
1890 same way), differing only in the coordinate of each atom, are just a
1891 sampling or a function evaluation of this term of the many-body
1892 expansion with respect to varying nuclei coordinates. Hence, it is
1893 appropriate to use these function evaluations in a non-linear
1894 regression procedure. That is, we want to tune the parameters of the
1895 empirical potential function in such a way as to most closely obtain
1896 the same function evaluation as the ab-initio calculation did using the
1897 same nuclear coordinates. Usually, this is done in a least-square
1898 sense, minimising the euclidean norm.</para>
1899 <para>Homologies -- in the sense used here -- are then nothing else but containers for a specific
1900 type of fragment of all the different, calculated configurations (i.e.
1901 varying nuclear coordinates of the same fragment, i.e. same atoms with identical bonding).</para>
1902 <para>Now, we explain the actions that parse and store
1903 homologies.</para>
1904 <programlisting>... --parse-homologies homologies.dat</programlisting>
1905 <para>This parses the all homologies contained in the file
1906 <filename>homologies.dat</filename> and <emphasis role="italic">appends</emphasis> them to the homology
1907 container.</para>
1908 <programlisting>... --save-homologies homologies.dat</programlisting>
1909 <para>Complementary, this stores the current contents of the homology
1910 container, <emphasis role="italic">overwriting</emphasis> the file
1911 <filename>homologies.dat</filename>.</para>
1912 </section>
1913 <section xml:id="atomfragments">
1914 <title xml:id="atomfragments.title">AtomFragments</title>
1915 <para>Similarly, to <link linkend="homology">Homologies</link> also
1916 the associations between atoms and the respective fragments they take
1917 part in can be stored to a file and parse again at a later time.</para>
1918 <programlisting>... --parse-atom-fragments atomfragments.dat</programlisting>
1919 <para>This parses the all atom fragment associattions contained in the file
1920 <filename>atomfragments.dat</filename> and <emphasis role="italic">appends</emphasis>
1921 them to the atom fragments associations container.</para>
1922 <programlisting>... --save-atom-fragments atomfragments.dat</programlisting>
1923 <para>Complementary, this stores the current contents of the atom fragments
1924 associations container, <emphasis role="italic">overwriting</emphasis> the file
1925 <filename>atomfragments.dat</filename>.</para>
1926 </section>
1927 <section xml:id="potentials">
1928 <title xml:id="potentials.title">Potentials</title>
1929 <para>In much the same manner as we asked before: what are homology
1930 files or containers good for? However, taking into account what we have just explained, it
1931 should be clear: We fit potential function to these function
1932 evaluations of terms of the many-body expansion of the Born-Oppenheimer
1933 surface of the full system.</para>
1934 <section xml:id="potentials.fit-potential">
1935 <title xml:id="potentials.fit-potential.title">Fitting empirical potentials</title>
1936 <para>Let&apos;s take a look at an exemplary call to the fit potential
1937 action.</para>
1938 <programlisting>
1939 ... --fit-potential \
1940 --fragment-charges 8 1 1 \
1941 --potential-charges 8 1 \
1942 --potential-type morse \
1943 --take-best-of 5
1944 </programlisting>
1945 <para>Again, we look at each option in turn. The first is the
1946 charges or elements specifying the set of homologous fragments that
1947 we want to look at. Here, obviously we are interested in water
1948 molecules, consisting of a single oxygen (8) and two hydrogen atoms (1).
1949 Next, we specify the chemical element type of the potential, here a potential between oxygen (8) and hydrogen (1). We give
1950 the type of the potential as morse, which requires a single distance
1951 or two nuclear coordinates and the distance taken between the two. Finally, we state that the non-linear regression should be
1952 done with five random starting positions, i.e. five individual minimizations, and the set of parameters
1953 with the smallest L2 norm wins.</para>
1954 <note>
1955 <para>Due to translational and rotational degrees of freedom for
1956 fragments smaller than 7 atoms, it is appropriate to look at the
1957 pair-wise distances and not at the absolute coordinates. Hence,
1958 the two atomic positions, here for oxygen and hydrogen, are
1959 converted to a single distance. If we had given an harmonic
1960 angular potential and the then required three charges/elements, &quot;8 1 1&quot;, i.e. oxygen
1961 and two hydrogens, we would have obtained three distances.</para>
1962 <para>MoleCuilder always adds a so-called constant potential to
1963 the fit containing only a single parameter, the energy offset.
1964 This offset compensates for the interaction energy associated with
1965 a fragment of order 1, e.g. a single hydrogen atom. Essentially, this captures the atomic energy that is not associated to any bonding interactions.</para>
1966 <para>Note that by choosing "set-max-iterations" and "take-best-of"
1967 one can force the optimization to try either a single set of random
1968 initial parameters very thoroughly or many different sets just for
1969 a few iterations. Or any in between.</para>
1970 </note>
1971 </section>
1972 <section xml:id="potentials.fit-compound-potential">
1973 <title xml:id="potentials.fit-compound-potential.title">Fitting many empirical potentials simultaneously</title>
1974 <para>Another way is using a file containing a specific set of
1975 potential functions, possibly even with initial values.</para>
1976 <programlisting>
1977 ... --fit-compound-potential \
1978 --fragment-charges 8 1 1 \
1979 --potential-file water.potentials \
1980 --set-threshold 1e-3 \
1981 --training-file test.dat
1982 </programlisting>
1983 <para>Now, all empirical potential functions are summed up into a
1984 so-called compound potential over the combined set of parameters.
1985 These are now fitted simultaneously. For example, let&apos;s say the potential
1986 file <filename>water.potentials</filename> contains a harmonic bond
1987 potential between oxygen and hydrogen and another angular potential
1988 for the angle between hydrogen, oxygen, and hydrogen atom. Then, we would
1989 fit a function consisting of the sum of the two potentials functions in order to approximate the energy of a single
1990 water molecule (actually, it&apos;s the sum of three potentials. As mentioned before, a constant potential is always added to compensate non-bonding energies, i.e. not depending on interatomic distances). Here, the threshold criterion takes the place of the
1991<emphasis role="bold"> take-best-of</emphasis> option. Here, the minimization is reiterated so often on random (but to some extent chosen from a sensible range) starting parameters until the final L2 error is below 1e-3. Also, all data used
1992 for training, i.e. the tuples consisting of the fragments nuclei
1993 coordinates and the associated energy value are written to the file
1994 <filename>test.dat</filename>. This allows for graphical representation or other
1995way of analysis, e.g. for a Morse potential between oxygen and hydrogen the bonding energy can be plotted as a one-dimensional function and compared to the &quot;point cloud&quot; of sample points from the fragment term of Born-Oppenheimer surface. It is this point cloud, i.e. the training data, that is written to the file
1996 <filename>test.dat</filename>.</para>
1997 <para>Note that you can combine the two ways, i.e. start with a
1998 fit-potential call but give an empty potential file. The resulting
1999 parameters are stored in it. Fit other potentials and give different
2000 file names for each in turn. Eventually, you have to combine the file
2001 in a text editor at the moment. And perform a fit-compound-potential
2002 with this file.</para>
2003 <para>Here, also "set-max-iterations" and "take-best-of" can be used
2004 to mix thorough or shallow search from random initial parameter sets.
2005 </para>
2006 </section>
2007 <section xml:id="potentials.parse-potential">
2008 <title xml:id="potentials.parse-potential.title">Parsing an empirical potentials file</title>
2009 <para>Taking part in the compound potential is every potential
2010 function whose signature matches with the designated fragment-charges
2011 and who is currently known to MoleCuilder.</para>
2012 <para>More potentials can be registered (<emphasis role="bold">fit-potential</emphasis> will also
2013 register the potential it fits) by parsing them from a file.</para>
2014 <programlisting>
2015 ... --parse-potentials water.potentials
2016 </programlisting>
2017 <note>Currently, only <productname>TREMOLO</productname>potential files are understood and can be parsed.</note>
2018 </section>
2019 <section xml:id="potentials.save-potential">
2020 <title xml:id="potentials.save-potential.title">Saving an empirical potentials file</title>
2021 <para>The opposite to <emphasis role="bold">parse-potentials</emphasis> is to save all currently registered potential functions to the given
2022 file along with the currently fitted parameters</para>
2023 <programlisting>
2024 ... --save-potentials water.potentials
2025 </programlisting>
2026 <note>Again, only the <productname>TREMOLO</productname>potential format is understood currently and is written.</note>
2027 </section>
2028 <section xml:id="potentials.fit-partial-charges">
2029 <title xml:id="potentials.fit-partial-charges.title">Fitting partial particle charges</title>
2030 <para>The above empirical potential just model the short-range
2031 behavior in the molecular fragment, namely the (covalently) bonded interaction.
2032 In order to model the Coulomb long-range interaction as well without solving
2033 for the electronic ground state in each time step, partial charges
2034 are used that capture to some degree the created dipoles due to
2035 charge transfer from one atom to another when bonded. These are called
2036 partial charges because they combine both nuclei and electronic
2037 charges to yield an in general fractional charge.</para>
2038 <para>Note that so far the placement of partial charges is restricted
2039 to the position of nuclei in the molecular system. There are more
2040 complex ways of placing partial charges, e.g. as employed in higher
2041 TIP water molecules, that also use anti-bonding potentials. This is
2042 so far not implemented.</para>
2043 <para>To allow least-squares regression of these partial charges, we
2044 need the results of long-range calculations and the <emphasis role="bold">store-grids</emphasis>
2045 option (see above under <link linkend="fragmentation">Fragmentation </link>)
2046 must have been given.</para>
2047 <para>Furthermore, we require associations between selected atoms and
2048 the fragments, residing in the <link linkend="homology">Homology container</link>.
2049 These are contained in the <link linkend="atomfragments">AtomFragments association</link>
2050 container, that can also be parsed and stored.</para>
2051 <para>With these sampled charge density and Coulomb potential stored
2052 in the homology containers, we call this action as follows.</para>
2053 <programlisting>
2054 ... --fit-partial-charges \
2055 --potential-file water.particles \
2056 --radius 1.5
2057 </programlisting>
2058 <para>Assume that a water molecule has been selected previously. Then
2059 all homologous fragments that contain any of the water molecules are
2060 used as &quot;key&quot; to request all configurations of this type
2061 from the homologies container. For each of the atoms then an average
2062 partial charge is computed by fitting their respective Coulomb
2063 potential to the obtained from the fragment calculations. Resulting
2064 values are stored in <filename>water.particles</filename>. The
2065 radius is used to mask a certain region directly around the nuclei
2066 from the fit procedure. As here the charges of the core electrons and
2067 the nuclei itself dominate, we however are only interested in a good
2068 approximation to the long-range potential, this mask radius allows
2069 to give the range of the excluded zone.</para>
2070 </section>
2071 <section xml:id="potentials.parse-particle-parameters">
2072 <title xml:id="potentials.parse-particle-parameters.title">Parsing a particles file</title>
2073 <para>Empirical Potential contain parameters for function that model
2074 interactions between two or more specific particles. However,
2075 interactions can also be more general, such as a Coulomb
2076 potential, that interacts with any other particle with non-zero
2077 charge, or Lennard-Jones potential that interacts with any other
2078 particle close enough.
2079 Parameters for these particles are encoded in the internal Particle
2080 class and are parsed from and stored to a special particles file.
2081 This parse particle parameters function loads the parameters from
2082 a file, instantiates them in a new particle, and registers them
2083 such that they are known within molecuilder.</para>
2084 <para>More particles can be registered (<emphasis role="bold">fit-partial-charges</emphasis> will also
2085 register the particles it fits) by parsing them from a file.</para>
2086 <programlisting>
2087 ... --parse-particle-parameters water.particles
2088 </programlisting>
2089 <note>Currently, only <productname>TREMOLO</productname>particles files are understood and can be parsed.</note>
2090 </section>
2091 <section xml:id="potentials.save-particle-parameters">
2092 <title xml:id="potentials.save-particle-parameters.title">Saving a particles file</title>
2093 <para>The opposite to <emphasis role="bold">parse-particle-parameters</emphasis>
2094 is to save all currently registered particle and their parameters to
2095 the given file.</para>
2096 <programlisting>
2097 ... --save-particle-parameters water.particles
2098 </programlisting>
2099 <note>Again, only the <productname>TREMOLO</productname>particles format is understood currently and is written.</note>
2100 </section>
2101 </section>
2102 <section xml:id="dynamics">
2103 <title xml:id="dynamics.title">Dynamics</title>
2104 <para>For fitting potentials or charges we need many homologous but
2105 different fragments, i.e. atoms with slightly different positions.
2106 How can we generate these?</para>
2107 <para>One possibility is to use molecular dynamics. With the
2108 aforementioned fragmentation scheme we can quickly calculate not only
2109 energies but also forces if the chosen solver, such as
2110 <link xlink:href="http://www.mpqc.org/">
2111 <productname>MPQC </productname>
2112 </link>, supports it. Integrating these forces
2113 discretely over time gives insight into vibrational features of a
2114 molecular system close to the equilibrium and allows to generate those positions for fitting
2115 potentials that describe these vibrations.</para>
2116 <section xml:id="dynamics.molecular-dynamics">
2117 <title xml:id="dynamics.molecular-dynamics.title">Molecular dynamics </title>
2118 <para>The molecular dynamics action is a so-called macro Action,
2119 i.e. it combines several other Actions into one, namely:</para>
2120 <itemizedlist>
2121 <listitem>
2122 <para>--<emphasis role="bold">verlet-integration</emphasis></para>
2123 </listitem>
2124 <listitem>
2125 <para>--<emphasis role="bold">output</emphasis></para>
2126 </listitem>
2127 <listitem>
2128 <para>--<emphasis role="bold">clear-fragment-results</emphasis></para>
2129 </listitem>
2130 <listitem>
2131 <para>--<emphasis role="bold">destroy-adjacency</emphasis></para>
2132 </listitem>
2133 <listitem>
2134 <para>--<emphasis role="bold">create-adjacency</emphasis></para>
2135 </listitem>
2136 <listitem>
2137 <para>--<emphasis role="bold">update-molecules</emphasis></para>
2138 </listitem>
2139 <listitem>
2140 <para>--<emphasis role="bold">fragment-molecule</emphasis></para>
2141 </listitem>
2142 <listitem>
2143 <para>--<emphasis role="bold">fragment-automation</emphasis></para>
2144 </listitem>
2145 <listitem>
2146 <para>--<emphasis role="bold">analyse-fragment-results</emphasis></para>
2147 </listitem>
2148 </itemizedlist>
2149 <para>The following command will perform a molecular dynamics simulation
2150 for 100 time steps, each time step continuing over <emphasis role="bold">deltat</emphasis> equal to 0.5 atomic time units,
2151 i.e. 1.2e-17 s. Some of the other options listed below, such as <emphasis role="bold">order</emphasis>, <emphasis role="bold">distance</emphasis>, or <emphasis role="bold">fragment-executable</emphasis>, will seem familiar
2152 to you if you have read in this guide about the fragmentation actions. Look at the list above to see that they are a part of the makro action that performs molecular dynamics simulations. Below
2153 we will not keep the bond graph, i.e bonds and molecules may change
2154 over the simulation and hence also the created fragments per time
2155 step.
2156Furthermore, the forces are corrected such that the force add up to zero. </para>
2157 <programlisting>
2158 ... --molecular-dynamics \
2159 --steps 100 \
2160 --keep-bondgraph 0 \
2161 --order 3 \
2162 --distance 3. \
2163 --deltat 0.5 \
2164 --keep-fixed-CenterOfMass 1 \
2165 --fragment-executable mpqc \
2166 </programlisting>
2167 <para>Keeping the bond graph is useful when simulating close to the equilibrium and no bond breaking or forming should occur. Note that in general the BOSSANOVA fragmentation scheme is discontinuous with respect to the formation of bonds in the energy. This discontinuity arrises because of the threshold criterion used for detecting the bond graph. After each simulation step the bond graph is recreated (if <emphasis role="bold">keep-bondgraph</emphasis> is switched off) to accomodate for any structural changes. If bonds are added because two atoms are suddenly within the required distance which before was not the case, additional fragments are generated, calculated, and added to the approximation of the whole system. As the addition of these contributions is sudden -- in general, they will already be non-zero when the bonds are detected -- a slight jump in the total energy of the system can be expected.</para>
2168 <para>To sum it up, the use of the BOSSANOVA scheme in bond breaking/forming scenarios is in general not recommended. That&apos;s why keeping the bond graph is always sensible. However, if potential energies are too far away from equilibrium the simulation may still produce unphysical results.</para>
2169 </section>
2170 <section xml:id="dynamics.optimize-structure">
2171 <title xml:id="dynamics.optimize-structure.title">Structure optimization</title>
2172 <para>Structure optimization is also a macro Action, it basically
2173 combines the same Actions as <emphasis role="bold">molecular-dynamics</emphasis> does. However, it
2174 uses the <emphasis role="bold">force-annealing</emphasis> action instead of <emphasis role="bold">verlet-integration</emphasis>.</para>
2175 <para>The command below performs a structure optimization of the
2176 currently selected atoms (may also be a subset) for up to 100 time
2177 steps, where each time step is again 0.5 atomic time units. The time
2178 step here serves as the initial step width for annealing.
2179 </para>
2180 <programlisting>
2181 ... --optimize-structure \
2182 --keep-bondgraph 1 \
2183 --output-every-step 1 \
2184 --steps 100 \
2185 --order 3 \
2186 --distance 3. \
2187 --deltat 0.5 \
2188 --keep-fixed-CenterOfMass 1 \
2189 --fragment-executable mpqc \
2190 </programlisting>
2191 <para>Note that <emphasis role="bold">output-every-step</emphasis> will allow you to watch the
2192 optimization as each step is placed into a distinct time step.
2193 Otherwise only two time steps would be created: the initial and
2194 the final one containing the optimized structure.</para>
2195 </section>
2196 <section xml:id="dynamics.step-world-time">
2197 <title xml:id="dynamics.step-world-time.title">Step forward and backward through world time</title>
2198 <para>Some MacroActions are applied for a number of steps and need to
2199 increment the current world time, e.g. molecule dynamics or structure
2200 optimization. To this end, we may call upon
2201 </para>
2202 <programlisting>... --step-world-time 1</programlisting>
2203 <para>Note that the argument gives the number of steps to step forward
2204 and may be any integer. Hence, we may also step backwards.</para>
2205 </section>
2206 <section xml:id="dynamics.set-world-time">
2207 <title xml:id="dynamics.set-world-time.title">Set the world&apos;s time step</title>
2208 <para>In order to inspect or manipulate atoms and molecules at a
2209 certain time step, the World&apos;s time has to be set with the following
2210 Action.
2211 </para>
2212 <para>This will set the World&apos;s time to the fifth step (counting
2213 starts at zero).</para>
2214 <programlisting>... --set-world-time 4</programlisting>
2215 <para>Note that each atom has its own tracjectory storage and manages it in a clever way. That&apos;s why subsets of atoms may be time-integrated, while the other atoms will not get taken over on the time axis. They simply remain frozen during the integration.</para>
2216 </section>
2217 <section xml:id="dynamics.save-temperature">
2218 <title xml:id="dynamics.save-temperature.title">Save the temperature information</title>
2219 <para>For each present time step the temperature (i.e. the average velocity
2220 per atom multiplied with its mass) will be stored to a file.</para>
2221 <programlisting> ... --save-temperature temperature.dat</programlisting>
2222 <para>That is <emphasis role="italic">temperature.dat</emphasis> contains two columns: the first contains the time step and the second column contains the temperature of the system in atomic units.</para>
2223 </section>
2224 </section>
2225 <section xml:id="dynamics.tesselation">
2226 <title xml:id="dynamics.tesselation.title">Tesselations</title>
2227 <para>A tesselation is a set of triangles that form a closed surface. They are used to obtain molecular surfaces (and volumes) by rolling
2228 a virtual sphere of a certain radii on a molecule such that it always rests on at least three atoms. From such a resting position the sphere is rolled over all of its three sides until it rests again. This is continued until the closed
2229 surface of connected triangles is created.</para>
2230 <para>Note that tesselations are used internally by the graphical interface in order to show molecules by their surface. This is in general faster than displaying them as a ball-stick model consisting of spheres and cylinders.</para>
2231 <section xml:id="dynamics.tesselation.nonconvex-envelope">
2232 <title xml:id="dynamics.tesselation.nonconvex-envelope.title"> Non-convex envelope</title>
2233 <para>This will create a non-convex envelope for a molecule and store
2234 it to a file for viewing with external programs.</para>
2235 <programlisting>
2236 ... --nonconvex-envelope 6. \
2237 --nonconvex-file nonconvex.dat
2238 </programlisting>
2239 <para>This tesselation file can be conveniently viewed with
2240 <productname>TecPlot</productname> or with one of the Tcl script
2241 in the <emphasis role="italic">util</emphasis> folder with <productname>VMD</productname>. Also,
2242 still pictures can be produced with <productname>Raster3D </productname>.
2243 <note>The required file header.r3d can be found in a subfolder of the util folder.</note>
2244 </para>
2245 </section>
2246 <section xml:id="dynamics.tesselation.convex-envelope">
2247 <title xml:id="dynamics.tesselation.convex-envelope.title">Convex envelope</title>
2248 <para>This will create a convex envelope for a molecule and give the
2249 volumes of both the non-convex and the convex envelope. This is good
2250 for measuring the space a molecule takes up, e.g. when filling a
2251 domain and taking care of correct densities.</para>
2252 <programlisting>
2253 ... --convex-envelope 6. \
2254 --convex-file convex.dat
2255 </programlisting>
2256 <para>This tesselation file can be likewise viewed with
2257 <productname>TecPlot</productname> or with one of the Tcl script
2258 in the util folder with <productname>VMD</productname>.</para>
2259 </section>
2260 </section>
2261 <section xml:id="various">
2262 <title xml:id="various.title">Various commands</title>
2263 <para>Here, we gather all commands that do not fit into one of above
2264 categories for completeness.</para>
2265 <section xml:id="various.verbose">
2266 <title xml:id="various.verbose.title">Changing verbosity</title>
2267 <para>The verbosity level is the amount of stuff printed to screen.
2268 This information will in general help you to understand when
2269 something does not work. Mind the <emphasis>ERROR</emphasis> and
2270 <emphasis>WARNING</emphasis> messages in any case.</para>
2271 <para>This command below sets the verbosity from default of 2 to 4,</para>
2272 <programlisting>... --verbose 4</programlisting>
2273 <para>or shorter,</para>
2274 <programlisting>... -v 4</programlisting>
2275 </section>
2276 <section xml:id="various.dry-run">
2277 <title xml:id="various.dry-run.title">Dry runs</title>
2278 <para>A &quot;dry run&quot; refers to a test run where commands are not
2279 actually executed. You may bracket a certain set of actions by
2280 putting --<emphasis role="bold">dry-run</emphasis> before and --<emphasis role="bold">no-dry-run</emphasis> afterwards. Then, all
2281 actions in between will be looked at but not executed, i.e. they
2282 make it to the history but nothing is changed in the World.</para>
2283 <para>As an example, the following listing contains the adding of a
2284 hydrogen atom at position (5,5,5) inside the aforementioned dry run
2285 statements. Hence, no hydrogen atom is added but the <emphasis role="bold">add-atom</emphasis> action is
2286 stored in the history and will make it to a stored session.</para>
2287 <programlisting> ... --dry-run \
2288 --add-atom 1 --domain-position &quot;5,5,5&quot;
2289 --no-dry-run</programlisting>
2290 <para>This is useful for converting shell commands into python scripts. Commands are not executed but all are eventually found in the written pyrthon file.</para>
2291 </section>
2292 <section xml:id="various.element-db">
2293 <title xml:id="various.element-db.title">Loading an element database</title>
2294 <para>Element databases contain information on valency, van der
2295 Waals-radii and other information for each element.</para>
2296 <para>This loads all element database from the current folder (in a
2297 unix environment):</para>
2298 <programlisting>... --element-db ./</programlisting>
2299 </section>
2300 <section xml:id="various.fastparsing">
2301 <title xml:id="various.fastparsing.title">Fast parsing</title>
2302 <para>Parsing all time steps from a given input file can take a
2303 while, especially for larger systems. If fast parsing is activated,
2304 only the first time step is loaded, all other are ignored.</para>
2305 <programlisting>... --fastparsing 1</programlisting>
2306 </section>
2307 <section xml:id="various.version">
2308 <title xml:id="various.version.title">Giving the version of the program</title>
2309 <para>This prints the version information of the code, especially
2310 important when you request the fixing of bugs or implementation of
2311 features.</para>
2312 <programlisting>... --version</programlisting>
2313 </section>
2314 <section xml:id="various.warranty">
2315 <title xml:id="various.warranty.title">Giving warranty information</title>
2316 <para>As follows warranty information is given,</para>
2317 <programlisting>... --warranty</programlisting>
2318 </section>
2319 <section xml:id="various.help-redistribute">
2320 <title xml:id="various.help-redistribute.title">Giving redistribution information</title>
2321 <para>This gives information on the license and how to redistribute
2322 the program and its source code</para>
2323 <programlisting>... --help-redistribute</programlisting>
2324 </section>
2325 </section>
2326 <section xml:id="sessions">
2327 <title xml:id="sessions.title">Sessions</title>
2328 <para>A session refers to the queue of actions you have executed.
2329 Together with the initial configuration (and all files required for
2330 actions in the queue) this may be seen as a clever way of storing
2331 the state and history of a molecular system manipulation session. When proceeding in a try&amp;error
2332 fashion to construct a certain system, it is a good idea, to store the
2333 session at the point where your attempts start to deviate from one
2334 another.</para>
2335 <para>Note only that but stored session used in the graphical interface may safe a lot of repetitive pointing and clicking. On top of that if the python session file is called <emphasis role="italic">molecuilder.py</emphasis> and resides in the folder you start MoleCuilder from, then it will be executed automatically and even before creating the graphical interface (i.e. it is also faster).</para>
2336 <section xml:id="sessions.store-session">
2337 <title xml:id="sessions.store-session.title">Storing a session </title>
2338 <para>Storing sessions is simple,</para>
2339 <programlisting>
2340 ... --store-session &quot;session.py&quot; \
2341 --session-type python
2342 </programlisting>
2343 <para>Here, the session type is given as python (the other option is
2344&quot; cli&quot; for storing in the manner of the command-line interface, i.e. just as our example code snippets throughout this guide). The written
2345 python script <filename>session.py</filename> can even be used with
2346 the python interface described below, i.e. it is a full python script
2347 (that however requires the so-called <emphasis role="italic">pyMoleCuilder</emphasis> module).</para>
2348 </section>
2349 <section xml:id="sessions.load-session">
2350 <title xml:id="sessions.load-session.title">Loading a session</title>
2351 <para>Loading a session only works for python scripts, i.e. only for session type python and not for type cli. This actually
2352 blurs the line between the command-line interface and the python
2353 interface a bit. Again, MoleCuilder automatically executes a
2354 script called <filename>molecuilder.py</filename> if such a file is
2355 contained in the current directory.</para>
2356 <programlisting>... --load-session &quot;session.py&quot;</programlisting>
2357 <para>This will execute every action with its options contained in the
2358 script <filename>session.py</filename>.</para>
2359 </section>
2360 </section>
2361 <section xml:id="various-specific">
2362 <title xml:id="various-specific.title">Various specific commands </title>
2363 <para>In this (final) section of the action description we list a number
2364 Actions that are very specific to some purposes (or other programs).
2365 </para>
2366 <section xml:id="various-specific.save-selected-atoms-as-exttypes">
2367 <title xml:id="various-specific.save-selected-atoms-as-exttypes.title"> Saving exttypes of a set of atoms</title>
2368 <para>This saves the atomic ids of all currently selected atoms in a
2369 <link xlink:href="http://www.tremolo-x.com/">
2370 <productname>TREMOLO </productname>
2371 </link> exttypes file with the given name.</para>
2372 <programlisting>
2373 ... --save-selected-atoms-as-exttypes \
2374 --filename test.exttypes </programlisting>
2375 </section>
2376 <section xml:id="various-specific.set-parser-parameters">
2377 <title xml:id="various-specific.set-parser-parameters.title">Setting parser specific parameters</title>
2378 <para>You can tweak the parameters stored in files associated to specific ab initio programs to some extent.
2379 For example, <productname>MPQC</productname> stores various
2380 parameters modifying the specific ab-initio calculation performed, e.g. the basis set used, the level of theory, whether gradients are calculated.
2381 For <link xlink:href="http://www.mpqc.org/">
2382 <productname>MPQC </productname>
2383 </link> and
2384 <link xlink:href="http://www.psicode.org/">
2385 <productname>Psi4 </productname>
2386 </link> this can be modified as follows.</para>
2387 <programlisting>
2388 ... --set-parser-parameters mpqc \
2389 --parser-parameters &quot;theory=CLHF;basis=6-31*G;&quot;
2390 </programlisting>
2391 <para>This sets the ab-initio theory to closed-shell Hartree-Fock
2392 and the basis set to 6-31*G. Note the specific &quot;key=value;&quot; system. That is a key such as &quot;theory&quot; is followed by an equivalent sign and by a value, here &quot;CLHF&quot; for closed-shell Hartree-Fock, and finally a semicolon to separate the key-value pairs. Please avoid any unnecessary white spaces. Note that the implementation is probably not complete, hence do check the
2393 <productname>MPQC</productname> manual on further supported values that must be added by hand. We list below the currently implementd list of keys and their values.</para>
2394 <itemizedlist>
2395 <listitem>theory</listitem>
2396 <listitem>basis</listitem>
2397 </itemizedlist>
2398 </section>
2399 <section xml:id="various-specific.set-tremolo-atomdata">
2400 <title xml:id="various-specific.set-tremolo-atomdata.title">Tremolo specific options and potential files</title>
2401 <para><productname>TREMOLO</productname>&apos;s configuration files start
2402 with a specific line telling the amount of information that is contained in the
2403 file. This line can be modified, e.g. to enforce storing of
2404 velocities and forces as well as the atoms positions and
2405 element.</para>
2406 <programlisting>
2407 ... --set-tremolo-atomdata &quot;ATOM id element u=3 v=3 F=3&quot; \
2408 --reset 1
2409 </programlisting>
2410 <para>This will not append but reset the old line and fill it with
2411 the given string.</para>
2412 <para>One further specific action is required when loading certain
2413 <productname>TREMOLO</productname> configuration files. These
2414 contain element notations that refer to parameterized names used in
2415 empirical potentials and molecular dynamics simulations and not the
2416 usual chemical symbols, such as H or O. We may load an auxiliary
2417 file that gives the required conversion from OH1 to H, which is the
2418 so-called potentials file.</para>
2419 <programlisting>... --parse-tremolo-potentials water.potentials</programlisting>
2420 <para>This parses the lookup table from the file
2421 <filename>water.potentials</filename> and it can be used in
2422 following load actions.</para>
2423 <para>Note that this is the same format as written by the fitting actions. However, apart from this the Actions are not related, i.e. <emphasis role="bold">parse-potentials</emphasis> will not also load these element descriptions. If this is desired, the above Action has to be used.</para>
2424 </section>
2425 </section>
2426 </section>
2427 <section xml:id="textmenu-interface">
2428 <title xml:id="textmenu-interface.title">Text menu</title>
2429 <para>We now discuss how to use the text menu interface.</para>
2430 <para>The text menu is very much the interface counterpart to the
2431 command-line interface. However, both work in a terminal session.</para>
2432 <para>In the text menu, actions can be selected from hierarchical lists.
2433 Note that the menus for the graphical interface are organized in the
2434 exactly same way. After an action has been chosen, the option values
2435 have to be entered one after the other. After the last option value has
2436 been given, the action is executed and the result printed to the
2437 screen.</para>
2438 <para>With regards to the other functionality, it is very much the same
2439 as the command-line interface above. It differs by being interactive, i.e. when using an external viewer on the state file and saving it after an Action has been performed, output can be checked. However, you may work in this way also directly by using the graphical interface.</para>
2440 </section>
2441 <section xml:id="graphical-user-interface">
2442 <title xml:id="graphical-user-interface.title">Graphical user interface </title>
2443 <para>The main point of the GUI is that it renders the atoms and
2444 molecules visually. These are represented by the common
2445 stick-and-ball-model by default. For faster rendering, molecules can also be visualized by the a non-convex envelope, see Tesselations. Single or multiple atoms and molecules can easily
2446 be accessed, activated, and manipulated via tables. Changes made in the
2447 tables cause immediate update of the visual representation. Under the
2448 hood each of these manipulations is nothing but the call to an action,
2449 hence is fully undo- and redoable.</para>
2450 <para>This interface is most helpful in designing more advanced structures that are
2451 conceptually difficult to imagine without visual aid. Results can be inspected directly and, if unsuitable, can be undone and reperformed with tweaked parameters. At the end, a
2452file containing the session may be stored and this script can then be used to construct
2453 various derived or slightly modified structures.</para>
2454 <section xml:id="graphical-user-interface.basic-view">
2455 <title xml:id="graphical-user-interface.basic-view.title">Basic view </title>
2456 <para>Let us first give an impression of the basic view of the GUI after a molecule has been loaded.</para>
2457 <figure>
2458 <title>Screenshot of the basic view of the GUI after loading a file with eight water molecules.</title>
2459 <mediaobject>
2460 <imageobject>
2461 <imagedata width="100%" scalefit="1" entityref="example_basic_view"/>
2462 </imageobject>
2463 </mediaobject>
2464 </figure>
2465 <section xml:id="graphical-user-interface.3d-view">
2466 <title xml:id="graphical-user-interface.3d-view.title">3D view </title>
2467 <para>In the above figure, you see the stick-and-ball representation
2468 of the water molecules, the &quot;dreibein&quot; giving the positive axis
2469 directions and the slightly translucent cuboid of the domain on a black background.</para>
2470 </section>
2471 <section xml:id="graphical-user-interface.information-tabs">
2472 <title xml:id="graphical-user-interface.information-tabs.title"> Information Tabs</title>
2473 <para>Beneath this 3D view that you can rotate at will with your mouse
2474 and zoom in and out with your scroll wheel, you find to the right a
2475 part containing two tabs named Atom and Molecule. Look at where the
2476 mouse pointer is. It has colored the atom underneath in cyan
2477 (although it&apos;s also an oxygen atom and should be colored in rose
2478 as the rest). You can inspect its properties in the tab Atom: Name,
2479 element, mass, charge, position and number of bonds. If you switch
2480 to the Molecule tab, you would see the properties of the water
2481 molecule this specific atom belongs to.</para>
2482 </section>
2483 <section xml:id="graphical-user-interface.shape">
2484 <title xml:id="graphical-user-interface.shape.title">Shape section </title>
2485 <para>Beneath these information tabs you find the shape sections.
2486 There you find a list of all currently created shapes and you can
2487select them by clicking on them, which lets their surface appear in the 3D view, and manipulate them via the buttons beneath this list. Note that the calculation of the shape&apos;s surface may take up to a few seconds, so don&apos;t get itchy right away when nothing seems to happen for a moment.</para>
2488 </section>
2489 <section xml:id="graphical-user-interface.timeline">
2490 <title xml:id="graphical-user-interface.timeline.title">Timeline </title>
2491 <para>Directly below the 3D view there is a long slider. If a loaded
2492 file has multiple time step entries, this slider allows you to
2493 smoothly select one time frame after another. Sliding it with the
2494 mouse from left to right will reveal the animation that is hidden
2495 behind the distinct snapshots stored in the configuration
2496 file.</para>
2497 </section>
2498 <section xml:id="graphical-user-interface.tables">
2499 <title xml:id="graphical-user-interface.tables.title">Selection tables</title>
2500 <para>Underneath the time line there is another place for
2501 tabs.</para>
2502 <itemizedlist>
2503 <listitem>Molecules</listitem>
2504 <listitem>All Elements</listitem>
2505 <listitem>All Fragments</listitem>
2506 <listitem>All Homologies</listitem>
2507 <listitem>All Geometries</listitem>
2508 <listitem>Logs</listitem>
2509 <listitem>Errors</listitem>
2510 </itemizedlist>
2511 <para>The first is on molecules, listing all present molecules of
2512 the molecular system in a tree view. If you click on a specific
2513 molecule, the one will get selected or unselected depending on its
2514 current selection state (see below for details on this with respect
2515 to the GUI). Also, if you tick the box the visibility of the specific molecules is changed: it switches between being displayed as either ball-and-stick, for manipulating its individual atoms, or as a molecular surface for (un)selecting it as a whole.</para>
2516 <para>The next tab enumerates all elements known to MoleCuilder
2517 where the ones are grayed out that are not present in the molecular
2518 system. Clicking on a present element will select all atoms of this
2519 specific element. A subsequent click unselects again.</para>
2520 <para>Subsequently follow two tabs on enumerating the fragments and their
2521 fragment energies if calculated and the homologies along with
2522 graphical depiction (via QWT), again if present.</para>
2523 <para>After that, we have a tab listing all geometry objects. These
2524 are vectors you may store via one of the Actions. If you hover over
2525 a vector, its length is shown. If you have selected one vector and
2526 hover over another one, then the angle between the two is shown.
2527 </para>
2528 <para>Finally, there are two tabs showing log messages of actions
2529 in the first tab and general information on what is currently done. Errors and
2530 warnings are listed in the second tab.</para>
2531 </section>
2532 </section>
2533 <section xml:id="graphical-user-interface.selections">
2534 <title xml:id="graphical-user-interface.selections.title">Selections </title>
2535 <para>Selections work generally always by calling a selection action from the pull-down menu and filling it with required parameters.</para>
2536 <para>With the GUI it may also be accessed directly: The row of icons
2537 above the 3D view has two icons depicting the selection of individual
2538 atoms or molecules. If either of them is selected, clicking with the
2539 left mouse button on an atom will either (un)select the atom or its
2540 associated molecule. Multiple atoms can be selected in this
2541 manner.</para>
2542 <para>Also, the selection tabs may be used by clicking on the name of a
2543 molecule as stated above or at an element.</para>
2544 <para>Similarly, if shapes are present in the shape section, clicking
2545 them will select them and also cause a translucent visualization to
2546 appear in the 3D view. Note that this visualization is quite costly
2547 right now and not suited to complex shapes. (This is in contrast to the molecular surfaces which are actually cheaper than the ball-and-stick presentation).</para>
2548 </section>
2549 <section xml:id="graphical-user-interface.dialogs">
2550 <title xml:id="graphical-user-interface.dialogs.title">Dialogs</title>
2551 <para>Most essential to the GUI are dialogs. Many action
2552 calls forth such a dialog. A dialog consists of a list of queries for a particular option value, one below the other. As each option
2553 value has a specific type, we briefly go into the details of how these
2554 queries look like.</para>
2555 <note>
2556 <para>Each dialog&apos;s okay button is grayed out until all entered option values
2557 are valid.</para>
2558 </note>
2559 <section xml:id="graphical-user-interface.dialogs.domain">
2560 <title xml:id="graphical-user-interface.dialogs.domain.title">Domain query</title>
2561 <figure>
2562 <title>Screenshot of a dialog showing a domain query</title>
2563 <mediaobject>
2564 <imageobject>
2565 <imagedata width="100%" scalefit="1" entityref="dialog_box"/>
2566 </imageobject>
2567 </mediaobject>
2568 <para>In the domain query a 3x3 symmetric matrix has to be
2569 entered. In the above screenshots you notice that the only
2570 non-zero entries are on the main diagonal. Here, we have simply
2571 specified a cube of edge length 8. The okay button will be grayed
2572 out if the matrix is either singular or not symmetric.</para>
2573 </figure>
2574 </section>
2575 <section xml:id="graphical-user-interface.dialogs.element">
2576 <title xml:id="graphical-user-interface.dialogs.element.title"> Element query</title>
2577 <figure>
2578 <title>Screenshot the add atom action containing an element query</title>
2579 <mediaobject>
2580 <imageobject>
2581 <imagedata width="100%" scalefit="1" entityref="dialog_add-atom_tooltip"/>
2582 </imageobject>
2583 </mediaobject>
2584 <para>Elements are picked from a pull-down box where all known
2585 elements are listed.</para>
2586 <para>In this dialog you also notice that a tooltip is given,
2587 briefly explaining what the action does.</para>
2588 </figure>
2589 </section>
2590 <section xml:id="graphical-user-interface.dialogs.action">
2591 <title xml:id="graphical-user-interface.dialogs.action.title"> Complex query</title>
2592 <figure>
2593 <title>Screenshot of a complex dialog consisting of multiple queries</title>
2594 <mediaobject>
2595 <imageobject>
2596 <imagedata width="100%" scalefit="1" entityref="dialog_complex"/>
2597 </imageobject>
2598 </mediaobject>
2599 <para>Here we show a more complex dialog. It queries for strings,
2600 for integer values (see the increase/decrease arrows), for
2601 booleans and for files (the &quot;choose&quot; buttons opens a file
2602 dialog).</para>
2603 </figure>
2604 </section>
2605 <section xml:id="graphical-user-interface.dialogs.exit">
2606 <title xml:id="graphical-user-interface.dialogs.exit.title">Exit query</title>
2607 <figure>
2608 <title>Screenshort showing the exit dialog</title>
2609 <mediaobject>
2610 <imageobject>
2611 <imagedata width="100%" scalefit="1" entityref="dialog_exit"/>
2612 </imageobject>
2613 </mediaobject>
2614 <para>Finally, we show the dialog that will pop up when exiting
2615 the graphical interface. It will ask whether it should store the
2616 current state of the system in the input file or not. You may
2617 cancel the exit, close without saving or save the current
2618 state.</para>
2619 </figure>
2620 </section>
2621 </section>
2622 </section>
2623 <section xml:id="python-interface">
2624 <title xml:id="python-interface.title">Python interface</title>
2625 <para>Last but not least we elaborate on the python interface. We have
2626 already discusses this interface to some extent. The current session,
2627 i.e. the queue of actions you have executed, can be stored as a python
2628 script and subsequently executed independently of the user interface it
2629 was created with. More generally, MoleCuilder&apos;s Actions can be executed within arbitrary python
2630 scripts where prior to its execution a specific module has to be loaded, enabling access to MoleCuilder&apos;s actions from inside the
2631 script.</para>
2632 <para>MoleCuilder&apos;s python module is called <emphasis role="italic">pyMoleCuilder</emphasis>. It is
2633 essentially a library that can be imported into python just as any other
2634 module. Let us assume you have started the python interpreter and you
2635 have added the containing folder of the <filename>pyMoleCuilder</filename>
2636 library to the <varname>PYTHONPATH</varname> variable.</para>
2637 <programlisting>import pyMoleCuilder as mol</programlisting>
2638 <para>Subsequently, you can access the help via</para>
2639 <programlisting>help(mol)</programlisting>
2640 <para>This will list all of MoleCuilder&apos;s actions with their function
2641 signatures within python as contained in the module <emphasis role="italic">pyMoleCuilder</emphasis> named
2642 as <emphasis role="bold">mol</emphasis> in the scope of the currently running interpreter. Note that the
2643 function names are not the names you know from the command-line
2644 interface, they might be called
2645 <computeroutput>WorldChangeBox(...)</computeroutput> or alike. However, they are related by a certain naming system. The first word is identical to the menu name it resides in the text or graphical interface. Then its followed by the actual name of the action that is similar to the command-line token.</para>
2646 <para>Let&apos;s try it out.</para>
2647 <programlisting>print mol.CommandVersion()</programlisting>
2648 <para>This will state the current version of the library.</para>
2649 <para>Go ahead and try out other commands. Refer to the documentation
2650 under the command-line interface and look up the function name via
2651 help.</para>
2652 </section>
2653 </chapter>
2654 <chapter>
2655 <title>Conclusions</title>
2656 <para>This ends this user guide.</para>
2657 <para>We have given you a brief introduction to the aim of the program and
2658 how each of the four interfaces are to be used. The rest is up to
2659 you.</para>
2660 <para>Tutorials and more information is available online, see <link xlink:href="http://www.molecuilder.com/">MoleCuilder&apos;s website</link>.
2661 </para>
2662 <para>Be aware that in general knowing how the code works allows you to
2663 understand what&apos;s going wrong if something&apos;s going wrong.</para>
2664 <section>
2665 <title>Thanks</title>
2666 <para>Huge thanks go out to Saskia Metzler who was patient enough to let
2667 me sit next to her while riding ten hours in a bus to Berlin as I was writing the very first version of this guide.</para>
2668 </section>
2669 </chapter>
2670</book>
Note: See TracBrowser for help on using the repository browser.