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

Reorganize the supergroup function #181

Closed
qzhu2017 opened this issue Dec 21, 2021 · 2 comments
Closed

Reorganize the supergroup function #181

qzhu2017 opened this issue Dec 21, 2021 · 2 comments

Comments

@qzhu2017
Copy link
Owner

qzhu2017 commented Dec 21, 2021

The current functions is a bit messy. Needs a better organization so that one can easily do
1, search for pseudo symmetry
2, find the mapping between two symmetry-related structures.

@qzhu2017 qzhu2017 changed the title get_alternative_wyc_setting based on WP scheme Reorganize the supergroup function Dec 24, 2021
@qzhu2017
Copy link
Owner Author

qzhu2017 commented Dec 24, 2021

  • create the search_supergroup_paths function from Group object
  • create the search_subgroup_paths function from Group object
  • create the get_valid_solutions from Group object
  • move check_compatibility to some generic place

@qzhu2017
Copy link
Owner Author

qzhu2017 commented Jan 3, 2022

from pyxtal import pyxtal
import pymatgen.analysis.structure_matcher as sm

paras = [
         ('0-G62', '2-G71'),
         ('0-G62', '3-G139'),
         ('0-G62', '4-G225'),
        ]

for para in paras:
    (cif1, cif2) = para
    s1 = pyxtal()
    s2 = pyxtal()
    s1.from_seed('pyxtal/database/cifs/'+cif1+'.cif')
    s2.from_seed('pyxtal/database/cifs/'+cif2+'.cif')
    pmg_s2 = s2.to_pymatgen()

    strucs, _, _ = s2.get_transition(s1)
    
    if strucs is not None:
       # high symmetry structure in subgroup representation
        struc_G_in_H = strucs[-1]
        s3 = pyxtal()
        s3.from_seed(struc_G_in_H.to_pymatgen(), tol=1e-3)
        
        # Match in space group number 
        print("Space group", s3.group.number == s2.group.number)
    
        # Match in structure
        pmg_s3 = s3.to_pymatgen()
        print("Structure", sm.StructureMatcher().get_rms_dist(pmg_s2, pmg_s3))

    else:
        print("Problem in ", cif1, cif2)

@qzhu2017 qzhu2017 closed this as completed Jan 3, 2022
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

1 participant