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

pyxtal().from_random fails to generate a crystal from Materials Project #235

Closed
kazeevn opened this issue Oct 24, 2023 · 2 comments
Closed

Comments

@kazeevn
Copy link

kazeevn commented Oct 24, 2023

Hello! I'm trying to generate a crystal according to the following Materials Project entry: Nd(Al2Cu)4, space group I4/mmm [139]. However, PyXtal declares the space group and composition incomparable:

my_crystal = pyxtal()
my_crystal.from_random(dim=3, group="I4/mmm", species=['Nd', 'Al', 'Cu'], numIons=[1, 8, 4])
...
Comp_CompatibilityError: Compoisition [1 8 4] not compatible with symmetry 139

I've also tried to pass the sites:

sites = [
        {'1a': [0., 0., 0.]},
        {'4j': [0.721222, 0.778778, 0.778778],
        '4i': [0.34894, 0.65106, 0.65106]},
        {'4f': [0.5, 0.5, 0. ]}
]
my_crystal.from_random(dim=3, group="I4/mmm", species=['Nd', 'Al', 'Cu'], numIons=[1, 8, 4], sites=sites)

It didn't help with a similar message. Is there some nuance in PyXtal's definition of symmetries I'm not aware of? Any advice would be much appreciated!

PyXtal version is 0.6.1

@kazeevn kazeevn changed the title my_crystal.from_random fails to generate a crystal from Materials Project pyxtal().from_random fails to generate a crystal from Materials Project Oct 24, 2023
@kazeevn
Copy link
Author

kazeevn commented Oct 24, 2023

Here is an experiment. I doubled the number of atoms, and PyXtal successfully generated the structure Nd2Cu16Al8. Then I used pymatgen to get the primitive cell, and it returned Nd1Cu8Al4:

my_crystal = pyxtal()
my_crystal.from_random(dim=3, group="I4/mmm", species=['Nd', 'Al', 'Cu'], numIons=[2, 16, 8])
my_crystal_pymatgen = my_crystal.to_pymatgen()
analyzer = SpacegroupAnalyzer(my_crystal_pymatgen)
analyzer.get_symmetrized_structure()
SymmetrizedStructure
Full Formula (Nd2 Al16 Cu8)
Reduced Formula: Nd(Al2Cu)4
Spacegroup: I4/mmm (139)
abc   :   6.471440   6.471440  11.870218
angles:  90.000000  90.000000  90.000000
Sites (26)
  #  SP           a         b          c  Wyckoff
---  ----  --------  --------  ---------  ---------
  0  Al    0         0.5       -0         4c
  1  Al    0         0          0.149988  4e
  2  Al    0.25      0.25       0.25      8f
  3  Cu    0.668589  0.668589  -0         8h
  4  Nd    0         0          0         2a

Naively this suggests that there is no substantial disagreement between the libraries (good!), just some convention difference.

@qzhu2017
Copy link
Owner

Thanks. It is difference between Primitive unit cell and I/A/B/C/F centered cell.

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