Crystal Orientation in nBragg

Understanding Crystal Orientation

Crystal orientation is fundamental to Bragg edge neutron transmission analysis. Unlike polycrystalline materials where Bragg edges appear at fixed wavelengths regardless of orientation, single crystals produce Bragg dips whose positions depend critically on how the crystal is oriented relative to the neutron beam.

nBragg provides a straightforward framework for specifying crystal orientations while maintaining full compatibility with NCrystal’s underlying physics engine.

Quick Start

The simplest way to specify orientation in nBragg:

import nbragg

# Define crystal orientation
# [hkl]_z: Miller indices along beam direction (z-axis)
# [hkl]_y: Miller indices along y-axis

crystal = nbragg.Crystal(
    material='Fe',
    orientation_z=[0, 0, 1],  # (001) plane perpendicular to beam
    orientation_y=[0, 1, 0]   # (010) plane along y-axis
)

Why Orientation Matters

For Single Crystals

The position and intensity of Bragg dips in the transmission spectrum depend on the crystal’s orientation relative to the beam. Accurate orientation specification enables:

  • Texture analysis of materials

  • Strain/stress measurements via Bragg dip shifts

  • Crystallographic phase identification

  • Quantitative microstructure characterization

For Polycrystals

While Bragg edges are orientation-independent, understanding orientation becomes crucial when analyzing:

  • Textured materials with preferred orientations

  • Transition from polycrystalline to single-crystal behavior

  • Orientation distribution functions (ODFs)

Coordinate System Convention

nBragg uses a fixed laboratory coordinate system to simplify orientation specification:

  • Incident beam: Always along the positive z-axis (\(\mathbf{k}_i \parallel +\mathbf{z}\))

  • Laboratory frame: Right-handed orthogonal system \((x, y, z)\)

  • Crystal frame: Defined by two reciprocal lattice vectors

This differs from NCrystal’s fully flexible approach but makes orientation specification more intuitive for neutron imaging experiments where the beam direction is typically fixed.

Note

This simplification does not limit the analysis - any crystal orientation can still be described using the two-vector specification method.

Documentation Structure

We provide three complementary resources:

Resource

Best For

Level

Crystal Orientation in nBragg

Complete theory and detailed examples

Beginner to Advanced

Crystal Orientation Quick Reference

Quick lookup during analysis

Intermediate to Advanced

../examples/orientation_examples

Working Python code

All Levels

Getting Started

New to crystal orientations?

Start with the basic-concept section of the Crystal Orientation in nBragg to understand the fundamentals.

Experienced with crystallography?

Jump directly to the Crystal Orientation Quick Reference for equations and code snippets.

Learning by doing?

Download and run ../examples/orientation_examples to see practical implementations.

Common Use Cases

  1. Standard Cubic Orientation

    Most common starting point:

    orientation_z = [0, 0, 1]
    orientation_y = [0, 1, 0]
    
  2. Rotated Crystal (Texture Analysis)

    For textured samples:

    orientation_z = [1, 1, 1]  # {111} texture
    orientation_y = [1, -1, 0]
    
  3. Fitting to Experimental Data

    Refine orientation to match Bragg dip positions:

    # Start with initial guess
    # Apply small rotations φ (x-axis) and θ (y-axis)
    # Minimize difference with experimental spectrum
    

Key Concepts

Before diving into the detailed documentation, familiarize yourself with these concepts:

Miller Indices [hkl]

Describe crystal planes in reciprocal lattice space. The vector \(\mathbf{n}_{hkl}\) is perpendicular to the (hkl) crystal plane.

Reciprocal Space

Orientation is specified using reciprocal lattice vectors, not real-space crystal axes. For cubic systems, these are parallel, but for other crystal systems they differ.

Mosaicity

Real crystals have imperfections - crystal planes are spread over a range of orientations described by a Gaussian distribution with FWHM \(\eta\).

Bragg Circles

At a given wavelength, neutrons satisfying the Bragg condition form a circle in reciprocal space. The crystal orientation determines if this circle intersects the crystal planes.

Mathematical Framework

The orientation is mathematically described by a rotation \(g \in SO(3)\) that maps the laboratory frame to the crystal frame:

\[g(\alpha, \beta, \gamma) = R_Z(\alpha) R_Y(\beta) R_Z(\gamma)\]

where \(\alpha, \beta, \gamma\) are Euler angles in Matthies convention.

In practice, you specify this rotation implicitly through the two Miller index vectors [hkl]_z and [hkl]_y, which nBragg converts internally to the appropriate rotation.

See the Crystal Orientation in nBragg for complete mathematical details.

Next Steps

  1. Read the theory: Crystal Orientation in nBragg

  2. Try the examples: ../examples/orientation_examples

  3. Keep the reference handy: Crystal Orientation Quick Reference

  4. Apply to your data: See ../tutorials/bragg_dip_fitting

Additional Resources

  • NCrystal Documentation: For underlying physics implementation

  • Crystallography Primers: For Miller indices and reciprocal space basics

  • nBragg Tutorials: For complete analysis workflows

Questions?

If you encounter issues with orientation specification:

  1. Check the troubleshooting-checklist in the quick reference

  2. Verify orthogonality of your orientation vectors

  3. Ensure Miller indices are appropriate for your crystal system

  4. Review the examples for similar crystal systems

  5. Contact the nBragg community via [your support channel]