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
|
<!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.prototypes 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.prototypes.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.prototypes package</a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.AflowPrototypeMatcher"><code class="docutils literal notranslate"><span class="pre">AflowPrototypeMatcher</span></code></a><ul>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.AflowPrototypeMatcher.get_prototypes"><code class="docutils literal notranslate"><span class="pre">AflowPrototypeMatcher.get_prototypes()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.canonicalize_element_wyckoffs"><code class="docutils literal notranslate"><span class="pre">canonicalize_element_wyckoffs()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.count_crystal_dof"><code class="docutils literal notranslate"><span class="pre">count_crystal_dof()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.count_crystal_sites"><code class="docutils literal notranslate"><span class="pre">count_crystal_sites()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.count_distinct_wyckoff_letters"><code class="docutils literal notranslate"><span class="pre">count_distinct_wyckoff_letters()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.count_values_for_wyckoff"><code class="docutils literal notranslate"><span class="pre">count_values_for_wyckoff()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.count_wyckoff_positions"><code class="docutils literal notranslate"><span class="pre">count_wyckoff_positions()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_anonymous_formula_from_prototype_formula"><code class="docutils literal notranslate"><span class="pre">get_anonymous_formula_from_prototype_formula()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_formula_from_protostructure_label"><code class="docutils literal notranslate"><span class="pre">get_formula_from_protostructure_label()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructure_label"><code class="docutils literal notranslate"><span class="pre">get_protostructure_label()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_aflow"><code class="docutils literal notranslate"><span class="pre">get_protostructure_label_from_aflow()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_moyopy"><code class="docutils literal notranslate"><span class="pre">get_protostructure_label_from_moyopy()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_spg_analyzer"><code class="docutils literal notranslate"><span class="pre">get_protostructure_label_from_spg_analyzer()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_spglib"><code class="docutils literal notranslate"><span class="pre">get_protostructure_label_from_spglib()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_protostructures_from_aflow_label_and_composition"><code class="docutils literal notranslate"><span class="pre">get_protostructures_from_aflow_label_and_composition()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_prototype_formula_from_composition"><code class="docutils literal notranslate"><span class="pre">get_prototype_formula_from_composition()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_prototype_from_protostructure"><code class="docutils literal notranslate"><span class="pre">get_prototype_from_protostructure()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.get_random_structure_for_protostructure"><code class="docutils literal notranslate"><span class="pre">get_random_structure_for_protostructure()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.sort_and_score_element_wyckoffs"><code class="docutils literal notranslate"><span class="pre">sort_and_score_element_wyckoffs()</span></code></a></li>
<li><a class="reference internal" href="#pymatgen.analysis.prototypes.split_alpha_numeric"><code class="docutils literal notranslate"><span class="pre">split_alpha_numeric()</span></code></a></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.prototypes package</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/materialsproject/pymatgen/blob/master/docs_rst/pymatgen.analysis.prototypes.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.prototypes">
<span id="pymatgen-analysis-prototypes-package"></span><h1>pymatgen.analysis.prototypes package<a class="headerlink" href="#module-pymatgen.analysis.prototypes" title="Link to this heading"></a></h1>
<p>This module is intended to match crystal structures against known crystallographic “prototype”
structures.</p>
<p>In this module, the AflowPrototypeMatcher uses the AFLOW LIBRARY OF CRYSTALLOGRAPHIC PROTOTYPES.
If using this particular class, please cite their publication appropriately:</p>
<p>Mehl, M. J., Hicks, D., Toher, C., Levy, O., Hanson, R. M., Hart, G., & Curtarolo, S. (2017).
The AFLOW library of crystallographic prototypes: part 1.
Computational Materials Science, 136, S1-S828.
<a class="reference external" href="https://doi.org/10.1016/j.commatsci.2017.01.017">https://doi.org/10.1016/j.commatsci.2017.01.017</a></p>
<p>The module also contains functions for getting the protostructure labels from a
variety of symmetry detection libraries (spglib, moyopy, aflow-sym). The protostructure
label is defined as the canonicalized aflow label with the alphabetically sorted
chemical system appended - <cite>aflow_sym_label:chemsys</cite>.</p>
<p>The utilities for determining the protostructure label are upstreamed from the
<cite>aviary</cite> package (<a class="reference external" href="https://github.com/CompRhys/aviary">https://github.com/CompRhys/aviary</a>). If using these functions,
please cite the following publications:</p>
<p>Goodall, R. E., Parackal, A. S., Faber, F. A., Armiento, R., & Lee, A. A. (2022).
Rapid discovery of stable materials by coordinate-free coarse graining.
Science advances, 8(30), eabn4117. <a class="reference external" href="https://doi.org/10.1126/sciadv.abn4117">https://doi.org/10.1126/sciadv.abn4117</a></p>
<p>Parackal, A. S., Goodall, R. E., Faber, F. A., & Armiento, R. (2024).
Identifying crystal structures beyond known prototypes from x-ray powder diffraction spectra.
Physical Review Materials, 8(10), 103801. <a class="reference external" href="https://doi.org/10.1103/PhysRevMaterials.8.103801">https://doi.org/10.1103/PhysRevMaterials.8.103801</a></p>
<dl class="py class">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.AflowPrototypeMatcher">
<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">AflowPrototypeMatcher</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">initial_ltol</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.2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initial_stol</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.3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">initial_angle_tol</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">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/prototypes/__init__.py#L116-L218"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.AflowPrototypeMatcher" 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 will match structures to their crystal prototypes, and will
attempt to group species together to match structures derived from
prototypes (e.g. an A_xB_1-x_C from a binary prototype), and will
give these the names the “-like” suffix.</p>
<p>This class uses data from the AFLOW LIBRARY OF CRYSTALLOGRAPHIC PROTOTYPES.
If using this class, please cite their publication appropriately:</p>
<p>Mehl, M. J., Hicks, D., Toher, C., Levy, O., Hanson, R. M., Hart, G., & Curtarolo, S. (2017).
The AFLOW library of crystallographic prototypes: part 1.
Computational Materials Science, 136, S1-S828.
<a class="reference external" href="https://doi.org/10.1016/j.commatsci.2017.01.017">https://doi.org/10.1016/j.commatsci.2017.01.017</a></p>
<p>Tolerances as defined in StructureMatcher. Tolerances will be
gradually decreased until only a single match is found (if possible).</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>initial_ltol</strong> (<em>float</em>) – fractional length tolerance.</p></li>
<li><p><strong>initial_stol</strong> (<em>float</em>) – site tolerance.</p></li>
<li><p><strong>initial_angle_tol</strong> (<em>float</em>) – angle tolerance.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.AflowPrototypeMatcher.get_prototypes">
<span class="sig-name descname"><span class="pre">get_prototypes</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><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 class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L199-L218"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.AflowPrototypeMatcher.get_prototypes" title="Link to this definition"></a></dt>
<dd><p>Get prototype(s) structures for a given input structure. If you use this method in
your work, please cite the appropriate AFLOW publication:</p>
<blockquote>
<div><p>Mehl, M. J., Hicks, D., Toher, C., Levy, O., Hanson, R. M., Hart, G., & Curtarolo,
S. (2017). The AFLOW library of crystallographic prototypes: part 1. Computational
Materials Science, 136, S1-S828. <a class="reference external" href="https://doi.org/10.1016/j.commatsci.2017.01.017">https://doi.org/10.1016/j.commatsci.2017.01.017</a></p>
</div></blockquote>
<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 to match</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>A list of dicts with keys “snl” for the matched prototype and</dt><dd><p>”tags”, a dict of tags (“mineral”, “strukturbericht” and “aflow”) of that
prototype. This should be a list containing just a single entry, but it is
possible a material can match multiple prototypes.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list[dict] | None</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.canonicalize_element_wyckoffs">
<span class="sig-name descname"><span class="pre">canonicalize_element_wyckoffs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element_wyckoffs</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">spg_num</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">str</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">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L571-L591"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.canonicalize_element_wyckoffs" title="Link to this definition"></a></dt>
<dd><p>Given an element ordering, canonicalize the associated Wyckoff positions
based on the alphabetical weight of equivalent choices of origin.</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>element_wyckoffs</strong> (<em>str</em>) – wyckoff substring section from aflow_label with the
wyckoff letters for different elements separated by underscores.</p></li>
<li><p><strong>spg_num</strong> (<em>int</em><em> | </em><em>str</em>) – International space group number.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>element_wyckoff string with canonical ordering of the wyckoff letters.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.count_crystal_dof">
<span class="sig-name descname"><span class="pre">count_crystal_dof</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">int</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L719-L738"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.count_crystal_dof" title="Link to this definition"></a></dt>
<dd><p>Count number of free parameters in coarse-grained protostructure_label
representation: how many degrees of freedom would remain to optimize during
a crystal structure relaxation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Number of free-parameters in given prototype</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.count_crystal_sites">
<span class="sig-name descname"><span class="pre">count_crystal_sites</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">int</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L741-L755"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.count_crystal_sites" title="Link to this definition"></a></dt>
<dd><p>Count number of sites from protostructure_label.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Number of free-parameters in given prototype</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.count_distinct_wyckoff_letters">
<span class="sig-name descname"><span class="pre">count_distinct_wyckoff_letters</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">int</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L680-L694"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.count_distinct_wyckoff_letters" title="Link to this definition"></a></dt>
<dd><p>Count number of distinct Wyckoff letters in protostructure_label.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>number of distinct Wyckoff letters in protostructure_label</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.count_values_for_wyckoff">
<span class="sig-name descname"><span class="pre">count_values_for_wyckoff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element_wyckoffs</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">counts</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">spg_num</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lookup_dict</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></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/prototypes/__init__.py#L238-L248"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.count_values_for_wyckoff" title="Link to this definition"></a></dt>
<dd><p>Count values from a lookup table and scale by wyckoff multiplicities.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.count_wyckoff_positions">
<span class="sig-name descname"><span class="pre">count_wyckoff_positions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">int</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L697-L716"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.count_wyckoff_positions" title="Link to this definition"></a></dt>
<dd><p>Count number of Wyckoff positions in protostructure_label.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>number of distinct Wyckoff positions in protostructure_label</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_anonymous_formula_from_prototype_formula">
<span class="sig-name descname"><span class="pre">get_anonymous_formula_from_prototype_formula</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">prototype_formula</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L656-L664"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_anonymous_formula_from_prototype_formula" title="Link to this definition"></a></dt>
<dd><p>Get an anonymous formula from a prototype formula.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_formula_from_protostructure_label">
<span class="sig-name descname"><span class="pre">get_formula_from_protostructure_label</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L667-L677"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_formula_from_protostructure_label" title="Link to this definition"></a></dt>
<dd><p>Get a formula from a protostructure label.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructure_label">
<span class="sig-name descname"><span class="pre">get_protostructure_label</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">struct</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">method</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Literal</span><span class="p"><span class="pre">[</span></span><span class="s"><span class="pre">'aflow'</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="s"><span class="pre">'spglib'</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="s"><span class="pre">'moyopy'</span></span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">raise_errors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</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">False</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> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L251-L282"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructure_label" title="Link to this definition"></a></dt>
<dd><p>Get protostructure label for a pymatgen 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>struct</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – pymatgen Structure</p></li>
<li><p><strong>method</strong> (<em>Literal</em><em>[</em><em>"aflow"</em><em>, </em><em>"spglib"</em><em>, </em><em>"moyopy"</em><em>]</em>) – Method to use for symmetry</p></li>
<li><p><strong>detection</strong></p></li>
<li><p><strong>raise_errors</strong> (<em>bool</em>) – Whether to raise errors or annotate them. Defaults to
False.</p></li>
<li><p><strong>**kwargs</strong> – Additional arguments for the specific method</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>protostructure_label which is constructed as <cite>aflow_label:chemsys</cite> or</dt><dd><p>explanation of failure if symmetry detection failed and <cite>raise_errors</cite>
is False.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructure_label_from_aflow">
<span class="sig-name descname"><span class="pre">get_protostructure_label_from_aflow</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">struct</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">raise_errors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</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">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">aflow_executable</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</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">None</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">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L285-L364"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_aflow" title="Link to this definition"></a></dt>
<dd><p>Get protostructure label for a pymatgen Structure. Make sure you’re running a
recent version of the aflow CLI as there’s been several breaking changes. This code
was tested under v3.2.12. The protostructure label is constructed as
<cite>aflow_label:chemsys</cite>.</p>
<dl class="simple">
<dt>Install guide: <a class="reference external" href="https://aflow.org/install-aflow/#install_aflow">https://aflow.org/install-aflow/#install_aflow</a></dt><dd><p><a class="reference external" href="http://aflow.org/install-aflow/install-aflow.sh">http://aflow.org/install-aflow/install-aflow.sh</a> -o install-aflow.sh
chmod 555 install-aflow.sh
./install-aflow.sh –slim</p>
</dd>
</dl>
<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>struct</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – pymatgen Structure</p></li>
<li><p><strong>aflow_executable</strong> (<em>str</em>) – path to aflow executable. Defaults to which(“aflow”).</p></li>
<li><p><strong>raise_errors</strong> (<em>bool</em>) – Whether to raise errors or annotate them. Defaults to
False.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>protostructure_label which is constructed as <cite>aflow_label:chemsys</cite> or</dt><dd><p>explanation of failure if symmetry detection failed and <cite>raise_errors</cite>
is False.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructure_label_from_moyopy">
<span class="sig-name descname"><span class="pre">get_protostructure_label_from_moyopy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">struct</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">raise_errors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</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">False</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><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L505-L568"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_moyopy" title="Link to this definition"></a></dt>
<dd><p>Get AFLOW prototype label using Moyopy for symmetry detection.</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>struct</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – pymatgen Structure object.</p></li>
<li><p><strong>raise_errors</strong> (<em>bool</em>) – Whether to raise errors or annotate them. Defaults to
False.</p></li>
<li><p><strong>symprec</strong> (<em>float</em>) – Initial symmetry precision for Moyopy. Defaults to 0.1.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>protostructure_label which is constructed as <cite>aflow_label:chemsys</cite> or</dt><dd><p>explanation of failure if symmetry detection failed and <cite>raise_errors</cite>
is False.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructure_label_from_spg_analyzer">
<span class="sig-name descname"><span class="pre">get_protostructure_label_from_spg_analyzer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">spg_analyzer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="pymatgen.symmetry.html#pymatgen.symmetry.analyzer.SpacegroupAnalyzer" title="pymatgen.symmetry.analyzer.SpacegroupAnalyzer"><span class="pre">SpacegroupAnalyzer</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">raise_errors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</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">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">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L406-L451"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_spg_analyzer" title="Link to this definition"></a></dt>
<dd><p>Get protostructure label for pymatgen SpacegroupAnalyzer.</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>spg_analyzer</strong> (<a class="reference internal" href="pymatgen.symmetry.html#pymatgen.symmetry.analyzer.SpacegroupAnalyzer" title="pymatgen.symmetry.analyzer.SpacegroupAnalyzer"><em>SpacegroupAnalyzer</em></a>) – pymatgen SpacegroupAnalyzer object.</p></li>
<li><p><strong>raise_errors</strong> (<em>bool</em>) – Whether to raise errors or annotate them. Defaults to
False.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>protostructure_label which is constructed as <cite>aflow_label:chemsys</cite> or</dt><dd><p>explanation of failure if symmetry detection failed and <cite>raise_errors</cite>
is False.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructure_label_from_spglib">
<span class="sig-name descname"><span class="pre">get_protostructure_label_from_spglib</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">struct</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">raise_errors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</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">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">init_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="n"><span class="pre">fallback_symprec</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</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">1e-05</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">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L454-L502"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructure_label_from_spglib" title="Link to this definition"></a></dt>
<dd><p>Get AFLOW prototype label for pymatgen 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>struct</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><em>Structure</em></a>) – pymatgen Structure object.</p></li>
<li><p><strong>raise_errors</strong> (<em>bool</em>) – Whether to raise errors or annotate them. Defaults to
False.</p></li>
<li><p><strong>init_symprec</strong> (<em>float</em>) – Initial symmetry precision for spglib. Defaults to 0.1.</p></li>
<li><p><strong>fallback_symprec</strong> (<em>float</em>) – Fallback symmetry precision for spglib if first
symmetry detection failed. Defaults to 1e-5.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>protostructure_label which is constructed as <cite>aflow_label:chemsys</cite> or</dt><dd><p>explanation of failure if symmetry detection failed and <cite>raise_errors</cite>
is False.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_protostructures_from_aflow_label_and_composition">
<span class="sig-name descname"><span class="pre">get_protostructures_from_aflow_label_and_composition</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">aflow_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">composition</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.composition.Composition" title="pymatgen.core.composition.Composition"><span class="pre">Composition</span></a></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">str</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/prototypes/__init__.py#L882-L913"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_protostructures_from_aflow_label_and_composition" title="Link to this definition"></a></dt>
<dd><p>Get a canonicalized string for the prototype.</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>aflow_label</strong> (<em>str</em>) – AFLOW-style prototype label</p></li>
<li><p><strong>composition</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.composition.Composition" title="pymatgen.core.composition.Composition"><em>Composition</em></a>) – pymatgen Composition object</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>List of possible protostructure labels that can be generated</dt><dd><p>from combinations of the input aflow_label and composition.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>list[str]</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_prototype_formula_from_composition">
<span class="sig-name descname"><span class="pre">get_prototype_formula_from_composition</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">composition</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.composition.Composition" title="pymatgen.core.composition.Composition"><span class="pre">Composition</span></a></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">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L626-L653"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_prototype_formula_from_composition" title="Link to this definition"></a></dt>
<dd><p>An anonymized formula. Unique species are arranged in alphabetical order
and assigned ascending alphabets. This format is used in the aflow structure
prototype labelling scheme.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>composition</strong> (<a class="reference internal" href="pymatgen.core.html#pymatgen.core.composition.Composition" title="pymatgen.core.composition.Composition"><em>Composition</em></a>) – Pymatgen Composition to process</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>anonymized formula where the species are in alphabetical order</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_prototype_from_protostructure">
<span class="sig-name descname"><span class="pre">get_prototype_from_protostructure</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">str</span></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L775-L829"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_prototype_from_protostructure" title="Link to this definition"></a></dt>
<dd><p>Get a canonicalized string for the prototype. This prototype should be
the same for all isopointal protostructures.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Canonicalized AFLOW-style prototype label</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.get_random_structure_for_protostructure">
<span class="sig-name descname"><span class="pre">get_random_structure_for_protostructure</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">protostructure_label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="pymatgen.core.html#pymatgen.core.structure.Structure" title="pymatgen.core.structure.Structure"><span class="pre">Structure</span></a></span></span><a class="reference external" href="https://github.com/materialsproject/pymatgen/blob/v2025.6.14/src/pymatgen/core/../analysis/prototypes/__init__.py#L916-L962"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.get_random_structure_for_protostructure" title="Link to this definition"></a></dt>
<dd><p>Generate a random structure for a given prototype structure.</p>
<p>NOTE that due to the random nature of the generation, the output structure
may be higher symmetry than the requested prototype 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>protostructure_label</strong> (<em>str</em>) – label constructed as <cite>aflow_label:chemsys</cite> where
aflow_label is an AFLOW-style prototype label chemsys is the alphabetically
sorted chemical system.</p></li>
<li><p><strong>**kwargs</strong> – Keyword arguments to pass to pyxtal().from_random()</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.sort_and_score_element_wyckoffs">
<span class="sig-name descname"><span class="pre">sort_and_score_element_wyckoffs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element_wyckoffs</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</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/prototypes/__init__.py#L594-L623"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.sort_and_score_element_wyckoffs" title="Link to this definition"></a></dt>
<dd><p>Determines the order or Wyckoff positions when canonicalizing AFLOW labels.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>element_wyckoffs</strong> (<em>str</em>) – wyckoff substring section from aflow_label with the
wyckoff letters for different elements separated by underscores.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>containing
- str: sorted Wyckoff position substring for AFLOW-style prototype label
- int: integer score to rank order when canonicalizing</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pymatgen.analysis.prototypes.split_alpha_numeric">
<span class="sig-name descname"><span class="pre">split_alpha_numeric</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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 class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">list</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></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/prototypes/__init__.py#L221-L235"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pymatgen.analysis.prototypes.split_alpha_numeric" title="Link to this definition"></a></dt>
<dd><p>Split a string into separate lists of alpha and numeric groups.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>s</strong> (<em>str</em>) – The input string to split.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>A dictionary with keys ‘alpha’ and ‘numeric’,</dt><dd><p>each containing a list of the respective groups.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>dict[str, list[str]]</p>
</dd>
</dl>
</dd></dl>
</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>
|