---
title: OpXRD
description: Search and analyze X-ray powder diffraction patterns from the opXRD database.
tags:
  - opxrd
---

OpXRD lets you match an experimental X-ray powder diffraction pattern against a reference database to identify the crystalline phases in a sample. Reach for it when you have measured XRD data and need to name the solid forms present, or find reference patterns for a given element combination. Where PyWPEM simulates and refines patterns from a crystal structure, OpXRD searches known patterns — the two are complementary sides of phase identification. See the [Materials & Crystals overview](/docs/materials-crystals) for where this fits.

## OpXRD overview

OpXRD integrates the opXRD database of over 10,000 X-ray powder diffraction (XRPD) patterns into the .bloom* platform. Patterns are indexed with CrystalNN crystal fingerprints, enabling fast similarity searches for phase identification and materials characterization.

### What is X-ray powder diffraction?

X-ray powder diffraction measures how X-rays scatter off a polycrystalline sample. The resulting pattern of peaks at specific angles (2-theta) is a fingerprint of the crystal structure. By comparing measured patterns against a reference database, you can identify the crystalline phases present in a sample.

## How OpXRD works

 API["OpXRD API (Modal serverless)<br/>search, similarity, fingerprint,<br/>retrieval, and stats operations"]
    API --> Res[Results: patterns, metadata, fingerprints]`}
  caption="A query is dispatched to the serverless OpXRD API, which routes it to the matching operation and returns patterns, metadata, or fingerprints. Full operation list below."
/>

The database is hosted on a Modal persistent volume, pre-loaded from the opXRD Zenodo repository. This avoids Zenodo rate limits and provides consistent sub-second query performance.

### Database contents

| Statistic | Value |
|-----------|-------|
| Total patterns | &gt; 10,000 |
| Contributing institutions | 50+ |
| Space groups covered | 230 (all) |
| Element coverage | Most periodic table elements |
| Pattern format | 2-theta / intensity pairs |
| Fingerprint type | CrystalNN crystal fingerprint |

## Supported operations

### search_patterns

Filter the database by element composition, space group, chemical formula, or institution. Returns matching patterns with metadata.

### similarity_search

Compare a query XRD pattern against the database using CrystalNN crystal fingerprints. Returns the most similar patterns ranked by cosine similarity. Configurable threshold filters out low-similarity matches.

### compute_fingerprint

Generate a CrystalNN crystal fingerprint from a crystal structure (CIF content or a structure dict) — not from a raw diffraction pattern. Use the resulting fingerprint for downstream similarity comparisons or clustering.

### get_pattern

Retrieve a specific pattern by its database ID, including full 2-theta/intensity data and all associated metadata.

### list_institutions

Browse contributing institutions and their pattern counts. Useful for filtering searches to trusted sources.

### compute_statistics

Aggregate statistics: total patterns, element distributions, space group coverage, and institution breakdown.

## When to use OpXRD

**Use OpXRD when:**

- You have experimental XRD data and need to identify crystalline phases
- You want to find reference patterns for specific element combinations
- You need to compare your synthesized material's diffraction pattern against known structures
- You are building a materials characterization report

**Use PyWPEM instead when:**

- You need to simulate a diffraction pattern from a crystal structure (CIF file)
- You need Rietveld refinement of experimental data
- You need PDF (pair distribution function) analysis
- You need peak fitting or background subtraction

## Limitations

- The database is a snapshot of opXRD. Newly published patterns may not be included until the next database update.
- CrystalNN fingerprints capture overall pattern shape but may not distinguish between polymorphs with subtle peak differences.
- Amorphous materials produce broad humps rather than sharp peaks and are not well-represented in the database.

## Citations

> Hollarek D, Schopmans H, Östreicher J, Teufel J, Cao B, Alwen A, et al. opXRD: Open Experimental Powder X-Ray Diffraction Database. *Advanced Intelligent Discovery*. 2026;2(2):e202500044. doi: [10.1002/aidi.202500044](https://doi.org/10.1002/aidi.202500044)

> Hollarek D, Friederich P. opXRD: Open Experimental Powder X-ray Diffraction Database (dataset). Zenodo. 2025. doi: [10.5281/zenodo.15298026](https://doi.org/10.5281/zenodo.15298026)

## FAQ

### What operations does OpXRD support?

  Pattern search, similarity search, fingerprint computation, pattern retrieval, institution listing, and database statistics.

### How large is the database?

  Over 10,000 patterns from the opXRD repository, hosted on a Modal volume to avoid Zenodo rate limits.

### Which operation names does the tool accept?

  `search_patterns`, `similarity_search`, `get_pattern`, `compute_fingerprint`, `list_institutions`, and `compute_statistics`.

### How does similarity search work?

  Patterns are compared using CrystalNN crystal fingerprints with configurable similarity thresholds.

## Read next
