-
Notifications
You must be signed in to change notification settings - Fork 835
/
pymatgen.analysis.defects.utils.html
948 lines (787 loc) · 61 KB
/
pymatgen.analysis.defects.utils.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
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
<!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>pymatgen.analysis.defects.utils module — pymatgen 2021.1.28 documentation</title>
<link rel="canonical" href="https://pymatgen.orgpymatgen.analysis.defects.utils.html"/>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/custom.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="pymatgen.analysis.diffraction package" href="pymatgen.analysis.diffraction.html" />
<link rel="prev" title="pymatgen.analysis.defects.thermodynamics module" href="pymatgen.analysis.defects.thermodynamics.html" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33990148-1']);
_gaq.push(['_trackPageview']);
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" style="background: linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)" >
<a href="index.html" class="icon icon-home"> pymatgen
</a>
<div class="version">
2021.1.28
</div>
<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="introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="change_log.html">Change log</a></li>
<li class="toctree-l1"><a class="reference internal" href="usage.html">Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="team.html">Development Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="references.html">References</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">API Docs</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="pymatgen.html">pymatgen package</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="pymatgen.html#subpackages">Subpackages</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="pymatgen.alchemy.html">pymatgen.alchemy package</a></li>
<li class="toctree-l4 current"><a class="reference internal" href="pymatgen.analysis.html">pymatgen.analysis package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.apps.html">pymatgen.apps package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.cli.html">pymatgen.cli package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.command_line.html">pymatgen.command_line package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.core.html">pymatgen.core package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.electronic_structure.html">pymatgen.electronic_structure package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.entries.html">pymatgen.entries package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.ext.html">pymatgen.ext package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.io.html">pymatgen.io package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.optimization.html">pymatgen.optimization package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.phonon.html">pymatgen.phonon package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.plugins.html">pymatgen.plugins package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.symmetry.html">pymatgen.symmetry package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.transformations.html">pymatgen.transformations package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.util.html">pymatgen.util package</a></li>
<li class="toctree-l4"><a class="reference internal" href="pymatgen.vis.html">pymatgen.vis package</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="pymatgen.html#submodules">Submodules</a></li>
<li class="toctree-l3"><a class="reference internal" href="pymatgen.html#module-pymatgen">Module contents</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">pymatgen</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content style-external-links">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li><a href="modules.html">pymatgen</a> »</li>
<li><a href="pymatgen.html">pymatgen package</a> »</li>
<li><a href="pymatgen.analysis.html">pymatgen.analysis package</a> »</li>
<li><a href="pymatgen.analysis.defects.html">pymatgen.analysis.defects package</a> »</li>
<li>pymatgen.analysis.defects.utils module</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/materialsproject/pymatgen/blob/master/docs_rst/pymatgen.analysis.defects.utils.rst" class="fa fa-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="module-pymatgen.analysis.defects.utils">
<span id="pymatgen-analysis-defects-utils-module"></span><h1>pymatgen.analysis.defects.utils module<a class="headerlink" href="#module-pymatgen.analysis.defects.utils" title="Permalink to this headline">¶</a></h1>
<p>Utilities for defects module.</p>
<dl class="py class">
<dt id="pymatgen.analysis.defects.utils.ChargeDensityAnalyzer">
<em class="property">class </em><code class="sig-name descname">ChargeDensityAnalyzer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">chgcar</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L972-L1347"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.ChargeDensityAnalyzer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">monty.json.MSONable</span></code></p>
<p>Analyzer to find potential interstitial sites based on charge density. The
<cite>total</cite> charge density is used.</p>
<p>Initialization.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>chgcar</strong> (<em>pmg.Chgcar</em>) – input Chgcar object.</p>
</dd>
</dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.charge_distribution_df">
<em class="property">property </em><code class="sig-name descname">charge_distribution_df</code><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.charge_distribution_df" title="Permalink to this definition">¶</a></dt>
<dd><p>Charge distribution.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>return</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.cluster_nodes">
<code class="sig-name descname">cluster_nodes</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tol</span><span class="o">=</span><span class="default_value">0.2</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L1167-L1218"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.cluster_nodes" title="Permalink to this definition">¶</a></dt>
<dd><p>Cluster nodes that are too close together using a tol.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>tol</strong> (<em>float</em>) – A distance tolerance. PBC is taken into account.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.extrema_df">
<em class="property">property </em><code class="sig-name descname">extrema_df</code><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.extrema_df" title="Permalink to this definition">¶</a></dt>
<dd><p>The extrema in charge density.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>return</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.from_file">
<em class="property">classmethod </em><code class="sig-name descname">from_file</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">chgcar_filename</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L992-L1001"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.from_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Init from a CHGCAR.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>chgcar_filename</strong> – </p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.get_local_extrema">
<code class="sig-name descname">get_local_extrema</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/../../../../../../opt/miniconda3/envs/pymatgen-release/lib/python3.8/site-packages/monty/dev.py#L1104-L1165"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.get_local_extrema" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all local extrema fractional coordinates in charge density,
searching for local minimum by default. Note that sites are NOT grouped
symmetrically.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>find_min</strong> (<em>bool</em>) – True to find local minimum else maximum, otherwise
find local maximum.</p></li>
<li><p><strong>threshold_frac</strong> (<em>float</em>) – <p>optional fraction of extrema shown, which
returns <cite>threshold_frac * tot_num_extrema</cite> extrema fractional
coordinates based on highest/lowest intensity.</p>
<p>E.g. set 0.2 to show the extrema with 20% highest or lowest
intensity. Value range: 0 <= threshold_frac <= 1</p>
<p>Note that threshold_abs and threshold_frac should not set in the
same time.</p>
</p></li>
<li><p><strong>threshold_abs</strong> (<em>float</em>) – <p>optional filter. When searching for local
minima, intensity <= threshold_abs returns; when searching for
local maxima, intensity >= threshold_abs returns.</p>
<p>Note that threshold_abs and threshold_frac should not set in the
same time.</p>
</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>list of fractional coordinates corresponding</dt><dd><p>to local extrema.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>extrema_coords (list)</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.get_structure_with_nodes">
<code class="sig-name descname">get_structure_with_nodes</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">find_min</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">min_dist</span><span class="o">=</span><span class="default_value">0.5</span></em>, <em class="sig-param"><span class="n">tol</span><span class="o">=</span><span class="default_value">0.2</span></em>, <em class="sig-param"><span class="n">threshold_frac</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">threshold_abs</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L1253-L1311"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.get_structure_with_nodes" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the modified structure with the possible interstitial sites added.
The species is set as a DummySpecies X.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>find_min</strong> (<em>bool</em>) – True to find local minimum else maximum, otherwise
find local maximum.</p></li>
<li><p><strong>min_dist</strong> (<em>float</em>) – The minimum distance (in Angstrom) that
a predicted site needs to be from existing atoms. A min_dist
with value <= 0 returns all sites without distance checking.</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – A distance tolerance of nodes clustering that sites too
closed to other predicted sites will be merged. PBC is taken
into account.</p></li>
<li><p><strong>threshold_frac</strong> (<em>float</em>) – <p>optional fraction of extrema, which returns
<cite>threshold_frac * tot_num_extrema</cite> extrema fractional
coordinates based on highest/lowest intensity.</p>
<p>E.g. set 0.2 to insert DummySpecies atom at the extrema with 20%
highest or lowest intensity.
Value range: 0 <= threshold_frac <= 1</p>
<p>Note that threshold_abs and threshold_frac should not set in the
same time.</p>
</p></li>
<li><p><strong>threshold_abs</strong> (<em>float</em>) – <p>optional filter. When searching for local
minima, intensity <= threshold_abs returns; when searching for
local maxima, intensity >= threshold_abs returns.</p>
<p>Note that threshold_abs and threshold_frac should not set in the
same time.</p>
</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>structure (Structure)</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.remove_collisions">
<code class="sig-name descname">remove_collisions</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">min_dist</span><span class="o">=</span><span class="default_value">0.5</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L1220-L1251"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.remove_collisions" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove predicted sites that are too close to existing atoms in the
structure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>min_dist</strong> (<em>float</em>) – The minimum distance (in Angstrom) that
a predicted site needs to be from existing atoms. A min_dist
with value <= 0 returns all sites without distance checking.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.sort_sites_by_integrated_chg">
<code class="sig-name descname">sort_sites_by_integrated_chg</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">r</span><span class="o">=</span><span class="default_value">0.4</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L1313-L1335"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.ChargeDensityAnalyzer.sort_sites_by_integrated_chg" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the average charge density around each local minima in the charge density
and store the result in _extrema_df
:param r: radius of sphere around each site to evaluate the average
:type r: float</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="pymatgen.analysis.defects.utils.ChargeInsertionAnalyzer">
<em class="property">class </em><code class="sig-name descname">ChargeInsertionAnalyzer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">chgcar</span></em>, <em class="sig-param"><span class="n">working_ion</span><span class="o">=</span><span class="default_value">'Li'</span></em>, <em class="sig-param"><span class="n">avg_radius</span><span class="o">=</span><span class="default_value">0.4</span></em>, <em class="sig-param"><span class="n">max_avg_charge</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">clustering_tol</span><span class="o">=</span><span class="default_value">0.6</span></em>, <em class="sig-param"><span class="n">ltol</span><span class="o">=</span><span class="default_value">0.2</span></em>, <em class="sig-param"><span class="n">stol</span><span class="o">=</span><span class="default_value">0.3</span></em>, <em class="sig-param"><span class="n">angle_tol</span><span class="o">=</span><span class="default_value">5</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L1350-L1439"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.ChargeInsertionAnalyzer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pymatgen.analysis.defects.utils.ChargeDensityAnalyzer" title="pymatgen.analysis.defects.utils.ChargeDensityAnalyzer"><code class="xref py py-class docutils literal notranslate"><span class="pre">pymatgen.analysis.defects.utils.ChargeDensityAnalyzer</span></code></a></p>
<p>Analyze the charge density and create new candidate structures by inserting at each charge minima
The similar inserterd structures are given the same uniqueness label.
This works best with AECCAR data since CHGCAR data often contains spurious local minima in the core.
However you can still use CHGCAR with an appropriate max_avg_charge value.</p>
<p>Application of this for Li can be found at:
J.-X. Shen et al.: npj Comput. Mater. 6, 1 (2020)
<a class="reference external" href="https://www.nature.com/articles/s41524-020-00422-3">https://www.nature.com/articles/s41524-020-00422-3</a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>chgcar</strong> – The charge density object to analyze</p></li>
<li><p><strong>working_ion</strong> – The working ion to be inserted</p></li>
<li><p><strong>avg_radius</strong> – The radius used to calculate average charge density at each site</p></li>
<li><p><strong>max_avg_charge</strong> – Do no consider local minmas with avg charge above this value.</p></li>
<li><p><strong>clustering_tol</strong> – Distance tolerance for grouping sites together</p></li>
<li><p><strong>ltol</strong> – StructureMatcher ltol parameter</p></li>
<li><p><strong>stol</strong> – StructureMatcher stol parameter</p></li>
<li><p><strong>angle_tol</strong> – StructureMatcher angle_tol parameter</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.ChargeInsertionAnalyzer.get_labels">
<code class="sig-name descname">get_labels</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L1392-L1439"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.ChargeInsertionAnalyzer.get_labels" title="Permalink to this definition">¶</a></dt>
<dd><p>Populate the extrema dataframe (self._extrema_df) with the insertion structure.
Then, group the sites by structure similarity.
Finally store a full list of the insertion sites, with their labels as a Structure Object</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="pymatgen.analysis.defects.utils.QModel">
<em class="property">class </em><code class="sig-name descname">QModel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">beta</span><span class="o">=</span><span class="default_value">1.0</span></em>, <em class="sig-param"><span class="n">expnorm</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="n">gamma</span><span class="o">=</span><span class="default_value">1.0</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L68-L119"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.QModel" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">monty.json.MSONable</span></code></p>
<p>Model for the defect charge distribution.
A combination of exponential tail and gaussian distribution is used
(see Freysoldt (2011), DOI: 10.1002/pssb.201046289 )
q_model(r) = q [x exp(-r/gamma) + (1-x) exp(-r^2/beta^2)]</p>
<blockquote>
<div><p>without normalization constants</p>
</div></blockquote>
<p>By default, gaussian distribution with 1 Bohr width is assumed.
If defect charge is more delocalized, exponential tail is suggested.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>beta</strong> – Gaussian decay constant. Default value is 1 Bohr.
When delocalized (eg. diamond), 2 Bohr is more appropriate.</p></li>
<li><p><strong>expnorm</strong> – Weight for the exponential tail in the range of [0-1].
Default is 0.0 indicating no tail .
For delocalized charges ideal value is around 0.54-0.6.</p></li>
<li><p><strong>gamma</strong> – Exponential decay constant</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.QModel.rho_rec">
<code class="sig-name descname">rho_rec</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">g2</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L98-L110"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.QModel.rho_rec" title="Permalink to this definition">¶</a></dt>
<dd><p>Reciprocal space model charge value
for input squared reciprocal vector.
:param g2: Square of reciprocal vector</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Charge density at the reciprocal vector magnitude</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.QModel.rho_rec_limit0">
<em class="property">property </em><code class="sig-name descname">rho_rec_limit0</code><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.QModel.rho_rec_limit0" title="Permalink to this definition">¶</a></dt>
<dd><p>Reciprocal space model charge value
close to reciprocal vector 0 .
rho_rec(g->0) -> 1 + rho_rec_limit0 * g^2</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="pymatgen.analysis.defects.utils.StructureMotifInterstitial">
<em class="property">class </em><code class="sig-name descname">StructureMotifInterstitial</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">struct</span></em>, <em class="sig-param"><span class="n">inter_elem</span></em>, <em class="sig-param"><span class="n">motif_types</span><span class="o">=</span><span class="default_value">'tetrahedral', 'octahedral'</span></em>, <em class="sig-param"><span class="n">op_threshs</span><span class="o">=</span><span class="default_value">0.3, 0.5</span></em>, <em class="sig-param"><span class="n">dl</span><span class="o">=</span><span class="default_value">0.2</span></em>, <em class="sig-param"><span class="n">doverlap</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">facmaxdl</span><span class="o">=</span><span class="default_value">1.01</span></em>, <em class="sig-param"><span class="n">verbose</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L208-L571"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.StructureMotifInterstitial" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Generate interstitial sites at positions
where the interstitialcy is coordinated by nearest neighbors
in a way that resembles basic structure motifs
(e.g., tetrahedra, octahedra). The algorithm is called InFiT
(Interstitialcy Finding Tool), it was introducted by
Nils E. R. Zimmermann, Matthew K. Horton, Anubhav Jain,
and Maciej Haranczyk (Front. Mater., 4, 34, 2017),
and it is used by the Python Charged Defect Toolkit
(PyCDT: D. Broberg et al., Comput. Phys. Commun., in press, 2018).</p>
<p>Generates symmetrically distinct interstitial sites at positions
where the interstitial is coordinated by nearest neighbors
in a pattern that resembles a supported structure motif
(e.g., tetrahedra, octahedra).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>struct</strong> (<a class="reference internal" href="pymatgen.core.structure.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – input structure for which symmetrically
distinct interstitial sites are to be found.</p></li>
<li><p><strong>inter_elem</strong> (<em>string</em>) – element symbol of desired interstitial.</p></li>
<li><p><strong>motif_types</strong> (<em>[</em><em>string</em><em>]</em>) – list of structure motif types that are
to be considered. Permissible types are:
tet (tetrahedron), oct (octahedron).</p></li>
<li><p><strong>op_threshs</strong> (<em>[</em><em>float</em><em>]</em>) – threshold values for the underlying order
parameters to still recognize a given structural motif
(i.e., for an OP value >= threshold the coordination pattern
match is positive, for OP < threshold the match is
negative.</p></li>
<li><p><strong>dl</strong> (<em>float</em>) – grid fineness in Angstrom. The input
structure is divided into a grid of dimension
a/dl x b/dl x c/dl along the three crystallographic
directions, with a, b, and c being the lengths of
the three lattice vectors of the input unit cell.</p></li>
<li><p><strong>doverlap</strong> (<em>float</em>) – distance that is considered
to flag an overlap between any trial interstitial site
and a host atom.</p></li>
<li><p><strong>facmaxdl</strong> (<em>float</em>) – factor to be multiplied with the maximum grid
width that is then used as a cutoff distance for the
clustering prune step.</p></li>
<li><p><strong>verbose</strong> (<em>bool</em>) – flag indicating whether (True) or not (False;
default) to print additional information to screen.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.StructureMotifInterstitial.enumerate_defectsites">
<code class="sig-name descname">enumerate_defectsites</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L493-L501"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.StructureMotifInterstitial.enumerate_defectsites" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all defect sites.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><dl class="simple">
<dt>list of periodic sites</dt><dd><p>representing the interstitials.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>defect_sites ([<a class="reference internal" href="pymatgen.core.sites.html#pymatgen.core.sites.PeriodicSite" title="pymatgen.core.sites.PeriodicSite">PeriodicSite</a>])</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.StructureMotifInterstitial.get_coordinating_elements_cns">
<code class="sig-name descname">get_coordinating_elements_cns</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">i</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L518-L527"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.StructureMotifInterstitial.get_coordinating_elements_cns" title="Permalink to this definition">¶</a></dt>
<dd><p>Get element-specific coordination numbers of defect with index i.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><dl class="simple">
<dt>dictionary storing the coordination numbers (int)</dt><dd><p>with string representation of elements as keys.
(i.e., {elem1 (string): cn1 (int), …}).</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>elem_cn (dict)</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.StructureMotifInterstitial.get_defectsite_multiplicity">
<code class="sig-name descname">get_defectsite_multiplicity</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L512-L516"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.StructureMotifInterstitial.get_defectsite_multiplicity" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the symmtric multiplicity of the defect site at the index.</p>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.StructureMotifInterstitial.get_motif_type">
<code class="sig-name descname">get_motif_type</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">i</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L503-L510"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.StructureMotifInterstitial.get_motif_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the motif type of defect with index i (e.g., “tet”).</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>motif type.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>motif (string)</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.StructureMotifInterstitial.get_op_value">
<code class="sig-name descname">get_op_value</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">i</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L529-L536"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.StructureMotifInterstitial.get_op_value" title="Permalink to this definition">¶</a></dt>
<dd><p>Get order-parameter value of defect with index i.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>OP value.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>opval (float)</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.StructureMotifInterstitial.make_supercells_with_defects">
<code class="sig-name descname">make_supercells_with_defects</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">scaling_matrix</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L538-L571"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.StructureMotifInterstitial.make_supercells_with_defects" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a sequence of supercells
in which each supercell contains a single interstitial,
except for the first supercell in the sequence
which is a copy of the defect-free input structure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>scaling_matrix</strong> (<em>3x3 integer array</em>) – scaling matrix
to transform the lattice vectors.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>sequence of supercells.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>scs ([<a class="reference internal" href="pymatgen.core.structure.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure">Structure</a>])</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="pymatgen.analysis.defects.utils.TopographyAnalyzer">
<em class="property">class </em><code class="sig-name descname">TopographyAnalyzer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">structure</span></em>, <em class="sig-param"><span class="n">framework_ions</span></em>, <em class="sig-param"><span class="n">cations</span></em>, <em class="sig-param"><span class="n">tol</span><span class="o">=</span><span class="default_value">0.0001</span></em>, <em class="sig-param"><span class="n">max_cell_range</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">check_volume</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">constrained_c_frac</span><span class="o">=</span><span class="default_value">0.5</span></em>, <em class="sig-param"><span class="n">thickness</span><span class="o">=</span><span class="default_value">0.5</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L574-L911"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.TopographyAnalyzer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>This is a generalized module to perform topological analyses of a crystal
structure using Voronoi tessellations. It can be used for finding potential
interstitial sites. Applications including using these sites for
inserting additional atoms or for analyzing diffusion pathways.</p>
<p>Note that you typically want to do some preliminary postprocessing after
the initial construction. The initial construction will create a lot of
points, especially for determining potential insertion sites. Some helper
methods are available to perform aggregation and elimination of nodes. A
typical use is something like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">a</span> <span class="o">=</span> <span class="n">TopographyAnalyzer</span><span class="p">(</span><span class="n">structure</span><span class="p">,</span> <span class="p">[</span><span class="s2">"O"</span><span class="p">],</span> <span class="p">[</span><span class="s2">"P"</span><span class="p">])</span>
<span class="n">a</span><span class="o">.</span><span class="n">cluster_nodes</span><span class="p">()</span>
<span class="n">a</span><span class="o">.</span><span class="n">remove_collisions</span><span class="p">()</span>
</pre></div>
</div>
<p>Init.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><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>) – An initial structure.</p></li>
<li><p><strong>framework_ions</strong> (<em>[</em><em>str</em><em>]</em>) – A list of ions to be considered as a
framework. Typically, this would be all anion species. E.g.,
[“O”, “S”].</p></li>
<li><p><strong>cations</strong> (<em>[</em><em>str</em><em>]</em>) – A list of ions to be considered as non-migrating
cations. E.g., if you are looking at Li3PS4 as a Li
conductor, Li is a mobile species. Your cations should be [
“P”]. The cations are used to exclude polyhedra from
diffusion analysis since those polyhedra are already occupied.</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – A tolerance distance for the analysis, used to
determine if something are actually periodic boundary images of
each other. Default is usually fine.</p></li>
<li><p><strong>max_cell_range</strong> (<em>int</em>) – This is the range of periodic images to
construct the Voronoi tesselation. A value of 1 means that we
include all points from (x +- 1, y +- 1, z+- 1) in the
voronoi construction. This is because the Voronoi poly
extends beyond the standard unit cell because of PBC.
Typically, the default value of 1 works fine for most
structures and is fast. But for really small unit
cells with high symmetry, you may need to increase this to 2
or higher.</p></li>
<li><p><strong>check_volume</strong> (<em>bool</em>) – Set False when ValueError always happen after
tuning tolerance.</p></li>
<li><p><strong>constrained_c_frac</strong> (<em>float</em>) – Constraint the region where users want
to do Topology analysis the default value is 0.5, which is the
fractional coordinate of the cell</p></li>
<li><p><strong>thickness</strong> (<em>float</em>) – Along with constrained_c_frac, limit the
thickness of the regions where we want to explore. Default is
0.5, which is mapping all the site of the unit cell.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.TopographyAnalyzer.analyze_symmetry">
<code class="sig-name descname">analyze_symmetry</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tol</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L868-L888"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.TopographyAnalyzer.analyze_symmetry" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>tol</strong> – Tolerance for SpaceGroupAnalyzer</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.TopographyAnalyzer.check_volume">
<code class="sig-name descname">check_volume</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L746-L760"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.TopographyAnalyzer.check_volume" title="Permalink to this definition">¶</a></dt>
<dd><p>Basic check for volume of all voronoi poly sum to unit cell volume
Note that this does not apply after poly combination.</p>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.TopographyAnalyzer.cluster_nodes">
<code class="sig-name descname">cluster_nodes</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tol</span><span class="o">=</span><span class="default_value">0.2</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L762-L801"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.TopographyAnalyzer.cluster_nodes" title="Permalink to this definition">¶</a></dt>
<dd><p>Cluster nodes that are too close together using a tol.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>tol</strong> (<em>float</em>) – A distance tolerance. PBC is taken into account.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.TopographyAnalyzer.get_structure_with_nodes">
<code class="sig-name descname">get_structure_with_nodes</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L821-L829"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.TopographyAnalyzer.get_structure_with_nodes" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the modified structure with the voronoi nodes inserted. The
species is set as a DummySpecies X.</p>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.TopographyAnalyzer.print_stats">
<code class="sig-name descname">print_stats</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L831-L855"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.TopographyAnalyzer.print_stats" title="Permalink to this definition">¶</a></dt>
<dd><p>Print stats such as the MSE dist.</p>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.TopographyAnalyzer.remove_collisions">
<code class="sig-name descname">remove_collisions</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">min_dist</span><span class="o">=</span><span class="default_value">0.5</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L803-L819"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.TopographyAnalyzer.remove_collisions" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove vnodes that are too close to existing atoms in the structure</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>min_dist</strong> (<em>float</em>) – The minimum distance that a vertex needs to be
from existing atoms.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.TopographyAnalyzer.vtk">
<code class="sig-name descname">vtk</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L890-L911"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.TopographyAnalyzer.vtk" title="Permalink to this definition">¶</a></dt>
<dd><p>Show VTK visualization.</p>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.TopographyAnalyzer.write_topology">
<code class="sig-name descname">write_topology</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">fname</span><span class="o">=</span><span class="default_value">'Topo.cif'</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L857-L866"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.TopographyAnalyzer.write_topology" title="Permalink to this definition">¶</a></dt>
<dd><p>Write topology to a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>fname</strong> – Filename</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="pymatgen.analysis.defects.utils.VoronoiPolyhedron">
<em class="property">class </em><code class="sig-name descname">VoronoiPolyhedron</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lattice</span></em>, <em class="sig-param"><span class="n">frac_coords</span></em>, <em class="sig-param"><span class="n">polyhedron_indices</span></em>, <em class="sig-param"><span class="n">all_coords</span></em>, <em class="sig-param"><span class="n">name</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L914-L969"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.VoronoiPolyhedron" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Convenience container for a voronoi point in PBC and its associated polyhedron.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>lattice</strong> – </p></li>
<li><p><strong>frac_coords</strong> – </p></li>
<li><p><strong>polyhedron_indices</strong> – </p></li>
<li><p><strong>all_coords</strong> – </p></li>
<li><p><strong>name</strong> – </p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.VoronoiPolyhedron.coordination">
<em class="property">property </em><code class="sig-name descname">coordination</code><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.VoronoiPolyhedron.coordination" title="Permalink to this definition">¶</a></dt>
<dd><p>Coordination number</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>return</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.VoronoiPolyhedron.is_image">
<code class="sig-name descname">is_image</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">poly</span></em>, <em class="sig-param"><span class="n">tol</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L933-L952"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.VoronoiPolyhedron.is_image" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>poly</strong> – VoronoiPolyhedron</p></li>
<li><p><strong>tol</strong> – Coordinate tolerance.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Whether a poly is an image of the current one.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="pymatgen.analysis.defects.utils.VoronoiPolyhedron.volume">
<em class="property">property </em><code class="sig-name descname">volume</code><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.VoronoiPolyhedron.volume" title="Permalink to this definition">¶</a></dt>
<dd><p>Volume</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>return</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py function">
<dt id="pymatgen.analysis.defects.utils.calculate_vol">
<code class="sig-name descname">calculate_vol</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">coords</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L1468-L1487"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.calculate_vol" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate volume given a set of coords.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>coords</strong> – List of coords.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Volume</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pymatgen.analysis.defects.utils.closestsites">
<code class="sig-name descname">closestsites</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">struct_blk</span></em>, <em class="sig-param"><span class="n">struct_def</span></em>, <em class="sig-param"><span class="n">pos</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L190-L205"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.closestsites" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns closest site to the input position
for both bulk and defect structures
:param struct_blk: Bulk structure
:param struct_def: Defect structure
:param pos: Position</p>
<p>Return: (site object, dist, index)</p>
</dd></dl>
<dl class="py function">
<dt id="pymatgen.analysis.defects.utils.converge">
<code class="sig-name descname">converge</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">f</span></em>, <em class="sig-param"><span class="n">step</span></em>, <em class="sig-param"><span class="n">tol</span></em>, <em class="sig-param"><span class="n">max_h</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L1490-L1505"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.converge" title="Permalink to this definition">¶</a></dt>
<dd><p>simple newton iteration based convergence function</p>
</dd></dl>
<dl class="py function">
<dt id="pymatgen.analysis.defects.utils.eV_to_k">
<code class="sig-name descname">eV_to_k</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">energy</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L122-L131"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.eV_to_k" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert energy to reciprocal vector magnitude k via hbar*k^2/2m
:param a: Energy in eV.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>(double) Reciprocal vector magnitude (units of 1/Bohr).</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pymatgen.analysis.defects.utils.generate_R_and_G_vecs">
<code class="sig-name descname">generate_R_and_G_vecs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">gamma</span></em>, <em class="sig-param"><span class="n">prec_set</span></em>, <em class="sig-param"><span class="n">lattice</span></em>, <em class="sig-param"><span class="n">epsilon</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L1548-L1620"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.generate_R_and_G_vecs" title="Permalink to this definition">¶</a></dt>
<dd><p>This returns a set of real and reciprocal lattice vectors
(and real/recip summation values)
based on a list of precision values (prec_set)</p>
<p>gamma (float): Ewald parameter
prec_set (list or number): for prec values to consider (20, 25, 30 are sensible numbers)
lattice: Lattice object of supercell in question</p>
</dd></dl>
<dl class="py function">
<dt id="pymatgen.analysis.defects.utils.generate_reciprocal_vectors_squared">
<code class="sig-name descname">generate_reciprocal_vectors_squared</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">a1</span></em>, <em class="sig-param"><span class="n">a2</span></em>, <em class="sig-param"><span class="n">a3</span></em>, <em class="sig-param"><span class="n">encut</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L172-L187"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.generate_reciprocal_vectors_squared" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate reciprocal vector magnitudes within the cutoff along the specied
lattice vectors.
:param a1: Lattice vector a (in Bohrs)
:param a2: Lattice vector b (in Bohrs)
:param a3: Lattice vector c (in Bohrs)
:param encut: Reciprocal vector energy cutoff</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>[[g1^2], [g2^2], …] Square of reciprocal vectors (1/Bohr)^2
determined by a1, a2, a3 and whose magntidue is less than gcut^2.</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pymatgen.analysis.defects.utils.generic_groupby">
<code class="sig-name descname">generic_groupby</code><span class="sig-paren">(</span><em class="sig-param">list_in</em>, <em class="sig-param">comp=<built-in function eq></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L1442-L1465"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.generic_groupby" title="Permalink to this definition">¶</a></dt>
<dd><p>Group a list of unsortable objects
:param list_in: A list of generic objects
:param comp: (Default value = operator.eq) The comparator</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>[int] list of labels for the input list</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pymatgen.analysis.defects.utils.genrecip">
<code class="sig-name descname">genrecip</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">a1</span></em>, <em class="sig-param"><span class="n">a2</span></em>, <em class="sig-param"><span class="n">a3</span></em>, <em class="sig-param"><span class="n">encut</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L134-L169"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.genrecip" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>a2</strong><strong>, </strong><strong>a3</strong> (<em>a1</em><em>,</em>) – lattice vectors in bohr</p></li>
<li><p><strong>encut</strong> – energy cut off in eV</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>reciprocal lattice vectors with energy less than encut</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pymatgen.analysis.defects.utils.tune_for_gamma">
<code class="sig-name descname">tune_for_gamma</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lattice</span></em>, <em class="sig-param"><span class="n">epsilon</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2021.1.28/pymatgen/analysis/defects/utils.py#L1508-L1545"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.analysis.defects.utils.tune_for_gamma" title="Permalink to this definition">¶</a></dt>
<dd><p>This tunes the gamma parameter for Kumagai anisotropic
Ewald calculation. Method is to find a gamma parameter which generates a similar
number of reciprocal and real lattice vectors,
given the suggested cut off radii by Kumagai and Oba</p>
</dd></dl>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2011, Pymatgen Development Team
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/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">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
<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>