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

Does the order of the list 'NumIons' in random_crystal matter ? #170

Closed
Abhivega opened this issue Nov 22, 2021 · 1 comment
Closed

Does the order of the list 'NumIons' in random_crystal matter ? #170

Abhivega opened this issue Nov 22, 2021 · 1 comment

Comments

@Abhivega
Copy link

Abhivega commented Nov 22, 2021

Hello!

>> C1.from_random(3, 225, ['C','N','O'], [64,28,24])

Traceback (most recent call last):
  File "/home/abhijith/anaconda3/envs/code_RA/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3444, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-3-2b055a138640>", line 1, in <module>
    C1.from_random(3, 225, ['C','N','O'], [64,28,24])
  File "/home/abhijith/anaconda3/envs/code_RA/lib/python3.9/site-packages/pyxtal/__init__.py", line 259, in from_random
    struc = random_crystal(dim,
  File "/home/abhijith/anaconda3/envs/code_RA/lib/python3.9/site-packages/pyxtal/crystal.py", line 109, in __init__
    raise Comp_CompatibilityError(msg)
pyxtal.msg.Comp_CompatibilityError: Compoisition [64 28 24] not compatible with symmetry 225

But

>> C1.from_random(3, 225, ['N','C','O'], [28,64,24])

works.

@qzhu2017
Copy link
Owner

@Abhivega This issue should be fixed now.

If you encounter any related issue in future, you can quickly check the following

from pyxtal import pyxtal
C1=pyxtal()
C1.from_random(3, 225, ['C','N','O'], [64,28,24], 1.4)
print(C1)
------Crystal from random------
Dimension: 3
Composition: C64N28O24
Group: Fm-3m (225)
cubic lattice:  11.6859  11.6859  11.6859  90.0000  90.0000  90.0000
Wyckoff sites:
	 C @ [ 0.0000  0.2500  0.2500], WP [24d] Site [2/m.2/m2/m]
	 C @ [ 0.1133  0.1133  0.1133], WP [32f] Site [.3m]
	 C @ [ 0.2500  0.2500  0.2500], WP [8c] Site [-43m]
	 N @ [ 0.4399  0.0000  0.0000], WP [24e] Site [4m.m]
	 N @ [ 0.0000  0.0000  0.0000], WP [4a] Site [4/m-32/m]
	 O @ [ 0.9177  0.0000  0.0000], WP [24e] Site [4m.m]
>>> from pyxtal.symmetry import Group
>>> Group(227).check_compatible([4])
(False, False)
>>> Group(225).check_compatible([64, 28, 24])
(True, True)

The check_compatible function returns two boolean values, the first value tells if it is possible to make this composition. The 2nd value tells you if there is a freedom to adjust the x,y.z coordinates.

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