# X-ray Diffraction (XRD)

> Powder X-ray diffraction overview, common datasets, and SimXRD OL crystal-system classification results.

---

LLMS index: [llms.txt](/Sage-SciPerception/llms.txt)

---

## Overview

Powder X-ray diffraction (XRD) records scattered intensity versus Bragg angle 2θ, acting as an experimental fingerprint of crystal symmetry, lattice spacing, and phase identity.

Distinguishing the seven crystal systems depends on subtle peak splitting, relative peak positions, and systematic absences across thousands of 2θ bins. Sage-SciPerception encodes a normalized, square-root-scaled 3,501-point diffraction pattern (10–80° at 0.02° resolution) into 110 convolutional states of width 512, then projects those states into the language model for symmetry classification.

## Common datasets

| Dataset | Scope and characteristics | Usage in Sage-SciPerception |
| --- | --- | --- |
| **SimXRD-4M (`OLtrain` / `OLval` / `OLtest`)** | Large-scale simulated powder XRD benchmark with space-group and crystal-system labels | `simxrd-ol` (strictly split by ASE ID and reduced formula) |
| **RRUFF / COD (Crystallography Open Database)** | Experimental mineral and inorganic diffraction libraries | Compatible via Cu Kα (1.5406 Å) 10–80° resampling |

## Sage-SciPerception capabilities & results

| Dimension | Details |
| --- | --- |
| Supported task | **Seven-crystal-system classification** (triclinic, monoclinic, orthorhombic, tetragonal, trigonal, hexagonal, cubic) |
| Benchmark result | **SimXRD OL Accuracy = 63.60%** (`glm-5.3-flash/xrd/simxrd` v0.1.0 checkpoint) |
| Input channels | `[110, 512]` convolutional states from normalized 3,501-point diffraction spectra |

- Checkpoint specification: [SimXRD OL task reference](/docs/tasks/xrd-simxrd/)
- Inference example: [`examples/vllm_projector.py`](https://github.com/InternLM/Sage-SciPerception/blob/main/examples/vllm_projector.py)
- Public training slice: [`samples/xrd/simxrd/`](https://huggingface.co/datasets/internlm/Sage-SciPerception-Training/tree/main/samples/xrd/simxrd)
