forked from materialsproject/pymatgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pymatgen.transformations.site_transformations.html
553 lines (510 loc) · 36.2 KB
/
pymatgen.transformations.site_transformations.html
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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>pymatgen.transformations.site_transformations module — pymatgen 2019.5.1 documentation</title>
<link rel="stylesheet" href="_static/proBlue.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></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="_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33990148-1']);
_gaq.push(['_trackPageview']);
</script>
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pymatgen 2019.5.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-pymatgen.transformations.site_transformations">
<span id="pymatgen-transformations-site-transformations-module"></span><h1>pymatgen.transformations.site_transformations module<a class="headerlink" href="#module-pymatgen.transformations.site_transformations" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="pymatgen.transformations.site_transformations.AddSitePropertyTransformation">
<em class="property">class </em><code class="descname">AddSitePropertyTransformation</code><span class="sig-paren">(</span><em>site_properties</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#AddSitePropertyTransformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.AddSitePropertyTransformation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="pymatgen.transformations.transformation_abc.html#pymatgen.transformations.transformation_abc.AbstractTransformation" title="pymatgen.transformations.transformation_abc.AbstractTransformation"><code class="xref py py-class docutils literal notranslate"><span class="pre">pymatgen.transformations.transformation_abc.AbstractTransformation</span></code></a></p>
<p>Simple transformation to add site properties to a given structure</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>site_properties</strong> (<em>dict</em>) – site properties to be added to a structure</p>
</dd>
</dl>
<dl class="method">
<dt id="pymatgen.transformations.site_transformations.AddSitePropertyTransformation.apply_transformation">
<code class="descname">apply_transformation</code><span class="sig-paren">(</span><em>structure</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#AddSitePropertyTransformation.apply_transformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.AddSitePropertyTransformation.apply_transformation" title="Permalink to this definition">¶</a></dt>
<dd><p>apply the transformation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>structure</strong> (<a class="reference internal" href="pymatgen.core.structure.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – structure to add site properties to</p>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.AddSitePropertyTransformation.inverse">
<code class="descname">inverse</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.AddSitePropertyTransformation.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse transformation if available.
Otherwise, should return None.</p>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.AddSitePropertyTransformation.is_one_to_many">
<code class="descname">is_one_to_many</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.AddSitePropertyTransformation.is_one_to_many" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines if a Transformation is a one-to-many transformation. If a
Transformation is a one-to-many transformation, the
apply_transformation method should have a keyword arg
“return_ranked_list” which allows for the transformed structures to be
returned as a ranked list.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymatgen.transformations.site_transformations.InsertSitesTransformation">
<em class="property">class </em><code class="descname">InsertSitesTransformation</code><span class="sig-paren">(</span><em>species</em>, <em>coords</em>, <em>coords_are_cartesian=False</em>, <em>validate_proximity=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#InsertSitesTransformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.InsertSitesTransformation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="pymatgen.transformations.transformation_abc.html#pymatgen.transformations.transformation_abc.AbstractTransformation" title="pymatgen.transformations.transformation_abc.AbstractTransformation"><code class="xref py py-class docutils literal notranslate"><span class="pre">pymatgen.transformations.transformation_abc.AbstractTransformation</span></code></a></p>
<p>This transformation substitutes certain sites with certain species.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>species</strong> – A list of species. e.g., [“Li”, “Fe”]</p></li>
<li><p><strong>coords</strong> – A list of coords corresponding to those species. e.g.,
[[0,0,0],[0.5,0.5,0.5]].</p></li>
<li><p><strong>coords_are_cartesian</strong> (<em>bool</em>) – Set to True if coords are given in
cartesian coords. Defaults to False.</p></li>
<li><p><strong>validate_proximity</strong> (<em>bool</em>) – Set to False if you do not wish to ensure
that added sites are not too close to other sites. Defaults to True.</p></li>
</ul>
</dd>
</dl>
<dl class="method">
<dt id="pymatgen.transformations.site_transformations.InsertSitesTransformation.apply_transformation">
<code class="descname">apply_transformation</code><span class="sig-paren">(</span><em>structure</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#InsertSitesTransformation.apply_transformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.InsertSitesTransformation.apply_transformation" title="Permalink to this definition">¶</a></dt>
<dd><p>Applies the transformation to a structure. Depending on whether a
transformation is one-to-many, there may be an option to return a
ranked list of structures.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – input structure</p></li>
<li><p><strong>return_ranked_list</strong> – Boolean stating whether or not multiple structures are
returned. If return_ranked_list is a number, that number of
structures is returned.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>depending on returned_ranked list, either a transformed structure
or
a list of dictionaries, where each dictionary is of the form
{‘structure’ = …. , ‘other_arguments’}
the key ‘transformation’ is reserved for the transformation that
was actually applied to the structure.
This transformation is parsed by the alchemy classes for generating
a more specific transformation history. Any other information will
be stored in the transformation_parameters dictionary in the
transmuted structure class.</p>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.InsertSitesTransformation.inverse">
<code class="descname">inverse</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.InsertSitesTransformation.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse transformation if available.
Otherwise, should return None.</p>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.InsertSitesTransformation.is_one_to_many">
<code class="descname">is_one_to_many</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.InsertSitesTransformation.is_one_to_many" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines if a Transformation is a one-to-many transformation. If a
Transformation is a one-to-many transformation, the
apply_transformation method should have a keyword arg
“return_ranked_list” which allows for the transformed structures to be
returned as a ranked list.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation">
<em class="property">class </em><code class="descname">PartialRemoveSitesTransformation</code><span class="sig-paren">(</span><em>indices</em>, <em>fractions</em>, <em>algo=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#PartialRemoveSitesTransformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="pymatgen.transformations.transformation_abc.html#pymatgen.transformations.transformation_abc.AbstractTransformation" title="pymatgen.transformations.transformation_abc.AbstractTransformation"><code class="xref py py-class docutils literal notranslate"><span class="pre">pymatgen.transformations.transformation_abc.AbstractTransformation</span></code></a></p>
<p>Remove fraction of specie from a structure.
Requires an oxidation state decorated structure for ewald sum to be
computed.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>indices</strong> – A list of list of indices.
e.g. [[0, 1], [2, 3, 4, 5]]</p></li>
<li><p><strong>fractions</strong> – The corresponding fractions to remove. Must be same length as
indices. e.g., [0.5, 0.25]</p></li>
<li><p><strong>algo</strong> – This parameter allows you to choose the algorithm to perform
ordering. Use one of PartialRemoveSpecieTransformation.ALGO_*
variables to set the algo.</p></li>
</ul>
</dd>
</dl>
<p>Given that the solution to selecting the right removals is NP-hard, there
are several algorithms provided with varying degrees of accuracy and speed.
The options are as follows:</p>
<dl class="simple">
<dt>ALGO_FAST:</dt><dd><p>This is a highly optimized algorithm to quickly go through the search
tree. It is guaranteed to find the optimal solution, but will return
only a single lowest energy structure. Typically, you will want to use
this.</p>
</dd>
<dt>ALGO_COMPLETE:</dt><dd><p>The complete algo ensures that you get all symmetrically distinct
orderings, ranked by the estimated Ewald energy. But this can be an
extremely time-consuming process if the number of possible orderings is
very large. Use this if you really want all possible orderings. If you
want just the lowest energy ordering, ALGO_FAST is accurate and faster.</p>
</dd>
<dt>ALGO_BEST_FIRST:</dt><dd><p>This algorithm is for ordering the really large cells that defeats even
ALGO_FAST. For example, if you have 48 sites of which you want to
remove 16 of them, the number of possible orderings is around
2 x 10^12. ALGO_BEST_FIRST shortcircuits the entire search tree by
removing the highest energy site first, then followed by the next
highest energy site, and so on. It is guaranteed to find a solution
in a reasonable time, but it is also likely to be highly inaccurate.</p>
</dd>
<dt>ALGO_ENUMERATE:</dt><dd><p>This algorithm uses the EnumerateStructureTransformation to perform
ordering. This algo returns <em>complete</em> orderings up to a single unit
cell size. It is more robust than the ALGO_COMPLETE, but requires
Gus Hart’s enumlib to be installed.</p>
</dd>
</dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.ALGO_BEST_FIRST">
<code class="descname">ALGO_BEST_FIRST</code><em class="property"> = 2</em><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.ALGO_BEST_FIRST" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.ALGO_COMPLETE">
<code class="descname">ALGO_COMPLETE</code><em class="property"> = 1</em><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.ALGO_COMPLETE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.ALGO_ENUMERATE">
<code class="descname">ALGO_ENUMERATE</code><em class="property"> = 3</em><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.ALGO_ENUMERATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.ALGO_FAST">
<code class="descname">ALGO_FAST</code><em class="property"> = 0</em><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.ALGO_FAST" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.apply_transformation">
<code class="descname">apply_transformation</code><span class="sig-paren">(</span><em>structure</em>, <em>return_ranked_list=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#PartialRemoveSitesTransformation.apply_transformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.apply_transformation" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply the transformation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – input structure</p></li>
<li><p><strong>return_ranked_list</strong> (<em>bool</em>) – Whether or not multiple structures are
returned. If return_ranked_list is a number, that number of
structures is returned.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Depending on returned_ranked list, either a transformed structure
or a list of dictionaries, where each dictionary is of the form
{“structure” = …. , “other_arguments”}
the key “transformation” is reserved for the transformation that
was actually applied to the structure.
This transformation is parsed by the alchemy classes for generating
a more specific transformation history. Any other information will
be stored in the transformation_parameters dictionary in the
transmuted structure class.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.best_first_ordering">
<code class="descname">best_first_ordering</code><span class="sig-paren">(</span><em>structure</em>, <em>num_remove_dict</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#PartialRemoveSitesTransformation.best_first_ordering"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.best_first_ordering" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.complete_ordering">
<code class="descname">complete_ordering</code><span class="sig-paren">(</span><em>structure</em>, <em>num_remove_dict</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#PartialRemoveSitesTransformation.complete_ordering"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.complete_ordering" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.enumerate_ordering">
<code class="descname">enumerate_ordering</code><span class="sig-paren">(</span><em>structure</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#PartialRemoveSitesTransformation.enumerate_ordering"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.enumerate_ordering" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.fast_ordering">
<code class="descname">fast_ordering</code><span class="sig-paren">(</span><em>structure</em>, <em>num_remove_dict</em>, <em>num_to_return=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#PartialRemoveSitesTransformation.fast_ordering"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.fast_ordering" title="Permalink to this definition">¶</a></dt>
<dd><p>This method uses the matrix form of ewaldsum to calculate the ewald
sums of the potential structures. This is on the order of 4 orders of
magnitude faster when there are large numbers of permutations to
consider. There are further optimizations possible (doing a smarter
search of permutations for example), but this wont make a difference
until the number of permutations is on the order of 30,000.</p>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.inverse">
<code class="descname">inverse</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse transformation if available.
Otherwise, should return None.</p>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.is_one_to_many">
<code class="descname">is_one_to_many</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.PartialRemoveSitesTransformation.is_one_to_many" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines if a Transformation is a one-to-many transformation. If a
Transformation is a one-to-many transformation, the
apply_transformation method should have a keyword arg
“return_ranked_list” which allows for the transformed structures to be
returned as a ranked list.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymatgen.transformations.site_transformations.RemoveSitesTransformation">
<em class="property">class </em><code class="descname">RemoveSitesTransformation</code><span class="sig-paren">(</span><em>indices_to_remove</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#RemoveSitesTransformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.RemoveSitesTransformation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="pymatgen.transformations.transformation_abc.html#pymatgen.transformations.transformation_abc.AbstractTransformation" title="pymatgen.transformations.transformation_abc.AbstractTransformation"><code class="xref py py-class docutils literal notranslate"><span class="pre">pymatgen.transformations.transformation_abc.AbstractTransformation</span></code></a></p>
<p>Remove certain sites in a structure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>indices_to_remove</strong> – List of indices to remove. E.g., [0, 1, 2]</p>
</dd>
</dl>
<dl class="method">
<dt id="pymatgen.transformations.site_transformations.RemoveSitesTransformation.apply_transformation">
<code class="descname">apply_transformation</code><span class="sig-paren">(</span><em>structure</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#RemoveSitesTransformation.apply_transformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.RemoveSitesTransformation.apply_transformation" title="Permalink to this definition">¶</a></dt>
<dd><p>Applies the transformation to a structure. Depending on whether a
transformation is one-to-many, there may be an option to return a
ranked list of structures.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – input structure</p></li>
<li><p><strong>return_ranked_list</strong> – Boolean stating whether or not multiple structures are
returned. If return_ranked_list is a number, that number of
structures is returned.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>depending on returned_ranked list, either a transformed structure
or
a list of dictionaries, where each dictionary is of the form
{‘structure’ = …. , ‘other_arguments’}
the key ‘transformation’ is reserved for the transformation that
was actually applied to the structure.
This transformation is parsed by the alchemy classes for generating
a more specific transformation history. Any other information will
be stored in the transformation_parameters dictionary in the
transmuted structure class.</p>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.RemoveSitesTransformation.inverse">
<code class="descname">inverse</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.RemoveSitesTransformation.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse transformation if available.
Otherwise, should return None.</p>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.RemoveSitesTransformation.is_one_to_many">
<code class="descname">is_one_to_many</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.RemoveSitesTransformation.is_one_to_many" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines if a Transformation is a one-to-many transformation. If a
Transformation is a one-to-many transformation, the
apply_transformation method should have a keyword arg
“return_ranked_list” which allows for the transformed structures to be
returned as a ranked list.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymatgen.transformations.site_transformations.ReplaceSiteSpeciesTransformation">
<em class="property">class </em><code class="descname">ReplaceSiteSpeciesTransformation</code><span class="sig-paren">(</span><em>indices_species_map</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#ReplaceSiteSpeciesTransformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.ReplaceSiteSpeciesTransformation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="pymatgen.transformations.transformation_abc.html#pymatgen.transformations.transformation_abc.AbstractTransformation" title="pymatgen.transformations.transformation_abc.AbstractTransformation"><code class="xref py py-class docutils literal notranslate"><span class="pre">pymatgen.transformations.transformation_abc.AbstractTransformation</span></code></a></p>
<p>This transformation substitutes certain sites with certain species.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>indices_species_map</strong> – A dict containing the species mapping in
int-string pairs. E.g., { 1:”Na”} or {2:”Mn2+”}. Multiple
substitutions can be done. Overloaded to accept sp_and_occu
dictionary. E.g. {1: {“Ge”:0.75, “C”:0.25} }, which
substitutes a single species with multiple species to generate a
disordered structure.</p>
</dd>
</dl>
<dl class="method">
<dt id="pymatgen.transformations.site_transformations.ReplaceSiteSpeciesTransformation.apply_transformation">
<code class="descname">apply_transformation</code><span class="sig-paren">(</span><em>structure</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#ReplaceSiteSpeciesTransformation.apply_transformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.ReplaceSiteSpeciesTransformation.apply_transformation" title="Permalink to this definition">¶</a></dt>
<dd><p>Applies the transformation to a structure. Depending on whether a
transformation is one-to-many, there may be an option to return a
ranked list of structures.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – input structure</p></li>
<li><p><strong>return_ranked_list</strong> – Boolean stating whether or not multiple structures are
returned. If return_ranked_list is a number, that number of
structures is returned.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>depending on returned_ranked list, either a transformed structure
or
a list of dictionaries, where each dictionary is of the form
{‘structure’ = …. , ‘other_arguments’}
the key ‘transformation’ is reserved for the transformation that
was actually applied to the structure.
This transformation is parsed by the alchemy classes for generating
a more specific transformation history. Any other information will
be stored in the transformation_parameters dictionary in the
transmuted structure class.</p>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.ReplaceSiteSpeciesTransformation.inverse">
<code class="descname">inverse</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.ReplaceSiteSpeciesTransformation.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse transformation if available.
Otherwise, should return None.</p>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.ReplaceSiteSpeciesTransformation.is_one_to_many">
<code class="descname">is_one_to_many</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.ReplaceSiteSpeciesTransformation.is_one_to_many" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines if a Transformation is a one-to-many transformation. If a
Transformation is a one-to-many transformation, the
apply_transformation method should have a keyword arg
“return_ranked_list” which allows for the transformed structures to be
returned as a ranked list.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymatgen.transformations.site_transformations.TranslateSitesTransformation">
<em class="property">class </em><code class="descname">TranslateSitesTransformation</code><span class="sig-paren">(</span><em>indices_to_move</em>, <em>translation_vector</em>, <em>vector_in_frac_coords=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#TranslateSitesTransformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.TranslateSitesTransformation" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="pymatgen.transformations.transformation_abc.html#pymatgen.transformations.transformation_abc.AbstractTransformation" title="pymatgen.transformations.transformation_abc.AbstractTransformation"><code class="xref py py-class docutils literal notranslate"><span class="pre">pymatgen.transformations.transformation_abc.AbstractTransformation</span></code></a></p>
<p>This class translates a set of sites by a certain vector.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>indices_to_move</strong> – The indices of the sites to move</p></li>
<li><p><strong>translation_vector</strong> – Vector to move the sites. If a list of list or numpy
array of shape, (len(indices_to_move), 3), is provided then each
translation vector is applied to the corresponding site in the
indices_to_move.</p></li>
<li><p><strong>vector_in_frac_coords</strong> – Set to True if the translation vector is in
fractional coordinates, and False if it is in cartesian
coordinations. Defaults to True.</p></li>
</ul>
</dd>
</dl>
<dl class="method">
<dt id="pymatgen.transformations.site_transformations.TranslateSitesTransformation.apply_transformation">
<code class="descname">apply_transformation</code><span class="sig-paren">(</span><em>structure</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#TranslateSitesTransformation.apply_transformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.TranslateSitesTransformation.apply_transformation" title="Permalink to this definition">¶</a></dt>
<dd><p>Applies the transformation to a structure. Depending on whether a
transformation is one-to-many, there may be an option to return a
ranked list of structures.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – input structure</p></li>
<li><p><strong>return_ranked_list</strong> – Boolean stating whether or not multiple structures are
returned. If return_ranked_list is a number, that number of
structures is returned.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>depending on returned_ranked list, either a transformed structure
or
a list of dictionaries, where each dictionary is of the form
{‘structure’ = …. , ‘other_arguments’}
the key ‘transformation’ is reserved for the transformation that
was actually applied to the structure.
This transformation is parsed by the alchemy classes for generating
a more specific transformation history. Any other information will
be stored in the transformation_parameters dictionary in the
transmuted structure class.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.transformations.site_transformations.TranslateSitesTransformation.as_dict">
<code class="descname">as_dict</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/transformations/site_transformations.html#TranslateSitesTransformation.as_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.transformations.site_transformations.TranslateSitesTransformation.as_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Json-serializable dict representation.</p>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.TranslateSitesTransformation.inverse">
<code class="descname">inverse</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.TranslateSitesTransformation.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse transformation if available.
Otherwise, should return None.</p>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.transformations.site_transformations.TranslateSitesTransformation.is_one_to_many">
<code class="descname">is_one_to_many</code><a class="headerlink" href="#pymatgen.transformations.site_transformations.TranslateSitesTransformation.is_one_to_many" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines if a Transformation is a one-to-many transformation. If a
Transformation is a one-to-many transformation, the
apply_transformation method should have a keyword arg
“return_ranked_list” which allows for the transformed structures to be
returned as a ranked list.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/pymatgen.transformations.site_transformations.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pymatgen 2019.5.1 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2011, Pymatgen Development Team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.0.1.
</div>
<div class="footer">This page uses <a href="http://analytics.google.com/">
Google Analytics</a> to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.
<script type="text/javascript">
(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
</script>
</div>
</body>
</html>