---
title: OpXRD quickstart
description: Run search_patterns by element, then similarity_search on two_theta_values and intensities — cosine above 0.85 is a strong match, 0.70-0.85 is related.
tags:
  - opxrd
  - quickstart
---

## OpXRD quickstart

This guide walks through two common workflows: searching for reference patterns by element composition, and identifying phases in experimental data using similarity search.

## Workflow 1: Search by element composition

### Step 1: Open OpXRD

Navigate to **Tools &gt; OpXRD** in .bloom*, or ask Ivy:

```
Search OpXRD for iron oxide diffraction patterns
```

### Step 2: Configure the search

Select **search_patterns** as the operation and set your filters:

| Parameter | Value |
|-----------|-------|
| Operation | `search_patterns` |
| Elements | `Fe`, `O` |
| Elements mode | `contains` |
| Max results | `20` |

### Step 3: Review results

The results table shows matching patterns:

| ID | Formula | Space Group | Institution | Peaks |
|----|---------|-------------|-------------|-------|
| opxrd-00421 | Fe2O3 | R-3c | KIT | 45 |
| opxrd-00422 | Fe3O4 | Fd-3m | DESY | 38 |
| opxrd-01187 | FeOOH | Pnma | ETH Zurich | 52 |

### Step 4: Download a pattern

Click any pattern ID to view the full 2-theta/intensity data, or click **Download** to get the raw data file.

## Workflow 2: Phase identification via similarity search

### Step 1: Prepare your experimental data

Format your XRD data as 2-theta/intensity pairs. Accepted formats:

- **JSON array**: `[[10.0, 100], [20.5, 350], ...]`
- **CSV**: Two columns (two_theta, intensity)
- **File upload**: CSV or JSON file

### Step 2: Run similarity search

Select **similarity_search** and provide your pattern as two parallel arrays:

| Parameter | Value |
|-----------|-------|
| Operation | `similarity_search` |
| `two_theta_values` | Your 2-theta values |
| `intensities` | Your intensity values (same order) |
| Similarity threshold | `0.75` |

Or ask Ivy:

```
Identify the phases in my XRD pattern: [[10.2, 150], [20.4, 800], [25.1, 350], [30.0, 600], [35.2, 250]]
```

### Step 3: Interpret matches

Results are ranked by cosine similarity:

| Rank | Formula | Similarity | Space Group |
|------|---------|------------|-------------|
| 1 | TiO2 (rutile) | 0.94 | P42/mnm |
| 2 | TiO2 (anatase) | 0.82 | I41/amd |
| 3 | Ti2O3 | 0.71 | R-3c |

A similarity score above 0.85 indicates a strong phase match. Scores between 0.70-0.85 suggest related structures that warrant closer examination.

### Step 4: Refine with PyWPEM

For identified phases, use [PyWPEM](/docs/pywpem) to run Rietveld refinement and obtain quantitative phase fractions.

## Workflow 3: Database exploration

Ask Ivy to explore the database:

```
Show OpXRD database statistics
```

This returns aggregate counts by element, space group, and institution, useful for understanding database coverage before running targeted searches.

## Next steps

- See [inputs](/docs/opxrd/inputs) for all filter parameters and data formats
- See [outputs](/docs/opxrd/outputs) for field definitions and similarity score interpretation
- Use [PyWPEM](/docs/pywpem) for refinement of identified phases

## Read next
