Source-linked AI summary
PyXtal: a Python Library for Crystal Structure Generation and Symmetry Analysis
Scott Fredericks, Kevin Parrish, Dean Sayre, Qiang Zhu
TL;DR
Crystal structure prediction and determination require many trial structures satisfying composition, symmetry, and geometric constraints, while existing generators have limited standalone and molecular special-position support. PyXtal provides Python tools for generating and modulating atomic and molecular structures across symmetry classes, and pre-symmetrized structures improve low-energy search success. Its generation can still fail for some space-group and stoichiometry combinations and assumes lattice-angle bounds for a distance-checking condition.
Problem
Crystal structure determination and prediction require trial structures under constraints, but existing generators have limited standalone, multidimensional, and molecular special-Wyckoff support.
Method
PyXtal generates and modulates atomic and molecular structures using symmetry groups, Wyckoff positions, molecular geometry, and optional user-defined parameters.
Results
Pre-symmetrized starting structures improved the success rate of finding low-energy configurations, and PyXtal can interface with structure-prediction codes requiring random symmetric trial structures.
Takeaways & Limitations
PyXtal provides a standalone, open-source Python tool for custom symmetric-structure generation, symmetry-based modulation, and structure analysis across atomic and molecular systems.
Takeaways & Limitations
Some space-group and stoichiometry combinations repeatedly fail because valid Wyckoff combinations may lack positional freedom or place atoms too closely; distance checking assumes lattice angles between 30° and 150°.
Abstract
from arXiv · showhide
We present PyXtal, a new package based on the Python programming language, used to generate structures with specific symmetry and chemical compositions for both atomic and molecular systems. This soft ware provides support for various systems described by point, rod, layer, and space group symmetries. With only the inputs of chemical composition and symmetry group information, PyXtal can automatically find a suitable combination of Wyckoff positions with a step-wise merging scheme. Further, when the molecular geometry is given, PyXtal can generate different dimensional organic crystals with molecules occupying both general and special Wyckoff positions. Optionally, PyXtal also accepts user-defined parameters (e.g., cell parameters, minimum distances and Wyckoff positions). In general, PyXtal serves three purposes: (1) to generate custom structures, (2) to modulate the structure by symmetry relations, (3) to interface the existing structure prediction codes that require the generation of random symmetric structures. In addition, we provide several utilities that facilitate the analysis of structures, including symmetry analysis, geometry optimization, and simulations of powder X-ray diffraction (XRD). Full documentation of PyXtal is available at \url{https://pyxtal.readthedocs.io}.
PROGRAM SUMMARY
PyXtal is a Python package for automatically generating trial atomic and molecular structures under composition and symmetry constraints. It supports random or user-defined Wyckoff-site selection and molecular placement in special positions.
- PyXtal automatically generates random trial structures for atomic and molecular systems across possible symmetries.The package can begin with randomly selected symmetry sites or user-predefined sites.
- For molecules, PyXtal detects molecular symmetry and places molecules into special Wyckoff positions.
1. Introduction
Crystal structure determination often requires generating and optimizing trial structures from partial experimental information or computational searches. PyXtal addresses gaps in standalone, multidimensional, and molecular symmetric-structure generation.
- Trial structures are needed to resolve crystal structures from partial experimental information or computational sampling.Candidate structures can be optimized and compared with observed diffraction or other characterization data.
- Symmetry constraints are widely used in inorganic structure-prediction codes because symmetric starting structures may reduce attempts to find global energy minima.
- Wyckoff-site generation uses either predefined sites or placement on general sites followed by merging into special sites.The merging process is repeated until the desired stoichiometry is achieved.
- Organic crystal generation commonly restricts space groups and often assumes one molecule in the asymmetric unit, although special Wyckoff positions are also relevant.
- PyXtal was developed as a standalone Python program for customized atomic and molecular structure generation across clusters and 1D, 2D, and 3D crystals.
2. Algorithms
PyXtal’s core algorithms generate random symmetric crystals and modulate structures according to symmetry relations.
- PyXtal combines random symmetric-crystal generation with structure modulation based on symmetry relations.
2.1. Structure Generation
PyXtal generates symmetry-constrained structures from user-defined dimensionality, symmetry, stoichiometry, and cell information. It checks Wyckoff compatibility, constructs lattices and positions, merges overly close positions, and limits generation attempts when constraints cannot be satisfied.
- Generation workflow: PyXtal begins with user inputs for dimensionality, symmetry group, stoichiometry, and unit-cell volume, then verifies their compatibility before generation.Optional constraints include unit-cell parameters and interatomic-distance tolerances.
- Compatibility checking: Wyckoff compatibility is tested by enumerating position combinations whose multiplicities match the requested stoichiometry; invalid combinations trigger a warning.For example, four atoms cannot be constructed in Pn-3n when the available positions cannot sum to four without overlap.
- Lattice generation: Unit cells are generated according to symmetry constraints, with user-defined lattice data accepted and random parameters estimated when cell information is absent.PyXtal supports conventional cells and adapts generation for triclinic, tetragonal, low-dimensional, and cluster systems.
- Position selection and merging: PyXtal selects Wyckoff positions by descending multiplicity, projects random generating points onto them, and checks whether the resulting coordinates satisfy distance limits.Larger positions are preferred initially, while distance violations cause coordinates to be merged into smaller compatible positions.
- Position selection and merging: When atoms remain too close, PyXtal chooses the smallest-translation valid subposition and discards the position if all possible mergings fail.The merging position must be a subset of the original and must itself avoid excessive proximity.
- Distance checking: Highly distorted lattices can invalidate shortest-distance assumptions, so PyXtal restricts randomly generated angles to between 30 and 150 degrees.The restriction avoids cases where the shortest Euclidean and fractional distances do not correspond.
2.2. Structure Modulation
PyXtal modulates existing structures by perturbing symmetry-reduced degrees of freedom while preserving selected crystal relations. It also supports group-subgroup transitions to derive lower-symmetry structures from parent structures.
- Structure modulation: The modulation approach derives more complex structures from highly symmetrical parents through small distortions or chemical substitutions.Such relations are relevant to phase transitions, structural prototypes, and structure-prediction workflows.
- Structure modulation: PyXtal preserves crystal symmetry by perturbing only asymmetric-unit atoms, reorienting molecules along allowed axes, and optionally changing flexible dihedrals or cell parameters.Atomic structures perturb free Wyckoff coordinates, while molecular structures additionally permit orientation and rotor changes.
- Group-subgroup transition: PyXtal uses group-subgroup relations to connect parent and derived crystal symmetries, including transitions such as Fd-3m to I41/amd.Available subgroup relations include maximal translationengleiche and klassengleiche subgroups.
3. Dependencies
PyXtal is implemented in Python 3 and combines general scientific-computing packages with crystallographic libraries. Optional interfaces extend molecule import and structure analysis capabilities.
- Core dependencies: PyXtal uses NumPy, SciPy, and Pandas for general scientific computing and data processing, with Pymatgen and Spglib supporting symmetry analysis.The package is written in Python 3.
- Optional interfaces: Optional Openbabel and ASE interfaces support additional molecular file formats, structure manipulation, and geometry optimization.Openbabel extends molecule import beyond plain XYZ files, while ASE supports further structure analysis.
4. Example Usages
PyXtal provides command-line examples for symmetry inspection, symmetric structure generation, structure modulation, XRD comparison, and random cluster generation. Generated structures can be optimized, analyzed, converted for other libraries, or exported to standard formats.
- Basic utilities: PyXtal utilities inspect symmetry groups and generate trial atomic, molecular, and cluster structures from specified compositions and symmetries.Examples include C60 with Ih symmetry, diamond with Fd-3m symmetry, and a C60 molecular crystal with Cmc21 symmetry.
- Structure modulation and analysis: The XRD workflow generates a cubic crystal, perturbs or lowers its symmetry through a group-subgroup relation, and compares the resulting diffraction profiles.The comparison uses a correlation-based similarity measure and illustrates peak splitting after symmetry lowering.
- Post-processing: Generated structures support geometry optimization and powder XRD simulation, and can be adapted for ASE or Pymatgen or exported as CIF, XYZ, or POSCAR files.Crystal structures are saved in CIF format and clusters in XYZ format by the command-line workflow.
5. Applications
Applications show that pre-symmetrized random structures improve access to low-energy configurations in Lennard-Jones clusters and broaden energy-space coverage in crystal searches. PyXtal is demonstrated with both empirical cluster optimization and ab-initio carbon and silicon calculations.
- 5.1. Clusters with empirical Lennard-Jones potential: With pre-symmetrization, the Lennard-Jones ground state was found 278 times for size 38, 73 times for size 55, and once for size 75, versus zero unsymmetrized hits.The study generated 10,000 symmetric and 10,000 unsymmetrized structures for each cluster size and locally optimized them with conjugate gradients.
- 5.1. Clusters with empirical Lennard-Jones potential: Pre-symmetrized clusters found ground states more often but had higher average energy, whereas purely random structures clustered around a narrower energy range.The authors attribute the difference to more effective coverage of structure space by pre-symmetrization.
- 5.2. Carbon and silicon crystals with ab-initio calculations: For carbon and silicon, PyXtal generated and optimized 5,000 random structures per element across primitive cells containing 2, 4, 6, 8, or 16 atoms.Each structure used a randomly selected space group and was optimized with VASP using PBE-GGA in multiple precision stages.
- 5.2. Carbon and silicon crystals with ab-initio calculations: Beyond approximately four atoms per primitive cell, primitive-cell size had little influence on the energy distribution, while size-2 cells showed a narrower landscape.The authors interpret this as evidence that pre-symmetrization reduces clustering of glassy structures in large-system random generation.
6. Conclusion
The conclusion presents PyXtal as an open-source Python package for generating and analyzing symmetric structures from zero to three dimensions. It emphasizes generalized molecular Wyckoff-position handling, symmetry-based structure modulation, and improved low-energy-search seeding.
- 6. Conclusion: PyXtal refines symmetry-constrained generation through Wyckoff-position merging, molecular placement on special positions, and symmetry-relation-based structure modulation.These mechanisms aim to retain high symmetry while generating more realistic and complex structures.
- 6. Conclusion: PyXtal handles symmetric structures from 0D to 3D, generalized molecular Wyckoff positions, and symmetry-relation analysis as a free, open-source Python package.The package is intended to interface with other structure-prediction codes that require trial structures.
- 6. Conclusion: Pre-symmetrized starting structures can improve the success rate of finding low-energy configurations and serve as seeds for other structure-prediction codes.The authors distinguish PyXtal from complete structure-prediction packages because it generates trial structures with a given symmetry group.