qzhu2017 / PyXtal

A code to generate atomic structure with symmetry
MIT License
234 stars 59 forks source link

1-2 substitution #259

Closed qzhu2017 closed 1 month ago

qzhu2017 commented 1 month ago

This function allows one to derive the BC compounds from A via subgroup relation (e.g., from C to BN or from SiO2 to AlPO3)

The key is to split A's wyckoff site to B and C by w.r.t. composition relation. If the current parent crystal doesn't allow splitting, look for the subgroup

from pyxtal import pyxtal
xtal = pyxtal()
xtal.from_spg_wps_rep(227, ['8a'], [3.55])
criteria = {'CN': {'B': 4, 'N': 4}, 'cutoff': 1.8, 'exclude_ii': True}
res = xtal.substitute_1_2(dicts={'C': ['B', 'N']}, ratio=[1, 1], criteria=criteria, N_max=1)
print(res)
Add substitution *  8   1  216 F-43m          3.68 4a 4d 
Found 1 substitutions in total
[
------Crystal from subgroup------
Dimension: 3
Composition: B4N4
Group: F -4 3 m (216)
  3.5500,   3.5500,   3.5500,  90.0000,  90.0000,  90.0000, cubic
Wyckoff sites:
     B @ [ 0.0000  0.0000  0.0000], WP [4a]  CN [ 4] Site [-43m]
     N @ [ 0.7500  0.7500  0.7500], WP [4d]  CN [ 4] Site [-43m]]
zdcao121 commented 1 month ago

In what scenarios might this function be applied?

qzhu2017 commented 1 month ago

@zdcao121 https://pyxtal.readthedocs.io/en/latest/Usage.html#chemical-substitution