from pymatgen import Structure lattice = [[1, 0, 0], [0, 1, 0], [0, 0, 1]] # Lattice matrix species = ['Fe', 'Fe', 'O', 'O'] # List of atomic species coords = [[0, 0, 0], [0.5, 0.5, 0], [0.5, 0, 0.5], [0, 0.5, 0.5]] # List of atomic coordinates structure = Structure(lattice, species, coords) # Creating a Structure object
num_species = len(structure.species) # Number of unique atomic species in the structure volume = structure.volume # Volume of the unit cell density = structure.density # Density of the material
supercell = structure * [2, 2, 2] # Create a 2x2x2 supercell of the original structureThis code snippet creates a 2x2x2 supercell of the original structure using the `*` operator. In summary, python pymatgen.core.structure Structure is a Python package library used for representing and manipulating crystalline structures. It includes methods for initializing a structure object, getting information about a structure, and creating a supercell.