Skip to content

Commit b9fd715

Browse files
committed
fix the bug for trigonal cells
1 parent f91f5e8 commit b9fd715

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pyxtal/representation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def to_pyxtal(self):
5858
struc.group, _number = Group(v[0], use_hall=True), v[0]
5959

6060
# lattice
61-
ltype = struc.group.lattice_type
61+
ltype = struc.group.lattice_type #; print(ltype)
6262
if ltype == "triclinic":
6363
a, b, c, alpha, beta, gamma = v[1], v[2], v[3], v[4], v[5], v[6]
6464
elif ltype == "monoclinic":
@@ -67,7 +67,7 @@ def to_pyxtal(self):
6767
a, b, c, alpha, beta, gamma = v[1], v[2], v[3], 90, 90, 90
6868
elif ltype == "tetragonal":
6969
a, b, c, alpha, beta, gamma = v[1], v[1], v[2], 90, 90, 90
70-
elif ltype == "hexagonal":
70+
elif ltype in ["trigonal", "hexagonal"]:
7171
a, b, c, alpha, beta, gamma = v[1], v[1], v[2], 90, 90, 120
7272
else:
7373
a, b, c, alpha, beta, gamma = v[1], v[1], v[1], 90, 90, 90
@@ -310,7 +310,7 @@ def to_pyxtal(self, smiles=None, composition=None, molecules=None):
310310
a, b, c, alpha, beta, gamma = v[1], v[2], v[3], 90, 90, 90
311311
elif ltype == "tetragonal":
312312
a, b, c, alpha, beta, gamma = v[1], v[1], v[2], 90, 90, 90
313-
elif ltype == "hexagonal":
313+
elif ltype in ["trigonal", "hexagonal"]:
314314
a, b, c, alpha, beta, gamma = v[1], v[1], v[2], 90, 90, 120
315315
else:
316316
a, b, c, alpha, beta, gamma = v[1], v[1], v[1], 90, 90, 90

0 commit comments

Comments
 (0)