Skip to content

Commit

Permalink
add the support for Si-based molecular crystals
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhu2017 committed Dec 18, 2023
1 parent 675ab83 commit a99cd5d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pyxtal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2847,7 +2847,7 @@ def from_CSD(self, csd_code):
for ele in pmg.composition.elements:
if ele.symbol == 'D':
pmg.replace_species({ele: Element("H")})
elif ele.value not in ["C", "H", "O", "N", "S", "F", "Cl", "Br", "I", "P"]:
elif ele.value not in ["C", "Si", "H", "O", "N", "S", "F", "Cl", "Br", "I", "P"]:
organic = False
break

Expand All @@ -2856,6 +2856,7 @@ def from_CSD(self, csd_code):
msg += entry.formula
raise CSDError(msg)
else:
#print(smiles); self.from_seed(pmg, smiles)
try:
#print(smiles)#; import sys; sys.exit()
self.from_seed(pmg, smiles)
Expand Down
4 changes: 2 additions & 2 deletions pyxtal/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ def resort(self, molecules):
if id not in ids_done:
msg = "This molecule cannot be matched to the reference\n"
msg += 'Molecules extracted from the structure\n'
msg += molecules[id].to('xyz') + '\n'
msg += molecules[id].to(fmt='xyz') + '\n'
msg += "Reference molecule from smiles or xyz\n"
msg += mol2.mol.to('xyz')
msg += mol2.mol.to(fmt='xyz')
raise ReadSeedError(msg)

def add_Hydrogens(self, smile, xyz):
Expand Down
4 changes: 3 additions & 1 deletion pyxtal/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def __init__(self,
mo = None
self.smile = None
self.torsionlist = None
self.reflect = False
if seed is None: seed = 0xf00d
self.seed = seed

Expand Down Expand Up @@ -244,7 +245,8 @@ def __init__(self,
self.tols_matrix = self.get_tols_matrix()
xyz = self.mol.cart_coords
self.reset_positions(xyz-self.get_center(xyz))

if self.smile is not None: ori, _, self.reflect = self.get_orientation(xyz)

def __str__(self):
return '[' + self.name + ']'

Expand Down

0 comments on commit a99cd5d

Please sign in to comment.