qzhu2017 / PyXtal

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

A separate utility to compute structure factor #234

Closed qzhu2017 closed 7 months ago

qzhu2017 commented 8 months ago

Operate on the ASE.atoms level, But can also be accessed from pyxtal.

qzhu2017 commented 7 months ago
from pyxtal import pyxtal
from ase.build import bulk
a1 = bulk('Cu', 'fcc', a=3.6, cubic=True)
x = pyxtal()
x.from_seed(a1)
for hkl in [(1,0,0), (0,1,0), (1, 1, 0), (2, 2, 0), (1, 1, 1), (2, 2, 2), (2, 0, 0)]:
    print(hkl, x.get_structure_factor(hkl))
(1, 0, 0) -2.4492935982947064e-16j
(0, 1, 0) -2.4492935982947064e-16j
(1, 1, 0) 0j
(2, 2, 0) (4+9.797174393178826e-16j)
(1, 1, 1) (4+7.347880794884119e-16j)
(2, 2, 2) (4+1.4695761589768238e-15j)
(2, 0, 0) (4+4.898587196589413e-16j)