|
3 | 3 | What each script does, summarized per example. All required CIF inputs are bundled in this directory. |
4 | 4 |
|
5 | 5 | ## Example 1: Basic enumeration and CIF output |
6 | | -- File: [examples/example1.py](examples/example1.py) |
| 6 | +- File: [example1.py](example1.py) |
7 | 7 | - What it does: Load `SmFe7Ti.cif`, use `Substitutor` to generate all symmetry-inequivalent structures, and write CIFs with their multiplicity (weight). |
8 | 8 | - Key point: Uses `Substitutor.quantities(("cifwriter", "weight"))` and saves to `output/` as `cif_i{index}w{weight}.cif`. |
9 | 9 |
|
10 | 10 | ## Example 2: Comparison with enumlib |
11 | | -- File: [examples/example2.py](examples/example2.py) |
| 11 | +- File: [example2.py](example2.py) |
12 | 12 | - What it does: Expand `PbSnTe.cif` to a 2×2×2 supercell and compare enumeration results between Pymatgen's `EnumlibAdaptor` and SHRY. |
13 | 13 | - Comparison modes: |
14 | 14 | - SHRY default (group equivalent sites). |
15 | 15 | - SHRY with `groupby=lambda x: x.species` (group by species, similar to enumlib behavior). |
16 | 16 | - Output: Prints the number of structures from each approach to stdout. |
17 | 17 |
|
18 | 18 | ## Example 3: LabeledStructure and label-based substitutions |
19 | | -- File: [examples/example3.py](examples/example3.py) |
| 19 | +- File: [example3.py](example3.py) |
20 | 20 | - What it does: Load `SmFe12.cif` as a `LabeledStructure`, replace labels `Fe1`→`Fe3Ti`, `Fe2`→`Fe7Ti`, `Fe3`→`Ti`, then expand to a non-diagonal supercell `((2,0,1),(0,1,0),(1,0,1))`. Generates all structures, writes CIFs and weights to `output/`, and prints configuration letters (e.g., `aba...`). |
21 | 21 | - Key point: Keeps `_atom_site_label`, so substitutions remain label-consistent even after supercell expansion. |
22 | 22 |
|
23 | 23 | ## Example 4a: Caching pattern generation and saving it |
24 | | -- File: [examples/example4a.py](examples/example4a.py) |
| 24 | +- File: [example4a.py](example4a.py) |
25 | 25 | - What it does: Load `SmFe12.cif` as a `LabeledStructure`, replace `Fe1`→`Fe7Ti`, run `Substitutor(cache=True)`, write CIFs, and pickle the internal `pattern_makers` to `pg.pkl`. |
26 | 26 | - Benefit: Reuse the cached pattern makers to skip expensive recomputation for symmetry-equivalent systems later. |
27 | 27 |
|
28 | 28 | ## Example 4b: Reusing cache and applying to different compositions |
29 | | -- File: [examples/example4b.py](examples/example4b.py) |
| 29 | +- File: [example4b.py](example4b.py) |
30 | 30 | - What it does: Load `pg.pkl` from Example 4a. Starting from `SmFe12.cif`, evaluate two substitution cases (`Fe`→`Fe3Ti` and `Fe`→`FeTi3`) in sequence. Attach the loaded `pattern_makers` to a `Substitutor`, generate CIFs for `run1` and `run2`, then overwrite `pg.pkl` with the updated cache. |
31 | 31 | - Key point: When symmetry is the same, you can rapidly iterate different substitution patterns using the cached pattern makers. |
32 | 32 |
|
33 | 33 | ## Example 5: Generating ASE Atoms |
34 | | -- File: [examples/example5.py](examples/example5.py) |
| 34 | +- File: [example5.py](example5.py) |
35 | 35 | - What it does: Expand `PbSnTe.cif` to 2×2×2, enumerate all structures with `Substitutor`, and obtain them as ASE `Atoms` objects. |
36 | 36 | - Output: Prints the number of structures to stdout and shows one sample `Atoms` instance; useful as a bridge to downstream ASE workflows. |
37 | 37 |
|
38 | 38 | ## Example 6: Ranking by Ewald energy |
39 | | -- File: [examples/example6.py](examples/example6.py) |
| 39 | +- File: [example6.py](example6.py) |
40 | 40 | - What it does: Enumerates substitutions, guesses oxidation states, computes Ewald energies, and writes the 100 lowest-energy structures to output_ewald/. |
41 | 41 | - Note: If oxidation states cannot be guessed, Ewald energies may be zero or skipped. |
42 | 42 |
|
43 | 43 | ## Example 7: Highest symmetry structures (lowest weight) |
44 | | -- File: [examples/example7.py](examples/example7.py) |
| 44 | +- File: [example7.py](example7.py) |
45 | 45 | - What it does: Enumerates substitutions and writes the top-N structures with the smallest weight (highest symmetry) to output_symm_top/. Optionally writes all structures sorted by weight. |
46 | 46 |
|
47 | 47 | ## Example 8: Merge multiple Wyckoff labels for shared concentration |
48 | | -- File: [examples/example8.py](examples/example8.py) |
| 48 | +- File: [example8.py](example8.py) |
49 | 49 | - What it does: Loads `SmFe12.cif`, relabels multiple Wyckoff labels (e.g., `Fe1` and `Fe2`) into a shared label (`Target`), then applies a single disordered composition (e.g., `Fe0.5Ti0.5`) across that pooled site set. This enables specifying a global substitution concentration across multiple Wyckoff positions. |
0 commit comments