pyxtal.crystal module

Module for generating atomic crystals

class pyxtal.crystal.random_crystal(dim=3, group=227, species=['C'], numIons=8, factor=1.1, thickness=None, area=None, lattice=None, sites=None, conventional=True, tm=<pyxtal.tolerance.Tol_matrix object>, use_hall=False)[source]

Bases: object

Class for storing and generating atomic crystals based on symmetry constraints. Given a spacegroup, list of atomic symbols, the stoichiometry, and a volume factor, generates a random crystal consistent with the spacegroup’s symmetry.

  • dim – dimenion (0, 1, 2, 3)

  • group – the group number (1-56, 1-75, 1-80, 1-230)

  • species – a list of atomic symbols for each ion type, e.g., [“Ti”, “O”]

  • numIons – a list of the number of each type of atom within the primitive cell (NOT the conventional cell), e.g., [4, 2]

  • factor (optional) – volume factor used to generate the crystal

  • sites (optional) – pre-assigned wyckoff sites (e.g., [[“4a”], [“2b”]])

  • lattice (optional) – Lattice object to define the unit cell

  • tm (optional) – Tol_matrix object to define the distances

check_wp(wyckoff_sites_tmp, wyks, cell, new_site)[source]

The main code to generate a random atomic crystal. If successful, self.valid is True


set up the radii for each specie


Generate the initial lattice


initialize Wyckoff sites Update 2023/09, track the wp index instead of letters to avoid many inquiries :param sites: list


Estimates the volume of a unit cell based on the number/types of ions. Assumes each atom takes up a sphere with radius equal to its covalent bond radius. 0.50 A -> 0.52 A^3 0.62 A -> 1.00 A^3 0.75 A -> 1.76 A^3


a float value for the estimated volume