forked from cclib/cclib.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethods.html
More file actions
510 lines (397 loc) · 32.9 KB
/
Copy pathmethods.html
File metadata and controls
510 lines (397 loc) · 32.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculation methods — cclib 1.3.1 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="cclib 1.3.1 documentation" href="index.html"/>
<link rel="next" title="Development" href="development.html"/>
<link rel="prev" title="Parsed data notes" href="data_notes.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="contents.html" class="icon icon-home"> cclib
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="index.html#summary">Summary</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#how-to-use-cclib">How to use cclib</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#about-cclib">About cclib</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial.html#requirements">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial.html#debian-gnu-linux-systems">Debian GNU/Linux systems</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial.html#manual-download-and-install">Manual download and install</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial.html#what-next">What next?</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="data.html">Parsed data (version 1.3.1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="data.html#description-of-parsed-data">Description of parsed data</a></li>
<li class="toctree-l2"><a class="reference internal" href="data.html#details-of-current-implementation">Details of current implementation</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="data_notes.html">Parsed data notes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#aonames">aonames</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#aooverlaps">aooverlaps</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#atombasis">atombasis</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#atomcharges">atomcharges</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#atomcoords">atomcoords</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#atommasses">atommasses</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#atomnos">atomnos</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#atomspins">atomspins</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#ccenergies">ccenergies</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#charge">charge</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#coreelectrons">coreelectrons</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#etenergies">etenergies</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#etoscs">etoscs</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#etsecs">etsecs</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#etsyms">etsyms</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#fonames">fonames</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#fooverlaps">fooverlaps</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#gbasis">gbasis</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#geotargets">geotargets</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#geovalues">geovalues</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#hessian">hessian</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#homos">homos</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#mocoeffs">mocoeffs</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#moenergies">moenergies</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#moments">moments</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#mosyms">mosyms</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#mpenergies">mpenergies</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#mult">mult</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#natom">natom</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#nbasis">nbasis</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#nmo">nmo</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#optdone">optdone</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#scfenergies">scfenergies</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#scftargets">scftargets</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#scfvalues">scfvalues</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_notes.html#vibdisps">vibdisps</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Calculation methods</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#c-squared-population-analysis-cspa">C squared population analysis (CSPA)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#custom-fragments">Custom fragments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#custom-progress">Custom progress</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#mulliken-population-analysis-mpa">Mulliken population analysis (MPA)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id1">Custom fragments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id2">Custom progress</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#lowdin-population-analysis">Löwdin Population Analysis</a></li>
<li class="toctree-l2"><a class="reference internal" href="#overlap-population-analysis">Overlap Population Analysis</a></li>
<li class="toctree-l2"><a class="reference internal" href="#density-matrix-calculation">Density Matrix calculation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#mayer-s-bond-orders">Mayer’s Bond Orders</a></li>
<li class="toctree-l2"><a class="reference internal" href="#charge-decomposition-analysis">Charge Decomposition Analysis</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#notes">Notes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#electron-density-calculation">Electron Density Calculation</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="development.html">Development</a><ul>
<li class="toctree-l2"><a class="reference internal" href="development.html#basic-instructions">Basic instructions</a><ul>
<li class="toctree-l3"><a class="reference internal" href="development.html#cloning-cclib-from-github">Cloning cclib from GitHub</a></li>
<li class="toctree-l3"><a class="reference internal" href="development.html#guidelines">Guidelines</a></li>
<li class="toctree-l3"><a class="reference internal" href="development.html#releasing-a-new-version">Releasing a new version</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="development.html#testing">Testing</a><ul>
<li class="toctree-l3"><a class="reference internal" href="development.html#unit-tests">Unit tests</a></li>
<li class="toctree-l3"><a class="reference internal" href="development.html#regression-tests">Regression tests</a></li>
<li class="toctree-l3"><a class="reference internal" href="development.html#doctests">Doctests</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="development.html#websites-related-to-cclib">Websites related to cclib</a></li>
<li class="toctree-l2"><a class="reference internal" href="development.html#developers">Developers</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="data_dev.html">Development parsed data</a><ul>
<li class="toctree-l2"><a class="reference internal" href="data_dev.html#description-of-parsed-data">Description of parsed data</a></li>
<li class="toctree-l2"><a class="reference internal" href="data_dev.html#details-of-current-implementation">Details of current implementation</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a><ul>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-1-3">Changes since cclib-1.3</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-1-2">Changes since cclib-1.2</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-1-1">Changes since cclib-1.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-1-0-1">Changes since cclib-1.0.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-1-0">Changes since cclib-1.0</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-0-9">Changes since cclib-0.9</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-0-8">Changes since cclib-0.8</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-0-7">Changes since cclib-0.7</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-0-6-1">Changes since cclib-0.6.1</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-0-6-0">Changes since cclib-0.6.0</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-0-6b">Changes since cclib-0.6b</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-0-5">Changes since cclib-0.5</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#changes-since-cclib-0-5b">Changes since cclib-0.5b</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="contents.html">cclib</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="contents.html">Docs</a> »</li>
<li>Calculation methods</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/cclib/cclib.github.io/blob/master/sphinx/methods.rst" class="fa fa-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="calculation-methods">
<span id="index-0"></span><h1>Calculation methods<a class="headerlink" href="#calculation-methods" title="Permalink to this headline">¶</a></h1>
<p>The following methods in cclib allow further analysis of calculation output.</p>
<div class="section" id="c-squared-population-analysis-cspa">
<span id="index-1"></span><h2>C squared population analysis (CSPA)<a class="headerlink" href="#c-squared-population-analysis-cspa" title="Permalink to this headline">¶</a></h2>
<p><strong>CSPA</strong> can be used to determine and interpret the electron density of a molecule. The contribution of the a-th atomic orbital to the i-th molecular orbital can be written in terms of the molecular orbital coefficients:</p>
<div class="math">
\[\Phi_{ai} = \frac{c^2_{ai}}{\sum_k c^2_{ki}}\]</div>
<p>The CSPA class available from cclib.method performs C-squared population analysis and can be used as follows:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">cclib.method</span> <span class="kn">import</span> <span class="n">CSPA</span>
<span class="kn">from</span> <span class="nn">cclib.parser</span> <span class="kn">import</span> <span class="n">Gaussian</span>
<span class="n">p</span> <span class="o">=</span> <span class="n">Gaussian</span><span class="p">(</span><span class="s">"mycalc.out"</span><span class="p">)</span>
<span class="n">d</span> <span class="o">=</span> <span class="n">p</span><span class="o">.</span><span class="n">parse</span><span class="p">()</span>
<span class="n">m</span> <span class="o">=</span> <span class="n">CSPA</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="n">m</span><span class="o">.</span><span class="n">calculate</span><span class="p">()</span>
</pre></div>
</div>
<p>After the calculate() method is called, the following attributes are available:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">aoresults</span></tt> is a Numpy array[3] with spin, molecular orbital, and atomic/fragment orbitals as the axes (aoresults[0][45][0] gives the contribution of the 1st atomic/fragment orbital to the 46th alpha/restricted molecular orbital)</li>
<li><tt class="docutils literal"><span class="pre">fragresults</span></tt> is a Numpy array[3] with spin, molecular orbital, and atoms as the axes (atomresults[1][23][4] gives the contribution of the 5th atomic/fragment orbital to the 24th beta molecular orbital)</li>
<li><tt class="docutils literal"><span class="pre">fragcharges</span></tt> is a Numpy array[1] with the number of (partial) electrons in each atom (atomcharges[2] gives the number of electrons on the 3rd atom)</li>
</ul>
<div class="section" id="custom-fragments">
<h3>Custom fragments<a class="headerlink" href="#custom-fragments" title="Permalink to this headline">¶</a></h3>
<p>Calling the calculate method without an argument treats each atom as a fragment in the population analysis. An optional argument can be passed - a list of lists - containing the atomic orbital numbers to be included in each fragment. Calling with this additional argument is useful if one is more interested in the contributions of certain orbitals, such as metal d, to the molecular orbitals. For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">cclib.method</span> <span class="kn">import</span> <span class="n">CSPA</span>
<span class="kn">from</span> <span class="nn">cclib.parser</span> <span class="kn">import</span> <span class="n">Gaussian</span>
<span class="n">p</span> <span class="o">=</span> <span class="n">Gaussian</span><span class="p">(</span><span class="s">"mycalc.out"</span><span class="p">)</span>
<span class="n">d</span> <span class="o">=</span> <span class="n">p</span><span class="o">.</span><span class="n">parse</span><span class="p">()</span>
<span class="n">m</span> <span class="o">=</span> <span class="n">CSPA</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="n">m</span><span class="o">.</span><span class="n">calculate</span><span class="p">([[</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">],[</span><span class="mi">5</span><span class="p">,</span><span class="mi">6</span><span class="p">],[</span><span class="mi">7</span><span class="p">,</span><span class="mi">8</span><span class="p">,</span><span class="mi">9</span><span class="p">]])</span> <span class="c">#fragment one is made from basis functions 0-4</span>
<span class="c">#fragment two is made from basis functions 5&6</span>
<span class="c">#fragment three is made from basis functions 7-9</span>
</pre></div>
</div>
</div>
<div class="section" id="custom-progress">
<h3>Custom progress<a class="headerlink" href="#custom-progress" title="Permalink to this headline">¶</a></h3>
<p>The CSPA class also can take a progress class as an argument so that the progress of the calculation can be monitored:</p>
<div class="highlight-python"><div class="highlight"><pre>from cclib.method import CSPA
from cclib.parser import Gaussian
from cclib.progress import TextProgress
import logging
progress=TextProgress()
p = Gaussian(“mycalc.out”, logging.ERROR)
d = p.parse(progress)
m = CSPA(d, progress, logging.ERROR)
m.calculate()
</pre></div>
</div>
</div>
</div>
<div class="section" id="mulliken-population-analysis-mpa">
<span id="index-2"></span><h2>Mulliken population analysis (MPA)<a class="headerlink" href="#mulliken-population-analysis-mpa" title="Permalink to this headline">¶</a></h2>
<p>MPA can be used to determine and interpret the electron density of a molecule. The contribution of the a-th atomic orbital to the i-th molecular orbital in this method is written in terms of the molecular orbital coefficients, c, and the overlap matrix, S:</p>
<div class="math">
\[\Phi_{ai} = \sum_b c_{ai} c_{bi} S_{ab}\]</div>
<p>The MPA class available from cclib.method performs Mulliken population analysis and can be used as follows:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">from</span> <span class="nn">cclib.method</span> <span class="kn">import</span> <span class="n">MPA</span>
<span class="kn">from</span> <span class="nn">cclib.parser</span> <span class="kn">import</span> <span class="n">ccopen</span>
<span class="n">d</span> <span class="o">=</span> <span class="n">ccopen</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span><span class="o">.</span><span class="n">parse</span><span class="p">()</span>
<span class="n">m</span> <span class="o">=</span> <span class="n">MPA</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="n">m</span><span class="o">.</span><span class="n">calculate</span><span class="p">()</span>
</pre></div>
</div>
<p>After the calculate() method is called, the following attributes are available:</p>
<ul class="simple">
<li>aoresults: a three dimensional array with spin, molecular orbital, and atomic orbitals as the axes, so that aoresults[0][45][0] gives the contribution of the 1st atomic orbital to the 46th alpha/restricted molecular orbital,</li>
<li>fragresults: a three dimensional array with spin, molecular orbital, and atoms as the axes, so that fragresults[1][23][4] gives the contribution of the 5th fragment orbitals to the 24th beta molecular orbital)</li>
<li>fragcharges: a vector with the number of (partial) electrons in each fragment, so that fragcharges[2] gives the number of electrons in the 3rd fragment.</li>
</ul>
<div class="section" id="id1">
<h3>Custom fragments<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<p>The calculate method chooses atoms as the fragments by default, and optionally accepts a list of lists containing the atomic orbital numbers (e.g. [[0,1,2],[3,4,5,6],...]) of arbitrary fragments. Calling it in this way is useful if one is more interested in the contributions of groups of atoms or even certain orbitals or orbital groups, such as metal d, to the molecular orbitals. In this case, fragresults and fragcharges reflect the chosen groups of atomic orbitals instead of atoms.</p>
</div>
<div class="section" id="id2">
<h3>Custom progress<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
<p>The Mulliken class also can take a progress class as an argument so that the progress of the calculation can be monitored:</p>
<div class="highlight-python"><div class="highlight"><pre>from cclib.method import MPA
from cclib.parser import ccopen
from cclib.progress import TextProgress
import logging
progress = TextProgress()
d = ccopen(“mycalc.out", logging.ERROR).parse(progress)
m = MPA(d, progress, logging.ERROR)
m.calculate()
</pre></div>
</div>
</div>
</div>
<div class="section" id="lowdin-population-analysis">
<span id="index-3"></span><h2>Löwdin Population Analysis<a class="headerlink" href="#lowdin-population-analysis" title="Permalink to this headline">¶</a></h2>
<p>The LPA class available from cclib.method performs Löwdin population analysis and can be used as follows:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">from</span> <span class="nn">cclib.method</span> <span class="kn">import</span> <span class="n">LPA</span>
<span class="kn">from</span> <span class="nn">cclib.parser</span> <span class="kn">import</span> <span class="n">ccopen</span>
<span class="n">d</span> <span class="o">=</span> <span class="n">ccopen</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span><span class="o">.</span><span class="n">parse</span><span class="p">()</span>
<span class="n">m</span> <span class="o">=</span> <span class="n">LPA</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="n">m</span><span class="o">.</span><span class="n">calculate</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="section" id="overlap-population-analysis">
<h2>Overlap Population Analysis<a class="headerlink" href="#overlap-population-analysis" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="density-matrix-calculation">
<h2>Density Matrix calculation<a class="headerlink" href="#density-matrix-calculation" title="Permalink to this headline">¶</a></h2>
<p>The Density class from cclib.method can be used to calculate the density matrix:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">cclib.parser</span> <span class="kn">import</span> <span class="n">ccopen</span>
<span class="kn">from</span> <span class="nn">cclib.method</span> <span class="kn">import</span> <span class="n">Density</span>
<span class="n">parser</span> <span class="o">=</span> <span class="n">ccopen</span><span class="p">(</span><span class="s">"myfile.out"</span><span class="p">)</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">parse</span><span class="p">()</span>
<span class="n">d</span> <span class="o">=</span> <span class="n">Density</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="n">d</span><span class="o">.</span><span class="n">calculate</span><span class="p">()</span>
</pre></div>
</div>
<p>After calculate() is called, the density attribute is available. It is simply a Numpy array with three axes. The first axis is for the spin contributions, and the second and third axes are for the density matrix, which follows the standard definition.</p>
</div>
<div class="section" id="mayer-s-bond-orders">
<h2>Mayer’s Bond Orders<a class="headerlink" href="#mayer-s-bond-orders" title="Permalink to this headline">¶</a></h2>
<p>This method calculates the Mayer’s bond orders for a given molecule:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">from</span> <span class="nn">cclib.parser</span> <span class="kn">import</span> <span class="n">ccopen</span>
<span class="kn">from</span> <span class="nn">cclib.method</span> <span class="kn">import</span> <span class="n">MBO</span>
<span class="n">parser</span> <span class="o">=</span> <span class="n">ccopen</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">parse</span><span class="p">()</span>
<span class="n">d</span> <span class="o">=</span> <span class="n">MBO</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="n">d</span><span class="o">.</span><span class="n">calculate</span><span class="p">()</span>
</pre></div>
</div>
<p>After calculate() is called, the fragresults attribute is available, which is a Numpy array of rank 3. The first axis is for contributions of each spin to the MBO, while the second and third correspond to the indices of the atoms.</p>
</div>
<div class="section" id="charge-decomposition-analysis">
<h2>Charge Decomposition Analysis<a class="headerlink" href="#charge-decomposition-analysis" title="Permalink to this headline">¶</a></h2>
<p>The Charge Decomposition Analysis (CDA) as developed by Gernot Frenking et al. is used to study the donor-acceptor interactions of a molecule in terms of two user-specified fragments.</p>
<p>The CDA class available from cclib.method performs this analysis:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">cclib.parser</span> <span class="kn">import</span> <span class="n">ccopen</span>
<span class="kn">from</span> <span class="nn">cclib.method</span> <span class="kn">import</span> <span class="n">CDA</span>
<span class="n">molecule</span> <span class="o">=</span> <span class="n">ccopen</span><span class="p">(</span><span class="s">"molecule.log"</span><span class="p">)</span>
<span class="n">frag1</span> <span class="o">=</span> <span class="n">ccopen</span><span class="p">(</span><span class="s">"fragment1.log"</span><span class="p">)</span>
<span class="n">frag2</span> <span class="o">=</span> <span class="n">ccopen</span><span class="p">(</span><span class="s">"fragment2.log"</span><span class="p">)</span>
<span class="c"># if using CDA from an interactive session, it's best</span>
<span class="c"># to parse the files at the same time in case they aren't</span>
<span class="c"># parsed immediately---go get a drink!</span>
<span class="n">m</span> <span class="o">=</span> <span class="n">molecule</span><span class="o">.</span><span class="n">parse</span><span class="p">()</span>
<span class="n">f1</span> <span class="o">=</span> <span class="n">frag1</span><span class="o">.</span><span class="n">parse</span><span class="p">()</span>
<span class="n">f2</span> <span class="o">=</span> <span class="n">frag2</span><span class="o">.</span><span class="n">parse</span><span class="p">()</span>
<span class="n">cda</span> <span class="o">=</span> <span class="n">CDA</span><span class="p">(</span><span class="n">m</span><span class="p">)</span>
<span class="n">cda</span><span class="o">.</span><span class="n">calculate</span><span class="p">([</span><span class="n">f1</span><span class="p">,</span> <span class="n">f2</span><span class="p">])</span>
</pre></div>
</div>
<p>After calculate() finishes, there should be the donations, bdonations (back donation), and repulsions attributes to the cda instance. These attributes are simply lists of 1-dimensional Numpy arrays corresponding to the restricted or alpha/beta molecular orbitals of the entire molecule. Additionally, the CDA method involves transforming the atomic basis functions of the molecule into a basis using the molecular orbitals of the fragments so the attributes mocoeffs and fooverlaps are created and can be used in population analyses such as Mulliken or C-squared (see Fragment Analysis for more details).</p>
<p>There is also a script provided by cclib that performs the CDA from a command-line:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>cda molecule.log fragment1.log fragment2.log
Charge decomposition analysis of molecule.log
MO# d b r
-----------------------------
1: -0.000 -0.000 -0.000
2: -0.000 0.002 0.000
3: -0.001 -0.000 0.000
4: -0.001 -0.026 -0.006
5: -0.006 0.082 0.230
6: -0.040 0.075 0.214
7: 0.001 -0.001 0.022
8: 0.001 -0.001 0.022
9: 0.054 0.342 -0.740
10: 0.087 -0.001 -0.039
11: 0.087 -0.001 -0.039
------ HOMO - LUMO gap ------
12: 0.000 0.000 0.000
13: 0.000 0.000 0.000
......
</pre></div>
</div>
<div class="section" id="notes">
<h3>Notes<a class="headerlink" href="#notes" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Only molecular orbitals with non-zero occupancy will have a non-zero value.</li>
<li>The absolute values of the calculated terms have no physical meaning and only the relative magnitudes, especially for the donation and back donation terms, are of any real value (Frenking, et al.)</li>
<li>The atom coordinates in molecules and fragments must be the same, which is usually accomplished with an argument in the QM program (the NoSymm keyword in Gaussian, for instance).</li>
<li>The current implementation has some subtle differences than the code from the Frenking group. The CDA class in cclib follows the formula outlined in one of Frenking’s CDA papers, but contains an extra factor of 2 to give results that agree with those from the original CDA program. It also doesn’t include negligible terms (on the order of 10^-6) that result from overlap between MOs on the same fragment that appears to be included in the Frenking code. Contact atenderholt (at) gmail (dot) com for discussion and more information.</li>
</ul>
</div>
</div>
<div class="section" id="electron-density-calculation">
<h2>Electron Density Calculation<a class="headerlink" href="#electron-density-calculation" title="Permalink to this headline">¶</a></h2>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="development.html" class="btn btn-neutral float-right" title="Development" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="data_notes.html" class="btn btn-neutral" title="Parsed data notes" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2014-2015, cclib Development Team.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.3.1',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>