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
|
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>pymatgen.analysis.structure_prediction package — pymatgen 2025.6.14 documentation</title>
<link rel="stylesheet" type="text/css" href="assets/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="assets/css/theme.css?v=e59714d7" />
<link rel="stylesheet" type="text/css" href="assets/css/custom.css" />
<link rel="canonical" href="https://pymatgen.orgpymatgen.analysis.structure_prediction.html"/>
<script src="assets/jquery.js?v=5d32c60e"></script>
<script src="assets/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="assets/documentation_options.js?v=03bec786"></script>
<script src="assets/doctools.js?v=9bcbadda"></script>
<script src="assets/sphinx_highlight.js?v=dc90522c"></script>
<script src="assets/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</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">
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="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="Navigation menu">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">pymatgen.analysis.structure_prediction package</a><ul>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#module-pymatgen.analysis.structure_prediction.dopant_predictor">pymatgen.analysis.structure_prediction.dopant_predictor module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.dopant_predictor.get_dopants_from_shannon_radii"><code class="docutils literal notranslate"><span class="pre">get_dopants_from_shannon_radii()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.dopant_predictor.get_dopants_from_substitution_probabilities"><code class="docutils literal notranslate"><span class="pre">get_dopants_from_substitution_probabilities()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.analysis.structure_prediction.substitution_probability">pymatgen.analysis.structure_prediction.substitution_probability module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionPredictor"><code class="docutils literal notranslate"><span class="pre">SubstitutionPredictor</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionPredictor.composition_prediction"><code class="docutils literal notranslate"><span class="pre">SubstitutionPredictor.composition_prediction()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionPredictor.list_prediction"><code class="docutils literal notranslate"><span class="pre">SubstitutionPredictor.list_prediction()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability"><code class="docutils literal notranslate"><span class="pre">SubstitutionProbability</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.as_dict"><code class="docutils literal notranslate"><span class="pre">SubstitutionProbability.as_dict()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.cond_prob"><code class="docutils literal notranslate"><span class="pre">SubstitutionProbability.cond_prob()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.cond_prob_list"><code class="docutils literal notranslate"><span class="pre">SubstitutionProbability.cond_prob_list()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.from_dict"><code class="docutils literal notranslate"><span class="pre">SubstitutionProbability.from_dict()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.get_lambda"><code class="docutils literal notranslate"><span class="pre">SubstitutionProbability.get_lambda()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.get_px"><code class="docutils literal notranslate"><span class="pre">SubstitutionProbability.get_px()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.pair_corr"><code class="docutils literal notranslate"><span class="pre">SubstitutionProbability.pair_corr()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.prob"><code class="docutils literal notranslate"><span class="pre">SubstitutionProbability.prob()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.analysis.structure_prediction.substitutor">pymatgen.analysis.structure_prediction.substitutor module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor"><code class="docutils literal notranslate"><span class="pre">Substitutor</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.as_dict"><code class="docutils literal notranslate"><span class="pre">Substitutor.as_dict()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.charge_balanced_tol"><code class="docutils literal notranslate"><span class="pre">Substitutor.charge_balanced_tol</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.from_dict"><code class="docutils literal notranslate"><span class="pre">Substitutor.from_dict()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.get_allowed_species"><code class="docutils literal notranslate"><span class="pre">Substitutor.get_allowed_species()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.pred_from_comp"><code class="docutils literal notranslate"><span class="pre">Substitutor.pred_from_comp()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.pred_from_list"><code class="docutils literal notranslate"><span class="pre">Substitutor.pred_from_list()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.pred_from_structures"><code class="docutils literal notranslate"><span class="pre">Substitutor.pred_from_structures()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#module-pymatgen.analysis.structure_prediction.volume_predictor">pymatgen.analysis.structure_prediction.volume_predictor module</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.volume_predictor.DLSVolumePredictor"><code class="docutils literal notranslate"><span class="pre">DLSVolumePredictor</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.volume_predictor.DLSVolumePredictor.get_predicted_structure"><code class="docutils literal notranslate"><span class="pre">DLSVolumePredictor.get_predicted_structure()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.volume_predictor.DLSVolumePredictor.predict"><code class="docutils literal notranslate"><span class="pre">DLSVolumePredictor.predict()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.volume_predictor.RLSVolumePredictor"><code class="docutils literal notranslate"><span class="pre">RLSVolumePredictor</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.volume_predictor.RLSVolumePredictor.get_predicted_structure"><code class="docutils literal notranslate"><span class="pre">RLSVolumePredictor.get_predicted_structure()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.structure_prediction.volume_predictor.RLSVolumePredictor.predict"><code class="docutils literal notranslate"><span class="pre">RLSVolumePredictor.predict()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" style="background: linear-gradient(0deg, rgba(23,63,162,1) 0%, rgba(0,70,192,1) 100%)" >
<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="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">pymatgen.analysis.structure_prediction package</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/materialsproject/pymatgen/blob/master/docs_rst/pymatgen.analysis.structure_prediction.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">
<section id="module-pymatgen.analysis.structure_prediction">
<span id="pymatgen-analysis-structure-prediction-package"></span><h1>pymatgen.analysis.structure_prediction package<a class="headerlink" href="#module-pymatgen.analysis.structure_prediction" title="Link to this heading"></a></h1>
<p>Utilities to predict new structures.</p>
<section id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Link to this heading"></a></h2>
</section>
<section id="module-pymatgen.analysis.structure_prediction.dopant_predictor">
<span id="pymatgen-analysis-structure-prediction-dopant-predictor-module"></span><h2>pymatgen.analysis.structure_prediction.dopant_predictor module<a class="headerlink" href="#module-pymatgen.analysis.structure_prediction.dopant_predictor" title="Link to this heading"></a></h2>
<p>Predicting potential dopants.</p>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.dopant_predictor.get_dopants_from_shannon_radii">
<span class="sig-name descname"><span class="pre">get_dopants_from_shannon_radii</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bonded_structure</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num_dopants</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">match_oxi_sign</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/dopant_predictor.py#L60-L125"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.dopant_predictor.get_dopants_from_shannon_radii" title="Link to this definition"></a></dt>
<dd><p>Get dopant suggestions based on Shannon radii differences.</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>bonded_structure</strong> (<a class="reference internal" href="pymatgen.analysis.html#pymatgen.analysis.graphs.StructureGraph" title="pymatgen.analysis.graphs.StructureGraph"><em>StructureGraph</em></a>) – A pymatgen structure graph
decorated with oxidation states. For example, generated using the
CrystalNN.get_bonded_structure() method.</p></li>
<li><p><strong>num_dopants</strong> (<em>int</em>) – The number of suggestions to return for
n- and p-type dopants.</p></li>
<li><p><strong>match_oxi_sign</strong> (<em>bool</em>) – Whether to force the dopant and original species
to have the same sign of oxidation state. E.g. If the original site
is in a negative charge state, then only negative dopants will be
returned.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>Dopant suggestions, given as a dictionary with keys “n_type” and</dt><dd><p>”p_type”. The suggestions for each doping type are given as a list of
dictionaries, each with they keys:</p>
<ul class="simple">
<li><p>”radii_diff”: The difference between the Shannon radii of the species.</p></li>
<li><p>”dopant_species”: The dopant species.</p></li>
<li><p>”original_species”: The substituted species.</p></li>
</ul>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.dopant_predictor.get_dopants_from_substitution_probabilities">
<span class="sig-name descname"><span class="pre">get_dopants_from_substitution_probabilities</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structure</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num_dopants</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">threshold</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.001</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">match_oxi_sign</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">dict</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/dopant_predictor.py#L13-L57"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.dopant_predictor.get_dopants_from_substitution_probabilities" title="Link to this definition"></a></dt>
<dd><p>Get dopant suggestions based on substitution probabilities.</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>structure</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – A pymatgen structure decorated with
oxidation states.</p></li>
<li><p><strong>num_dopants</strong> (<em>int</em>) – The number of suggestions to return for
n- and p-type dopants.</p></li>
<li><p><strong>threshold</strong> (<em>float</em>) – Probability threshold for substitutions.</p></li>
<li><p><strong>match_oxi_sign</strong> (<em>bool</em>) – Whether to force the dopant and original species
to have the same sign of oxidation state. E.g. If the original site
is in a negative charge state, then only negative dopants will be
returned.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>Dopant suggestions, given as a dictionary with keys “n_type” and</dt><dd><p>”p_type”. The suggestions for each doping type are given as a list of
dictionaries, each with they keys:</p>
<ul class="simple">
<li><p>”probability”: The probability of substitution.</p></li>
<li><p>”dopant_species”: The dopant species.</p></li>
<li><p>”original_species”: The substituted species.</p></li>
</ul>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict</p>
</dd>
</dl>
</dd></dl>
</section>
<section id="module-pymatgen.analysis.structure_prediction.substitution_probability">
<span id="pymatgen-analysis-structure-prediction-substitution-probability-module"></span><h2>pymatgen.analysis.structure_prediction.substitution_probability module<a class="headerlink" href="#module-pymatgen.analysis.structure_prediction.substitution_probability" title="Link to this heading"></a></h2>
<p>This module provides classes for representing species substitution probabilities.</p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionPredictor">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">SubstitutionPredictor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">lambda_table</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">alpha</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">threshold</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.001</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L184-L281"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionPredictor" title="Link 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>Predicts likely substitutions either to or from a given composition
or species list using the SubstitutionProbability.</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>lambda_table</strong> (<em>dict</em>) – Input lambda table.</p></li>
<li><p><strong>alpha</strong> (<em>float</em>) – weight function for never observed substitutions</p></li>
<li><p><strong>threshold</strong> (<em>float</em>) – Threshold to use to identify high probability structures.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionPredictor.composition_prediction">
<span class="sig-name descname"><span class="pre">composition_prediction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">composition</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">to_this_composition</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L252-L281"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionPredictor.composition_prediction" title="Link to this definition"></a></dt>
<dd><p>Get charged balanced substitutions from a starting or ending
composition.</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>composition</strong> – starting or ending composition</p></li>
<li><p><strong>to_this_composition</strong> – If true, substitutions with this as a final composition
will be found. If false, substitutions with this as a
starting composition will be found (these are slightly
different)</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>List of predictions in the form of dictionaries.
If to_this_composition is true, the values of the dictionary
will be from the list species. If false, the keys will be
from that list.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionPredictor.list_prediction">
<span class="sig-name descname"><span class="pre">list_prediction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">species</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">to_this_composition</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L200-L250"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionPredictor.list_prediction" title="Link to this definition"></a></dt>
<dd><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>species</strong> – list of species</p></li>
<li><p><strong>to_this_composition</strong> – If true, substitutions with this as a final composition
will be found. If false, substitutions with this as a
starting composition will be found (these are slightly
different).</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>List of predictions in the form of dictionaries.
If to_this_composition is true, the values of the dictionary
will be from the list species. If false, the keys will be
from that list.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">SubstitutionProbability</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L35-L181"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability" title="Link 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 class finds substitution probabilities given lists of atoms
to substitute. The inputs make more sense if you look through the
from_defaults static method.</p>
<p>The substitution prediction algorithm is presented in:
Hautier, G., Fischer, C., Ehrlacher, V., Jain, A., and Ceder, G. (2011)
Data Mined Ionic Substitutions for the Discovery of New Compounds.
Inorganic Chemistry, 50(2), 656-663. doi:10.1021/ic102031h</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>lambda_table</strong> – JSON table of the weight functions lambda if None,
will use the default lambda.json table</p></li>
<li><p><strong>alpha</strong> (<em>float</em>) – weight function for never observed substitutions.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.as_dict">
<span class="sig-name descname"><span class="pre">as_dict</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L162-L170"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.as_dict" title="Link to this definition"></a></dt>
<dd><p>Get MSONable dict.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.cond_prob">
<span class="sig-name descname"><span class="pre">cond_prob</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">s2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L119-L132"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.cond_prob" title="Link to this definition"></a></dt>
<dd><p>Conditional probability of substituting s1 for s2.</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>s1</strong> – The <em>variable</em> specie</p></li>
<li><p><strong>s2</strong> – The <em>fixed</em> specie</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Conditional probability used by structure predictor.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.cond_prob_list">
<span class="sig-name descname"><span class="pre">cond_prob_list</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">l1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">l2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L143-L160"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.cond_prob_list" title="Link to this definition"></a></dt>
<dd><p>Find the probabilities of 2 lists. These should include ALL species.
This is the probability conditional on l2.</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>l1</strong> – lists of species</p></li>
<li><p><strong>l2</strong> – lists of species</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>The conditional probability (assuming these species are in
l2)</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.from_dict">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dct</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L172-L181"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.from_dict" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>dct</strong> (<em>dict</em>) – Dict representation.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Class</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.get_lambda">
<span class="sig-name descname"><span class="pre">get_lambda</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">s2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L88-L98"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.get_lambda" title="Link to this definition"></a></dt>
<dd><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>s1</strong> (<em>SpeciesLike</em>) – Ion in 1st structure.</p></li>
<li><p><strong>s2</strong> (<em>SpeciesLike</em>) – Ion in 2nd structure.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Lambda values</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.get_px">
<span class="sig-name descname"><span class="pre">get_px</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sp</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">SpeciesLike</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">float</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L100-L108"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.get_px" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>sp</strong> (<em>SpeciesLike</em>) – Species.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Probability</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.pair_corr">
<span class="sig-name descname"><span class="pre">pair_corr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">s2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L134-L141"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.pair_corr" title="Link to this definition"></a></dt>
<dd><p>Pair correlation of two species.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>The pair correlation of 2 species</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.prob">
<span class="sig-name descname"><span class="pre">prob</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">s2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitution_probability.py#L110-L117"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitution_probability.SubstitutionProbability.prob" title="Link to this definition"></a></dt>
<dd><p>Get the probability of 2 species substitution. Not used by the
structure predictor.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>Probability of s1 and s2 substitution.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</section>
<section id="module-pymatgen.analysis.structure_prediction.substitutor">
<span id="pymatgen-analysis-structure-prediction-substitutor-module"></span><h2>pymatgen.analysis.structure_prediction.substitutor module<a class="headerlink" href="#module-pymatgen.analysis.structure_prediction.substitutor" title="Link to this heading"></a></h2>
<p>This module provides classes for predicting new structures from existing ones.</p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitutor.Substitutor">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">Substitutor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">threshold</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.001</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">symprec</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0.1</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitutor.py#L34-L265"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">MSONable</span></code></p>
<p>This object uses a data mined ionic substitution approach to propose
compounds likely to be stable. It relies on an algorithm presented in
Hautier, G., Fischer, C., Ehrlacher, V., Jain, A., and Ceder, G. (2011).
Data Mined Ionic Substitutions for the Discovery of New Compounds.
Inorganic Chemistry, 50(2), 656-663. doi:10.1021/ic102031h.</p>
<p>Use the substitution probability class to find good substitutions for a given chemistry or structure.</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>threshold</strong> – probability threshold for predictions</p></li>
<li><p><strong>symprec</strong> – symmetry precision to determine if two structures
are duplicates</p></li>
<li><p><strong>kwargs</strong> – kwargs for the SubstitutionProbability object
lambda_table, alpha</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitutor.Substitutor.as_dict">
<span class="sig-name descname"><span class="pre">as_dict</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitutor.py#L243-L252"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.as_dict" title="Link to this definition"></a></dt>
<dd><p>Get MSONable dict.</p>
</dd></dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitutor.Substitutor.charge_balanced_tol">
<span class="sig-name descname"><span class="pre">charge_balanced_tol</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">float</span></em><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">1e-09</span></em><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/analysis/structure_prediction/substitutor.py"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.charge_balanced_tol" title="Link to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitutor.Substitutor.from_dict">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_dict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dct</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">Self</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitutor.py#L254-L265"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.from_dict" title="Link to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>dct</strong> (<em>dict</em>) – Dict representation.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Class</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitutor.Substitutor.get_allowed_species">
<span class="sig-name descname"><span class="pre">get_allowed_species</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitutor.py#L67-L71"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.get_allowed_species" title="Link to this definition"></a></dt>
<dd><p>Get the species in the domain of the probability function
any other specie will not work.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitutor.Substitutor.pred_from_comp">
<span class="sig-name descname"><span class="pre">pred_from_comp</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">composition</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">dict</span><span class="p"><span class="pre">]</span></span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitutor.py#L226-L241"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.pred_from_comp" title="Link to this definition"></a></dt>
<dd><p>Similar to pred_from_list except this method returns a list after
checking that compositions are charge balanced.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitutor.Substitutor.pred_from_list">
<span class="sig-name descname"><span class="pre">pred_from_list</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">species_list</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">dict</span><span class="p"><span class="pre">]</span></span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitutor.py#L173-L224"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.pred_from_list" title="Link to this definition"></a></dt>
<dd><p>There are an exceptionally large number of substitutions to
look at (260^n), where n is the number of species in the
list. We need a more efficient than brute force way of going
through these possibilities. The brute force method would be:</p>
<blockquote>
<div><p>output = []
for p in itertools.product(self._sp.species_list, repeat=len(species_list)):</p>
<blockquote>
<div><dl class="simple">
<dt>if self._sp.conditional_probability_list(p, species_list) > self._threshold:</dt><dd><p>output.append(dict(zip(species_list, p)))</p>
</dd>
</dl>
</div></blockquote>
<p>return output</p>
</div></blockquote>
<p>Instead of that we do a branch and bound.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>species_list</strong> – list of species in the starting structure</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>list of dictionaries, each including a substitutions
dictionary, and a probability value</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.substitutor.Substitutor.pred_from_structures">
<span class="sig-name descname"><span class="pre">pred_from_structures</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">target_species</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">structures</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">remove_duplicates</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">remove_existing</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="pymatgen.alchemy.html#pymatgen.alchemy.materials.TransformedStructure" title="pymatgen.alchemy.materials.TransformedStructure"><span class="pre">TransformedStructure</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/substitutor.py#L73-L161"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.substitutor.Substitutor.pred_from_structures" title="Link to this definition"></a></dt>
<dd><p>Performs a structure prediction targeting compounds containing all of
the target_species, based on a list of structure (those structures
can for instance come from a database like the ICSD). It will return
all the structures formed by ionic substitutions with a probability
higher than the threshold.</p>
<p class="rubric">Notes</p>
<p>If the default probability model is used, input structures must
be oxidation state decorated. See AutoOxiStateDecorationTransformation</p>
<p>This method does not change the number of species in a structure. i.e
if the number of target species is 3, only input structures containing
3 species will be considered.</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>target_species</strong> – a list of species with oxidation states
e.g. [Species(‘Li+’), Species(‘Ni2+’), Species(‘O-2’)]</p></li>
<li><p><strong>structures_list</strong> – list of dictionary of the form {‘structure’: Structure object, ‘id’: some id where it comes from}
The id can for instance refer to an ICSD id.</p></li>
<li><p><strong>remove_duplicates</strong> – if True, the duplicates in the predicted structures will
be removed</p></li>
<li><p><strong>remove_existing</strong> – if True, the predicted structures that already exist in the
structures_list will be removed</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>a list of TransformedStructure objects.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</section>
<section id="module-pymatgen.analysis.structure_prediction.volume_predictor">
<span id="pymatgen-analysis-structure-prediction-volume-predictor-module"></span><h2>pymatgen.analysis.structure_prediction.volume_predictor module<a class="headerlink" href="#module-pymatgen.analysis.structure_prediction.volume_predictor" title="Link to this heading"></a></h2>
<p>Predict volumes of crystal structures.</p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.volume_predictor.DLSVolumePredictor">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">DLSVolumePredictor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cutoff</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">4.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">min_scaling</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.5</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_scaling</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1.5</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/volume_predictor.py#L132-L241"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.volume_predictor.DLSVolumePredictor" title="Link 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>Data-mined lattice scaling (DLS) scheme that relies on data-mined bond
lengths to predict the crystal volume of a given structure.</p>
<p>As of 2/12/19, we suggest this method be used in conjunction with
min_scaling and max_scaling to prevent instances of very large, unphysical
predicted volumes found in a small subset of structures.</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>cutoff</strong> (<em>float</em>) – cutoff radius added to site radius for finding
site pairs. Necessary to increase only if your initial
structure guess is extremely bad (atoms way too far apart). In
all other instances, increasing cutoff gives same answer
but takes more time.</p></li>
<li><p><strong>min_scaling</strong> (<em>float</em>) – if not None, this will ensure that the new
volume is at least this fraction of the original (preventing
too-small volumes)</p></li>
<li><p><strong>max_scaling</strong> (<em>float</em>) – if not None, this will ensure that the new
volume is at most this fraction of the original (preventing
too-large volumes).</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.volume_predictor.DLSVolumePredictor.get_predicted_structure">
<span class="sig-name descname"><span class="pre">get_predicted_structure</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">icsd_vol</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/volume_predictor.py#L228-L241"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.volume_predictor.DLSVolumePredictor.get_predicted_structure" title="Link to this definition"></a></dt>
<dd><p>Given a structure, returns back the structure scaled to predicted
volume.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>structure</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – structure w/unknown volume</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>a Structure object with predicted volume</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.volume_predictor.DLSVolumePredictor.predict">
<span class="sig-name descname"><span class="pre">predict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">icsd_vol</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/volume_predictor.py#L161-L226"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.volume_predictor.DLSVolumePredictor.predict" title="Link to this definition"></a></dt>
<dd><p>Given a structure, returns the predicted volume.</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>structure</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – a crystal structure with an unknown volume.</p></li>
<li><p><strong>icsd_vol</strong> (<em>bool</em>) – True if the input structure’s volume comes from ICSD.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>a float value of the predicted volume.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.volume_predictor.RLSVolumePredictor">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">RLSVolumePredictor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">check_isostructural</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">radii_type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'ionic-atomic'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">use_bv</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/volume_predictor.py#L23-L129"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.volume_predictor.RLSVolumePredictor" title="Link 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>Reference lattice scaling (RLS) scheme that predicts the volume of a
structure based on a known crystal structure.</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>check_isostructural</strong> – Whether to test that the two structures are
isostructural. This algo works best for isostructural compounds.
Defaults to True.</p></li>
<li><p><strong>radii_type</strong> (<em>str</em>) – Types of radii to use. You can specify “ionic”
(only uses ionic radii), “atomic” (only uses atomic radii) or
“ionic-atomic” (uses either ionic or atomic radii, with a
preference for ionic where possible).</p></li>
<li><p><strong>use_bv</strong> (<em>bool</em>) – Whether to use BVAnalyzer to determine oxidation
states if not present.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.volume_predictor.RLSVolumePredictor.get_predicted_structure">
<span class="sig-name descname"><span class="pre">get_predicted_structure</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">ref_structure</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/volume_predictor.py#L113-L129"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.volume_predictor.RLSVolumePredictor.get_predicted_structure" title="Link to this definition"></a></dt>
<dd><p>Given a structure, returns back the structure scaled to predicted
volume.</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>structure</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – structure w/unknown volume</p></li>
<li><p><strong>ref_structure</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – A reference structure with a similar
structure but different species.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>a Structure object with predicted volume</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.structure_prediction.volume_predictor.RLSVolumePredictor.predict">
<span class="sig-name descname"><span class="pre">predict</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structure</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">ref_structure</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/structure_prediction/volume_predictor.py#L46-L111"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.structure_prediction.volume_predictor.RLSVolumePredictor.predict" title="Link to this definition"></a></dt>
<dd><p>Given a structure, returns the predicted volume.</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>structure</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – structure w/unknown volume</p></li>
<li><p><strong>ref_structure</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – A reference structure with a similar
structure but different species.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>a float value of the predicted volume</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</section>
</section>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>© Copyright 2011, Pymatgen Development Team.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
|