Name | rheedium JSON |
Version |
2025.6.23
JSON |
| download |
home_page | None |
Summary | Differentiable RHEED simulations and Reconstruction in JAX |
upload_time | 2025-08-20 22:49:50 |
maintainer | Debangshu Mukherjee |
docs_url | None |
author | Debangshu Mukherjee |
requires_python | <3.14,>=3.11 |
license | MIT License
Copyright (c) 2025 Debangshu Mukherjee, Oak Ridge National Laboratory
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
rheed
mbe
pld
jax
electron diffraction
automated synthesis
differentiable programming
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Rheedium
[](https://www.python.org/downloads/)
[](https://badge.fury.io/py/rheedium)
[](https://pepy.tech/projects/rheedium)
[](https://opensource.org/licenses/MIT)
[](https://rheedium.readthedocs.io/en/latest/?badge=latest)
[](https://doi.org/10.5281/zenodo.14757400)
**High-Performance RHEED Pattern Simulation for Crystal Surface Analysis**
*A JAX-accelerated Python package for realistic Reflection High-Energy Electron Diffraction (RHEED) pattern simulation using kinematic theory and atomic form factors.*
[Documentation](https://rheedium.readthedocs.io/) • [Installation](#installation) • [Quick Start](#quick-start) • [Examples](#examples) • [Contributing](#contributing)
</div>
## Overview
Rheedium is a modern computational framework for simulating RHEED patterns with scientific rigor and computational efficiency. Built on JAX for automatic differentiation and GPU acceleration, it provides researchers with tools to:
- **Simulate realistic RHEED patterns** using Ewald sphere construction and kinematic diffraction theory
- **Analyze crystal surface structures** with atomic-resolution precision
- **Handle complex reconstructions** including domains, supercells, and surface modifications
- **Leverage high-performance computing** with JAX's JIT compilation and GPU support
### Key Features
- **JAX-Accelerated**: GPU-ready computations with automatic differentiation
- **Physically Accurate**: Kirkland atomic potentials and kinematic scattering theory
- **Comprehensive Analysis**: Support for CIF files, surface reconstructions, and domains
- **Visualization Tools**: Phosphor screen colormap and interpolation for realistic display
- **Research-Ready**: Designed for thin-film growth, MBE, and surface science studies
## Installation
### Prerequisites
- Python 3.8 or higher
- CUDA-compatible GPU (optional, for acceleration)
### Install from PyPI
```bash
pip install rheedium
```
### Install for Development
```bash
git clone https://github.com/your-username/rheedium.git
cd rheedium
pip install -e ".[dev]"
```
### Dependencies
- JAX (with GPU support if available)
- NumPy
- Matplotlib
- SciPy
- Pandas
- Beartype (for runtime type checking)
## Quick Start
### Basic RHEED Simulation
```python
import rheedium as rh
import jax.numpy as jnp
# Load crystal structure from CIF file
crystal = rh.inout.parse_cif("data/SrTiO3.cif")
# Simulate RHEED pattern
pattern = rh.simul.simulate_rheed_pattern(
crystal=crystal,
voltage_kV=10.0, # Beam energy
theta_deg=2.0, # Grazing angle
detector_distance=1000.0 # Screen distance (mm)
)
# Visualize results
rh.plots.plot_rheed(pattern, interp_type="cubic")
```
### Working with Surface Reconstructions
```python
# Filter atoms within penetration depth
filtered_crystal = rh.ucell.atom_scraper(
crystal=crystal,
zone_axis=jnp.array([0, 0, 1]), # Surface normal
penetration_depth=5.0 # Angstroms
)
# Simulate pattern for surface layer
surface_pattern = rh.simul.simulate_rheed_pattern(
crystal=filtered_crystal,
voltage_kV=15.0,
theta_deg=1.5
)
```
### Advanced Analysis
```python
# Generate reciprocal lattice points
reciprocal_points = rh.ucell.generate_reciprocal_points(
crystal=crystal,
hmax=5, kmax=5, lmax=2
)
# Calculate kinematic intensities
intensities = rh.simul.compute_kinematic_intensities(
positions=crystal.cart_positions[:, :3],
G_allowed=reciprocal_points
)
```
## Examples
### 1. Single Crystal Analysis
```python
import rheedium as rh
# Load SrTiO3 structure
crystal = rh.inout.parse_cif("examples/SrTiO3.cif")
# High-resolution simulation
pattern = rh.simul.simulate_rheed_pattern(
crystal=crystal,
voltage_kV=30.0,
theta_deg=1.0,
hmax=6, kmax=6, lmax=2,
tolerance=0.01
)
# Create publication-quality plot
rh.plots.plot_rheed(
pattern,
grid_size=400,
interp_type="cubic",
cmap_name="phosphor"
)
```
### 2. Surface Reconstruction Study
```python
# Analyze (√13×√13)-R33.7° reconstruction
reconstructed_crystal = rh.ucell.parse_cif_and_scrape(
cif_path="data/SrTiO3.cif",
zone_axis=jnp.array([0, 0, 1]),
thickness_xyz=jnp.array([0, 0, 3.9]) # Single unit cell
)
# Compare patterns at different azimuths
azimuths = [0, 15, 30, 45]
patterns = []
for azimuth in azimuths:
# Rotate crystal
rotation_matrix = rh.ucell.build_rotation_matrix(azimuth)
rotated_crystal = rh.ucell.rotate_crystal(reconstructed_crystal, rotation_matrix)
# Simulate pattern
pattern = rh.simul.simulate_rheed_pattern(rotated_crystal, theta_deg=2.6)
patterns.append(pattern)
```
### 3. Domain Analysis
```python
# Multi-domain simulation
domains = []
for rotation_angle in [33.7, -33.7]: # Twin domains
rotated_crystal = rh.ucell.rotate_crystal(crystal, rotation_angle)
domain_pattern = rh.simul.simulate_rheed_pattern(rotated_crystal)
domains.append(domain_pattern)
# Combine domain contributions
combined_pattern = rh.types.combine_rheed_patterns(domains)
```
## Supported File Formats
- **CIF files**: Crystallographic Information Format with symmetry operations
- **CSV data**: Kirkland atomic potential parameters
- **Image formats**: PNG, TIFF, SVG for visualization output
## Configuration
### Performance Optimization
```python
import jax
# Enable 64-bit precision
jax.config.update("jax_enable_x64", True)
# Use GPU if available
jax.config.update("jax_platform_name", "gpu")
# JIT compilation for speed
@jax.jit
def fast_simulation(crystal, voltage):
return rh.simul.simulate_rheed_pattern(crystal, voltage_kV=voltage)
```
### Custom Atomic Potentials
```python
# Use custom Kirkland parameters
custom_potential = rh.simul.atomic_potential(
atom_no=38, # Strontium
pixel_size=0.05,
sampling=32,
potential_extent=6.0,
datafile="custom_potentials.csv"
)
```
## Applications
Rheedium is designed for researchers working in:
- **Molecular Beam Epitaxy (MBE)**: Real-time growth monitoring and optimization
- **Pulsed Laser Deposition (PLD)**: Surface quality assessment and phase identification
- **Surface Science**: Reconstruction analysis and domain characterization
- **Materials Engineering**: Thin film quality control and defect analysis
- **Method Development**: New RHEED analysis technique validation
## Documentation
Full documentation is available at [rheedium.readthedocs.io](https://rheedium.readthedocs.io/), including:
- **API Reference**: Complete function and class documentation
- **Tutorials**: Step-by-step guides for common workflows
- **Theory Guide**: Mathematical background and implementation details
- **Examples Gallery**: Real-world usage scenarios with code
## Contributing
We welcome contributions from the community! Please see our [Contributing Guide](https://github.com/debangshu-mukherjee/rheedium/blob/main/CONTRIBUTING.md) for details on:
- Code style and standards
- Testing requirements
- Documentation guidelines
- Pull request process
### Development Setup
```bash
git clone https://github.com/your-username/rheedium.git
cd rheedium
pip install -e ".[dev,test,docs]"
pre-commit install
```
### Running Tests
```bash
pytest tests/
pytest --cov=rheedium tests/ # With coverage
```
## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/debangshu-mukherjee/rheedium/blob/main/LICENSE) file for details.
## Citation
If you use Rheedium in your research, please cite:
```bibtex
@software{rheedium2024,
title={Rheedium: High-Performance RHEED Pattern Simulation},
author={Mukherjee, Debangshu},
year={2025},
url={https://github.com/debangshu-mukherjee/rheedium},
version={2025.6.16},
doi={10.5281/zenodo.14757400},
}
```
Raw data
{
"_id": null,
"home_page": null,
"name": "rheedium",
"maintainer": "Debangshu Mukherjee",
"docs_url": null,
"requires_python": "<3.14,>=3.11",
"maintainer_email": "Debangshu Mukherjee <mukherjeed@ornl.gov>",
"keywords": "RHEED, MBE, PLD, JAX, Electron Diffraction, Automated Synthesis, Differentiable Programming",
"author": "Debangshu Mukherjee",
"author_email": "Debangshu Mukherjee <mukherjeed@ornl.gov>",
"download_url": "https://files.pythonhosted.org/packages/4c/81/ed2e44c1d46c0b5fe44a7a6d786a72ce2fead89b9b3d3ce1ac920b72a434/rheedium-2025.6.23.tar.gz",
"platform": null,
"description": "# Rheedium\n\n[](https://www.python.org/downloads/)\n[](https://badge.fury.io/py/rheedium)\n[](https://pepy.tech/projects/rheedium)\n[](https://opensource.org/licenses/MIT)\n[](https://rheedium.readthedocs.io/en/latest/?badge=latest)\n[](https://doi.org/10.5281/zenodo.14757400)\n\n**High-Performance RHEED Pattern Simulation for Crystal Surface Analysis**\n\n*A JAX-accelerated Python package for realistic Reflection High-Energy Electron Diffraction (RHEED) pattern simulation using kinematic theory and atomic form factors.*\n\n[Documentation](https://rheedium.readthedocs.io/) \u2022 [Installation](#installation) \u2022 [Quick Start](#quick-start) \u2022 [Examples](#examples) \u2022 [Contributing](#contributing)\n\n</div>\n\n## Overview\n\nRheedium is a modern computational framework for simulating RHEED patterns with scientific rigor and computational efficiency. Built on JAX for automatic differentiation and GPU acceleration, it provides researchers with tools to:\n\n- **Simulate realistic RHEED patterns** using Ewald sphere construction and kinematic diffraction theory\n- **Analyze crystal surface structures** with atomic-resolution precision\n- **Handle complex reconstructions** including domains, supercells, and surface modifications\n- **Leverage high-performance computing** with JAX's JIT compilation and GPU support\n\n### Key Features\n\n- **JAX-Accelerated**: GPU-ready computations with automatic differentiation\n- **Physically Accurate**: Kirkland atomic potentials and kinematic scattering theory\n- **Comprehensive Analysis**: Support for CIF files, surface reconstructions, and domains\n- **Visualization Tools**: Phosphor screen colormap and interpolation for realistic display\n- **Research-Ready**: Designed for thin-film growth, MBE, and surface science studies\n\n## Installation\n\n### Prerequisites\n\n- Python 3.8 or higher\n- CUDA-compatible GPU (optional, for acceleration)\n\n### Install from PyPI\n\n```bash\npip install rheedium\n```\n\n### Install for Development\n\n```bash\ngit clone https://github.com/your-username/rheedium.git\ncd rheedium\npip install -e \".[dev]\"\n```\n\n### Dependencies\n\n- JAX (with GPU support if available)\n- NumPy\n- Matplotlib\n- SciPy\n- Pandas\n- Beartype (for runtime type checking)\n\n## Quick Start\n\n### Basic RHEED Simulation\n\n```python\nimport rheedium as rh\nimport jax.numpy as jnp\n\n# Load crystal structure from CIF file\ncrystal = rh.inout.parse_cif(\"data/SrTiO3.cif\")\n\n# Simulate RHEED pattern\npattern = rh.simul.simulate_rheed_pattern(\n crystal=crystal,\n voltage_kV=10.0, # Beam energy\n theta_deg=2.0, # Grazing angle\n detector_distance=1000.0 # Screen distance (mm)\n)\n\n# Visualize results\nrh.plots.plot_rheed(pattern, interp_type=\"cubic\")\n```\n\n### Working with Surface Reconstructions\n\n```python\n# Filter atoms within penetration depth\nfiltered_crystal = rh.ucell.atom_scraper(\n crystal=crystal,\n zone_axis=jnp.array([0, 0, 1]), # Surface normal\n penetration_depth=5.0 # Angstroms\n)\n\n# Simulate pattern for surface layer\nsurface_pattern = rh.simul.simulate_rheed_pattern(\n crystal=filtered_crystal,\n voltage_kV=15.0,\n theta_deg=1.5\n)\n```\n\n### Advanced Analysis\n\n```python\n# Generate reciprocal lattice points\nreciprocal_points = rh.ucell.generate_reciprocal_points(\n crystal=crystal,\n hmax=5, kmax=5, lmax=2\n)\n\n# Calculate kinematic intensities\nintensities = rh.simul.compute_kinematic_intensities(\n positions=crystal.cart_positions[:, :3],\n G_allowed=reciprocal_points\n)\n```\n\n## Examples\n\n### 1. Single Crystal Analysis\n\n```python\nimport rheedium as rh\n\n# Load SrTiO3 structure\ncrystal = rh.inout.parse_cif(\"examples/SrTiO3.cif\")\n\n# High-resolution simulation\npattern = rh.simul.simulate_rheed_pattern(\n crystal=crystal,\n voltage_kV=30.0,\n theta_deg=1.0,\n hmax=6, kmax=6, lmax=2,\n tolerance=0.01\n)\n\n# Create publication-quality plot\nrh.plots.plot_rheed(\n pattern, \n grid_size=400,\n interp_type=\"cubic\",\n cmap_name=\"phosphor\"\n)\n```\n\n### 2. Surface Reconstruction Study\n\n```python\n# Analyze (\u221a13\u00d7\u221a13)-R33.7\u00b0 reconstruction\nreconstructed_crystal = rh.ucell.parse_cif_and_scrape(\n cif_path=\"data/SrTiO3.cif\",\n zone_axis=jnp.array([0, 0, 1]),\n thickness_xyz=jnp.array([0, 0, 3.9]) # Single unit cell\n)\n\n# Compare patterns at different azimuths\nazimuths = [0, 15, 30, 45]\npatterns = []\n\nfor azimuth in azimuths:\n # Rotate crystal\n rotation_matrix = rh.ucell.build_rotation_matrix(azimuth)\n rotated_crystal = rh.ucell.rotate_crystal(reconstructed_crystal, rotation_matrix)\n \n # Simulate pattern\n pattern = rh.simul.simulate_rheed_pattern(rotated_crystal, theta_deg=2.6)\n patterns.append(pattern)\n```\n\n### 3. Domain Analysis\n\n```python\n# Multi-domain simulation\ndomains = []\nfor rotation_angle in [33.7, -33.7]: # Twin domains\n rotated_crystal = rh.ucell.rotate_crystal(crystal, rotation_angle)\n domain_pattern = rh.simul.simulate_rheed_pattern(rotated_crystal)\n domains.append(domain_pattern)\n\n# Combine domain contributions\ncombined_pattern = rh.types.combine_rheed_patterns(domains)\n```\n\n## Supported File Formats\n\n- **CIF files**: Crystallographic Information Format with symmetry operations\n- **CSV data**: Kirkland atomic potential parameters\n- **Image formats**: PNG, TIFF, SVG for visualization output\n\n## Configuration\n\n### Performance Optimization\n\n```python\nimport jax\n\n# Enable 64-bit precision\njax.config.update(\"jax_enable_x64\", True)\n\n# Use GPU if available\njax.config.update(\"jax_platform_name\", \"gpu\")\n\n# JIT compilation for speed\n@jax.jit\ndef fast_simulation(crystal, voltage):\n return rh.simul.simulate_rheed_pattern(crystal, voltage_kV=voltage)\n```\n\n### Custom Atomic Potentials\n\n```python\n# Use custom Kirkland parameters\ncustom_potential = rh.simul.atomic_potential(\n atom_no=38, # Strontium\n pixel_size=0.05,\n sampling=32,\n potential_extent=6.0,\n datafile=\"custom_potentials.csv\"\n)\n```\n\n## Applications\n\nRheedium is designed for researchers working in:\n\n- **Molecular Beam Epitaxy (MBE)**: Real-time growth monitoring and optimization\n- **Pulsed Laser Deposition (PLD)**: Surface quality assessment and phase identification\n- **Surface Science**: Reconstruction analysis and domain characterization\n- **Materials Engineering**: Thin film quality control and defect analysis\n- **Method Development**: New RHEED analysis technique validation\n\n## Documentation\n\nFull documentation is available at [rheedium.readthedocs.io](https://rheedium.readthedocs.io/), including:\n\n- **API Reference**: Complete function and class documentation\n- **Tutorials**: Step-by-step guides for common workflows\n- **Theory Guide**: Mathematical background and implementation details\n- **Examples Gallery**: Real-world usage scenarios with code\n\n## Contributing\n\nWe welcome contributions from the community! Please see our [Contributing Guide](https://github.com/debangshu-mukherjee/rheedium/blob/main/CONTRIBUTING.md) for details on:\n\n- Code style and standards\n- Testing requirements\n- Documentation guidelines\n- Pull request process\n\n### Development Setup\n\n```bash\ngit clone https://github.com/your-username/rheedium.git\ncd rheedium\npip install -e \".[dev,test,docs]\"\npre-commit install\n```\n\n### Running Tests\n\n```bash\npytest tests/\npytest --cov=rheedium tests/ # With coverage\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/debangshu-mukherjee/rheedium/blob/main/LICENSE) file for details.\n\n## Citation\n\nIf you use Rheedium in your research, please cite:\n\n```bibtex\n@software{rheedium2024,\n title={Rheedium: High-Performance RHEED Pattern Simulation},\n author={Mukherjee, Debangshu},\n year={2025},\n url={https://github.com/debangshu-mukherjee/rheedium},\n version={2025.6.16},\n doi={10.5281/zenodo.14757400},\n}\n```",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2025 Debangshu Mukherjee, Oak Ridge National Laboratory\n \n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Differentiable RHEED simulations and Reconstruction in JAX",
"version": "2025.6.23",
"project_urls": {
"Documentation": "https://rheedium.readthedocs.io/",
"Homepage": "https://github.com/debangshu-mukherjee/rheedium/"
},
"split_keywords": [
"rheed",
" mbe",
" pld",
" jax",
" electron diffraction",
" automated synthesis",
" differentiable programming"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c072588340a330958447962f8eb3275c4d0ae12532ea91651c7c67195d8b87df",
"md5": "00ce7d7ea2aa10b9fff0d3f792702259",
"sha256": "f9c482d4749dcb24cc1f6035682190c0b5f843f01c4029e4fabb683143b0866f"
},
"downloads": -1,
"filename": "rheedium-2025.6.23-py3-none-any.whl",
"has_sig": false,
"md5_digest": "00ce7d7ea2aa10b9fff0d3f792702259",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.14,>=3.11",
"size": 60618,
"upload_time": "2025-08-20T22:49:48",
"upload_time_iso_8601": "2025-08-20T22:49:48.668132Z",
"url": "https://files.pythonhosted.org/packages/c0/72/588340a330958447962f8eb3275c4d0ae12532ea91651c7c67195d8b87df/rheedium-2025.6.23-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4c81ed2e44c1d46c0b5fe44a7a6d786a72ce2fead89b9b3d3ce1ac920b72a434",
"md5": "fd797c52a96ab10fddcb79533b42b93d",
"sha256": "b36bb1e42798cfb42fe23c8bda9c614df9d1efcf88111cb6c63ea47b5bd9af79"
},
"downloads": -1,
"filename": "rheedium-2025.6.23.tar.gz",
"has_sig": false,
"md5_digest": "fd797c52a96ab10fddcb79533b42b93d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.14,>=3.11",
"size": 52385,
"upload_time": "2025-08-20T22:49:50",
"upload_time_iso_8601": "2025-08-20T22:49:50.973783Z",
"url": "https://files.pythonhosted.org/packages/4c/81/ed2e44c1d46c0b5fe44a7a6d786a72ce2fead89b9b3d3ce1ac920b72a434/rheedium-2025.6.23.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-20 22:49:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "debangshu-mukherjee",
"github_project": "rheedium",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rheedium"
}