What problem does it solve?
This Skill calculates the X-ray Diffraction (XRD) spectrum of a material from a provided crystal structure, producing diffraction peak positions, intensities, and associated (hkl) indices without requiring a full simulation workflow.
Core Features & Use Cases
- XRD pattern computation: Computes diffraction peak information from an input structure using pymatgen.
- Simulated spectrum generation: Converts the discrete diffraction pattern into a pseudo-Voigt simulated intensity curve versus 2θ.
- Actionable outputs: Writes a JSON file containing 2θ and intensity data (plus HKL and d-spacings) and saves a plotted spectrum image.
- Use case: Use this to compare expected diffraction features of phases (e.g., LiFePO4) or to generate baseline spectra for downstream analysis or benchmarking.
Quick Start
Run this to generate the XRD JSON and plot for a structure file: conda activate base-agent, then run python .agents/skills/mat-xrd-calculator/scripts/calculate_xrd.py <structure_file> --output_dir <output_dir> --wavelength CuKa.