diff --git a/pymatgen/symmetry/analyzer.py b/pymatgen/symmetry/analyzer.py index 146afb6b416..5c64f3f41e0 100644 --- a/pymatgen/symmetry/analyzer.py +++ b/pymatgen/symmetry/analyzer.py @@ -662,6 +662,7 @@ def get_conventional_standard_structure(self, international_monoclinic=True): elif latt_type == "triclinic": # we use a LLL Minkowski-like reduction for the triclinic cells struct = struct.get_reduced_structure("LLL") + latt = struct.lattice a, b, c = latt.lengths alpha, beta, gamma = [math.pi * i / 180 for i in latt.angles] diff --git a/pymatgen/symmetry/tests/test_analyzer.py b/pymatgen/symmetry/tests/test_analyzer.py index ed821964208..f76c0cd34cf 100644 --- a/pymatgen/symmetry/tests/test_analyzer.py +++ b/pymatgen/symmetry/tests/test_analyzer.py @@ -265,6 +265,16 @@ def test_get_conventional_standard_structure(self): self.assertAlmostEqual(conv.lattice.b, 3.699919902005897) self.assertAlmostEqual(conv.lattice.c, 6.9779585500000003) + structure = Structure.from_file(os.path.join(PymatgenTest.TEST_FILES_DIR, "tric_684654.json")) + s = SpacegroupAnalyzer(structure, symprec=1e-2) + conv = s.get_conventional_standard_structure() + self.assertAlmostEqual(conv.lattice.alpha, 74.09581916308757) + self.assertAlmostEqual(conv.lattice.beta, 75.72817279281173) + self.assertAlmostEqual(conv.lattice.gamma, 63.63234318667333) + self.assertAlmostEqual(conv.lattice.a, 3.741372924048738) + self.assertAlmostEqual(conv.lattice.b, 3.9883228679270686) + self.assertAlmostEqual(conv.lattice.c, 7.288495840048958) + def test_get_primitive_standard_structure(self): parser = CifParser(os.path.join(PymatgenTest.TEST_FILES_DIR, "bcc_1927.cif")) structure = parser.get_structures(False)[0] diff --git a/test_files/tric_684654.json b/test_files/tric_684654.json new file mode 100644 index 00000000000..94d7b0bb729 --- /dev/null +++ b/test_files/tric_684654.json @@ -0,0 +1 @@ +{"@module": "pymatgen.core.structure", "@class": "Structure", "charge": null, "lattice": {"matrix": [[3.576398, -0.11991, 1.960909], [1.136592, 3.033825, 1.871346], [-0.195795, -0.335361, 8.19359]], "a": 4.080461391654747, "b": 3.7413729240487377, "c": 8.202787317152994, "alpha": 62.66372061243767, "beta": 62.59337208026763, "gamma": 61.13165529519131, "volume": 92.7242594235707}, "sites": [{"species": [{"element": "Bi", "occu": 1}], "abc": [0.946029, 0.02822, 0.013308], "xyz": [3.412845209922, -0.032286780078, 2.0169264602009997], "label": "Bi", "properties": {"magmom": 0.0}}, {"species": [{"element": "Bi", "occu": 1}], "abc": [0.079023, 0.994276, 0.492394], "xyz": [1.316295563316, 2.841853993536, 6.050065881863], "label": "Bi", "properties": {"magmom": 0.0}}, {"species": [{"element": "O", "occu": 1}], "abc": [0.305839, 0.221561, 0.157295], "xyz": [1.3148288735090004, 0.5827535378400001, 2.303150477807], "label": "O", "properties": {"magmom": -0.0}}, {"species": [{"element": "O", "occu": 1}], "abc": [0.740353, 0.688628, 0.471626], "xyz": [3.3381440516000005, 1.8422361468840003, 6.604736191505], "label": "O", "properties": {"magmom": -0.0}}, {"species": [{"element": "O", "occu": 1}], "abc": [0.876757, 0.751315, 0.839377], "xyz": [3.825224780051, 1.8927319879080002, 10.002722005533], "label": "O", "properties": {"magmom": -0.0}}]} \ No newline at end of file