Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect output from pyxtal.symmetry.Wyckoff_position.get_all_positions() #230

Closed
rees-c opened this issue Aug 31, 2023 · 4 comments
Closed

Comments

@rees-c
Copy link

rees-c commented Aug 31, 2023

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.

@qzhu2017
Copy link
Owner

@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.

@rees-c
Copy link
Author

rees-c commented Aug 31, 2023

Thanks @qzhu2017 , that seems to work. What is the recommended method for orbiting a general position?

@qzhu2017
Copy link
Owner

@rees-c For general position, any position can be the generator. So you previous code should be fine.

@rees-c
Copy link
Author

rees-c commented Sep 1, 2023

Got it, thanks very much!

@rees-c rees-c closed this as completed Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants