I'm using pymatgen and have a host of structure objects (generated from cif files). How can I judge if the structure is isotropic or not?

I took a look at the options associated with structure objects and couldn't find method or parameter that might encode that.

  • 1
    $\begingroup$ You could inspect the spacegroups with pymatgen (pymatgen.org/pymatgen.symmetry.html) and consider how the property you want isotropic is related to the symmetries of the crystal $\endgroup$
    – CW Tan
    Commented Dec 19, 2023 at 20:27

1 Answer 1


As mentioned in the first comment, you need to check the symmetries and spacegroups. You can refer to the following sample code:

from pymatgen.core import Structure
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from pymatgen.io.cif import CifParser

# Specify the path to your CIF file
cif_file = "path/to/your/file.cif"

# Create a CifParser object
parser = CifParser(cif_file)

# Parse the structures with the new method and set primitive=True explicitly
structures = parser.parse_structures(primitive=True)

# Access the first structure
structure = structures[0]

# Create a SpacegroupAnalyzer object for the crystal structure
analyzer = SpacegroupAnalyzer(structure)

# Get the spacegroup number and symbol
spacegroup_number = analyzer.get_space_group_number()
spacegroup_symbol = analyzer.get_space_group_symbol()

# Print the spacegroup information
print("Spacegroup Number:", spacegroup_number)
print("Spacegroup Symbol:", spacegroup_symbol)

# Check if the property of interest is isotropic based on crystal symmetries
is_isotropic = analyzer.is_laue()  # Returns True if the crystal is isotropic

# Print the result
if is_isotropic:
    print("The property of interest is isotropic.")
    print("The property of interest is anisotropic.")

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .