We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
def _from_pymatgen(self, struc, tol=1e-3, a_tol=5.0, style='pyxtal', hn=None): """ Load structure from Pymatgen should not be used directly
Args: struc: input pymatgen structure tol: symmetry tolerance a_tol: angle tolerance style: 'pyxtal' or spglib, differing in the choice of origin hn: hall_number """ from pyxtal.util import get_symmetrized_pmg #import pymatgen.analysis.structure_matcher as sm self.valid = True try: sym_struc, number = get_symmetrized_pmg(struc, tol, a_tol, style, hn) #print(sym_struc) #import sys; sys.exit() except TypeError: print("Failed to load the Pymatgen structure") # print(struc) # self.valid = False if self.valid: d = sym_struc.composition.as_dict() species = [key for key in d.keys()] numIons = [] for ele in species: numIons.append(int(d[ele])) self.numIons = numIons self.species = species if hn is None: self.group = Group(number, style=style) else: self.group = Group(hn, use_hall=True) #print(self.group[0]); import sys; sys.exit() matrix, ltype = sym_struc.lattice.matrix, self.group.lattice_type self.lattice = Lattice.from_matrix(matrix, ltype=ltype) atom_sites = [] for i, site in enumerate(sym_struc.equivalent_sites): pos = site[0].frac_coords letter = sym_struc.wyckoff_symbols[i] wp = Wyckoff_position.from_group_and_letter(number, letter, style=style, hn=hn) specie = site[0].specie.number #if wp.index>0: print(wp) pos1 = wp.search_generator(pos, self.group[0]) if pos1 is not None: atom_sites.append(atom_site(wp, pos1, specie)) else: break
the default tol for search_generator is 1e-2, if tol used to find equivalent atoms is large like 0.1, the default 1e-2 may be too small
The text was updated successfully, but these errors were encountered:
pass the tol parameter to search_generators for pyxtal._from_pymatgen…
e7d0dfa
… function #227
@XinYu73 Just fixed
Sorry, something went wrong.
thank you
No branches or pull requests
def _from_pymatgen(self, struc, tol=1e-3, a_tol=5.0, style='pyxtal', hn=None):
"""
Load structure from Pymatgen
should not be used directly
the default tol for search_generator is 1e-2, if tol used to find equivalent atoms is large like 0.1, the default 1e-2 may be too small
The text was updated successfully, but these errors were encountered: