qzhu2017 / PyXtal

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

Feature request - Group initialization by Hall number #192

Closed rees-c closed 2 years ago

rees-c commented 2 years ago

Hi,

Thanks for this excellent library! Following up on my email with Dr. Zhu - for consistency with conventional cells from various materials databases, it would be very useful if the Group class could be initialized by Hall number instead of just Hermann-Mauguin spacegroup number.

Ex: When querying the Materials Project for silicon (mp-149), pymatgen/spglib's choice of conventional unit cell corresponds to the Hall number 525 while PyXtal uses 526.

qzhu2017 commented 2 years ago

@rees-c This is something on my todo list during the summer. However, I am not sure if you really need it. If you get the same structure with different setting, would it matter?

qzhu2017 commented 2 years ago

@rees-c Check my most recent update commit ed9169eed080bd245d02cf2d6773c2ce92f0ad0b

>>> from pyxtal import Group
>>> g = Group(526, use_hall=True)
>>> g[-1]
Wyckoff position 8a in space group 227 with site symmetry -4 33 mm
1/8, 1/8, 1/8
7/8, 3/8, 3/8
1/8, 5/8, 5/8
7/8, 7/8, 7/8
5/8, 1/8, 5/8
3/8, 3/8, 7/8
5/8, 5/8, 1/8
3/8, 7/8, 3/8
>>> g = Group(525, use_hall=True)
>>> g[-1]
Wyckoff position 8a in space group 227 with site symmetry -4 33 mm
1/4, 1/4, 1/4
0, 1/2, 1/2
1/4, 3/4, 3/4
0, 0, 0
3/4, 1/4, 3/4
1/2, 1/2, 0
3/4, 3/4, 1/4
1/2, 0, 1/2
>>> g = Group(227, style='spglib')
>>> g[-1]
Wyckoff position 8a in space group 227 with site symmetry -4 33 mm
1/4, 1/4, 1/4
0, 1/2, 1/2
1/4, 3/4, 3/4
0, 0, 0
3/4, 1/4, 3/4
1/2, 1/2, 0
3/4, 3/4, 1/4
1/2, 0, 1/2

Is this what you want?

qzhu2017 commented 2 years ago

Documentation is available at

https://pyxtal.readthedocs.io/en/latest/Usage.html#symmetry-groups-and-wyckoff-positions

rees-c commented 2 years ago

Hi @qzhu2017 , Sorry for the late reply - this is perfect! You're right that I could get the same structures with different settings. However, for my purposes, I need to be able to compare atom coordinates from one structure to the next, so having both structures in the same setting is very helpful. Thank you for the excellent work! I will definitely be using it.