Incorrect output from pyxtal.symmetry.Wyckoff_position.get_all_positions()
rees-c opened this issue · comments
Hi, thanks for writing this package. I am trying to use pyxtal.symmetry.Wyckoff_position.get_all_positions()
but am getting incorrect output. Below is the code snippet. I have installed pyxtal=0.5.1
.
from pyxtal.symmetry import Group as PyxtalGroup
import numpy as np
space_group_number = 225
asu_frac_coord = np.array([0.1058, 0.0773, 0.0000])
wyckoff_letter = 'j'
pyxtal_space_group = PyxtalGroup(space_group_number, style='spglib')
wyckoff_position = pyxtal_space_group[wyckoff_letter]
orbit = wyckoff_position.get_all_positions(asu_frac_coord)
print(wyckoff_position)
print(orbit)
Output:
Wyckoff position 96j in space group 225 with site symmetry m . .
0, y, z
0, -y, z
0, y, -z
0, -y, -z
z, 0, y
z, 0, -y
-z, 0, y
-z, 0, -y
y, z, 0
...
[[0. 0. 0. ]
[0. 0. 0. ]
[0. 0. 0. ]
[0. 0. 0. ]
[0. 0. 0. ]
[0. 0. 0. ]
[0. 0. 0. ]
[0. 0. 0. ]
[0. 0. 0. ]
[0. 0. 0. ]
...]
Expected output:
Wyckoff position 96j in space group 225 with site symmetry m . .
0, y, z
0, -y, z
0, y, -z
0, -y, -z
z, 0, y
z, 0, -y
-z, 0, y
-z, 0, -y
y, z, 0
...
[[0. 0.1058 0.0773 ]
[0. -0.1058 0.0773 ]
[0. 0.1058 -0.0773 ]
[0. -0.1058 -0.0773 ]
[0.0773 0. 0.1058 ]
[0.0773 0. -0.1058 ]
[-0.0773 0. 0.1058 ]
[-0.0773 0. -0.1058 ]
[0.1058 0.0773 0. ]
...]
I have not verified every space group/Wyckoff position, so I don't know what other cases might exist. Any help on fixing this would be greatly appreciated.
@rees-c Thanks for your interest in PyXtal. You may try the following code
from pyxtal.symmetry import Group
g = Group(225)
wp = g[2] # letter 'j'
generator = wp.search_generator([0.1058, 0.0773, 0.0000])
wp.get_all_positions(generator)
For the special wyckoff site, you are recommended to find the generator first and then get all positions.
Thanks @qzhu2017 , that seems to work. What is the recommended method for orbiting a general position?
@rees-c For general position, any position can be the generator. So you previous code should be fine.
Got it, thanks very much!