From 1cee2f5e4f6d832de9a401d2c1bd8a5191edb649 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Fri, 17 Nov 2023 12:31:25 -0800 Subject: [PATCH] Add alphabetical_formula property to SiteCollection class --- pymatgen/core/structure.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pymatgen/core/structure.py b/pymatgen/core/structure.py index 3efa3902025..d75965c692b 100644 --- a/pymatgen/core/structure.py +++ b/pymatgen/core/structure.py @@ -357,6 +357,11 @@ def formula(self) -> str: """Returns the formula as a string.""" return self.composition.formula + @property + def alphabetical_formula(self) -> str: + """Returns the formula as a string.""" + return self.composition.alphabetical_formula + @property def elements(self) -> list[Element | Species | DummySpecies]: """Returns the elements in the structure as a list of Element objects."""