Welcome to XHARPy’s documentation!
XHARPy (X-ray diffraction data Hirshfeld Atom Refinement in Python) is a Python library that enables refinement with custom atomic form factor calculations.
This is the first refinement library to implement the calculation of atomic form factors from periodic PAW-DFT calculations. Currently the following sources for atomic form factors are available:
Periodic PAW with GPAW
Periodic PAW with Quantum Espresso
Independent Atom model
tsc files written by other programs
LCAO calculation (with optional cluster charges) using ORCA/NoSpherA2
The library has been written with extensibility in mind. You can look at the f0j_sources folder for examples how to write a new atomic form factor source. If you want to develop without touching the library itself you can have a look at the custom_function_source, This source exposes the functions, that are called during the refinement.
Refinement itself relies heavily on JAX for the automatic generation of gradients. This means that new features only have to be implemented in the loss function. No explicit gradients are needed.
If you have used the library in your research, please cite the paper where it was originally published:
Ruth, P.N., Herbst-Irmer, R. & Stalke, D. (2022). IUCrJ, 9, 286-297. https://doi.org/10.1107/S2052252522001385
The source code is available at https://github.com/Niolon/XHARPy
Creation of this library was only possible due the generous support of the Research Training Group BENCh at the University of Göttingen, which is funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - 389479699/GRK245
Note
This project is still at the beginning of its development. Things might fundamentally change with future versions.
Contents:
- Installation
- Command Line Interface
- Scripting with XHARPy
- Examples
- xharpy
- xharpy package
- xharpy.f0j_sources package
- Module contents
- Subpackages
- Submodules
- xharpy.f0j_sources.gpaw_mpi_source module
- xharpy.f0j_sources.gpaw_source module
- xharpy.f0j_sources.gpaw_spherical_source module
- xharpy.f0j_sources.iam_source module
- xharpy.f0j_sources.nosphera2_orca_source module
- xharpy.f0j_sources.qe_source module
- xharpy.f0j_sources.real_spher_harm module