forked from materialsvirtuallab/pymatgen-analysis-diffusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpymatgen.analysis.diffusion.neb.periodic_dijkstra.html
170 lines (153 loc) · 11.3 KB
/
pymatgen.analysis.diffusion.neb.periodic_dijkstra.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<title>pymatgen.analysis.diffusion.neb.periodic_dijkstra module — pymatgen-diffusion 2022.7.21 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/flasky.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link media="only screen and (max-device-width: 480px)" href="_static/small_flask.css" type= "text/css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
<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-diffusion 2022.7.21 documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">pymatgen.analysis.diffusion.neb.periodic_dijkstra module</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-pymatgen.analysis.diffusion.neb.periodic_dijkstra">
<span id="pymatgen-analysis-diffusion-neb-periodic-dijkstra-module"></span><h1>pymatgen.analysis.diffusion.neb.periodic_dijkstra module<a class="headerlink" href="#module-pymatgen.analysis.diffusion.neb.periodic_dijkstra" title="Permalink to this heading">¶</a></h1>
<p>Dijkstra’s path search on a graph where the nodes are on a periodic graph</p>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.diffusion.neb.periodic_dijkstra.get_optimal_pathway_rev">
<span class="sig-name descname"><span class="pre">get_optimal_pathway_rev</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path_parent</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">leaf_node</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">tuple</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/analysis/diffusion/neb/periodic_dijkstra.html#get_optimal_pathway_rev"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.diffusion.neb.periodic_dijkstra.get_optimal_pathway_rev" title="Permalink to this definition">¶</a></dt>
<dd><p>follow a leaf node all the way up to source.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.diffusion.neb.periodic_dijkstra.periodic_dijkstra">
<span class="sig-name descname"><span class="pre">periodic_dijkstra</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">G:</span> <span class="pre">~networkx.classes.graph.Graph</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sources:</span> <span class="pre">set</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">weight:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre">'weight'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_image:</span> <span class="pre">int</span> <span class="pre">=</span> <span class="pre">2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">target_reached:</span> <span class="pre">~typing.Callable</span> <span class="pre">=</span> <span class="pre"><function</span> <span class="pre"><lambda>></span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/analysis/diffusion/neb/periodic_dijkstra.html#periodic_dijkstra"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.diffusion.neb.periodic_dijkstra.periodic_dijkstra" title="Permalink to this definition">¶</a></dt>
<dd><p>Find the lowest cost pathway from a source point in the periodic graph.
Since the search can move many cells away without finding the target
we have to limit how many cells away from (0,0,0) to search.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>G</strong> (<em>Graph</em>) – The graph object with additional “to_jimage” fields to
indicate edges across periodic images.</p></li>
<li><p><strong>sources</strong> (<em>set</em>) – the index of the source node</p></li>
<li><p><strong>target</strong> (<em>int</em><em>, </em><em>optional</em>) – The index of of target node, if None populate all nodes. Defaults to None.</p></li>
<li><p><strong>max_image</strong> (<em>int</em><em>, </em><em>optional</em>) – Defaults to 3.</p></li>
<li><p><strong>target_reached</strong> (<em>callable</em><em>, </em><em>optional</em>) – A function of (site_index, jimage) used to check
for stop iteration. This function is always called on the top of heap so it might miss the optimal path but
often can find a “good enough” path very quickly.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>a dictionary of the best cost found to periodic node keyed by (site_index, jimage)
path_parent: dictionary of optimal path parent for each node given in index-image pairs.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>best_ans</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.diffusion.neb.periodic_dijkstra.periodic_dijkstra_on_sgraph">
<span class="sig-name descname"><span class="pre">periodic_dijkstra_on_sgraph</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sgraph:</span> <span class="pre">~pymatgen.analysis.graphs.StructureGraph</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sources:</span> <span class="pre">~typing.Set</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">weight:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre">'weight'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_image:</span> <span class="pre">int</span> <span class="pre">=</span> <span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">target_reached:</span> <span class="pre">~typing.Callable</span> <span class="pre">=</span> <span class="pre"><function</span> <span class="pre"><lambda>></span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/analysis/diffusion/neb/periodic_dijkstra.html#periodic_dijkstra_on_sgraph"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.diffusion.neb.periodic_dijkstra.periodic_dijkstra_on_sgraph" title="Permalink to this definition">¶</a></dt>
<dd><p>Find the lowest cost pathway from a source point in the periodic graph.
Since the search can move many cells away without finding the target
we have to limit how many cells away from (0,0,0) to search.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sgraph</strong> (<em>Graph</em>) – The StructureGraph object used for path searching</p></li>
<li><p><strong>sources</strong> (<em>set</em>) – the index of the source node</p></li>
<li><p><strong>target</strong> (<em>int</em><em>, </em><em>optional</em>) – The index of of target node, if None populate all nodes. Defaults to None.</p></li>
<li><p><strong>max_image</strong> (<em>int</em><em>, </em><em>optional</em>) – Defaults to 3.</p></li>
<li><p><strong>target_reached</strong> (<em>callable</em><em>, </em><em>optional</em>) – A function of (site_index, jimage) used to check
for stop iteration. This function is always called on the top of heap so it might miss the optimal path but
often can find a “good enough” path very quickly.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>a dictionary of the best cost found to periodic node keyed by (site_index, jimage)
path_parent: dictionary of optimal path parent for each node given in index-image pairs.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>best_ans</p>
</dd>
</dl>
</dd></dl>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper"><h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
</ul></li>
</ul>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/pymatgen.analysis.diffusion.neb.periodic_dijkstra.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© Copyright 2016, Materials Virtual Lab.
</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>