Fitting Pair Distribution Function with Backpropagation

Zhiyun Yang, Zhihong Luo, Xinjian Ouyang, Ping Wei, Laijun Liu, Dawei Wang, Nan Zhang, Nanning ZhengResearch Square 2025

Abstract

Pair distribution function (PDF) analysis is a powerful technique for characterizing both long-range structures and local distortions in materials, gaining significant importance in materials science. However, conventional PDF modeling approaches—including real-space Rietveld refinement for small-box models and Reverse Monte Carlo (RMC) for big-box models—often suffer from efficiency limitations. We propose a novel approach using backpropagation algorithms to fit neutron and X-ray PDF data of ferroelectric perovskites. Our results demonstrate that this method achieves fitting accuracy comparable to RMC while offering potential efficiency advantages across various temperature ranges. By simultaneously optimizing tens of thousands of parameters, our approach can overcome unstable convergence inherent in RMC’s random perturbation. This method shows particular promise for determining local structures in materials with correlated disorder and illustrates the broader potential of integrating physical formulas within neural network frameworks for materials analysis.

Introduction

In materials science, Pair Distribution Function (PDF) analysis is a crucial technique for understanding the atomic structure of materials, particularly the local, short-range distortions that give functional materials, such as ferroelectrics, their unique properties. To derive a 3D atomic structure from 1D PDF data, researchers typically rely on the Reverse Monte Carlo (RMC) method for large atomic models. RMC operates by randomly moving one atom at a time and accepting the move if it improves the fit to experimental data. However, with models containing tens of thousands of atoms, this sequential "guess-and-check" approach is computationally intensive and prone to local minima. This research introduces a novel method that reframes PDF fitting as a machine learning optimization problem, utilizing backpropagation to optimize all atomic positions simultaneously.

Methodology

The core innovation lies in treating the physical PDF calculation as a differentiable layer within a neural network framework.

Overview of the backpropagation-based PDF fitting workflow, showing the integration of physical formulas as differentiable layers.

The process involves:

  • Forward Pass: The standard physical formula for calculating a PDF from atomic coordinates is implemented as the "forward pass" of the network.
  • Loss Function: A Mean Squared Error (MSE) loss is defined between the calculated PDF and the experimental data.
  • Backpropagation: Automatic differentiation computes gradients of the loss function with respect to every atomic position and lattice parameter simultaneously.
  • Optimization: A custom optimizer, "CRYSTAL ADAM," updates the structure using momentum and adaptive learning rates while enforcing physical constraints like minimum interatomic distances.

Experimental Setup and Datasets

The method was validated using real-world scattering data from two ferroelectric perovskites:

  • Neutron total scattering data of Pb(Zr${0.6}$Ti${0.4}$)O$_3$ (PZT) at 300 K, collected at the ISIS neutron spallation source.
  • Synchrotron X-ray total scattering data of BaTiO$_3$ across four temperatures (100 K, 150 K, 300 K, and 400 K), collected at the Diamond Light Source.

Results and Discussion

The backpropagation algorithm demonstrated accuracy comparable to, and in some cases exceeding, traditional RMC methods, particularly for low-temperature BaTiO$_3$ phases.

Comparison of fitting results and structural distributions. (a) PDF fit for PZT. (b) Displacement distributions for Ti, Zr, and Pb. (c) Angular distribution of displacements.

Key findings include:

  • Efficiency: The method successfully optimized 10×10×10 supercells within a 20-minute window for BaTiO$_3$, showcasing significant speed advantages over sequential RMC.
  • Structural Insights: The model accurately captured local displacements, such as the ~0.6 Å shift of Pb atoms in PZT. It revealed that displacive disorder in Pb-based perovskites primarily originates from Pb atoms due to their lone-pair electrons.
  • Phase Transitions: For BaTiO$_3$, the algorithm precisely tracked longitudinal and transverse displacement correlations of Titanium atoms across different temperature-induced phase shifts.

Limitations and Future Outlook

While highly effective for continuous spatial optimizations, the gradient-based approach currently struggles with discrete "atomic swaps" (e.g., swapping different ion types in alloys), which RMC handles more naturally. Future work aims to develop differentiable mathematical descriptions for ionic arrangements and explore "implicit layers" to further reduce the computational overhead for even larger systems. This work paves the way for integrating complex physical laws directly into deep learning architectures for materials analysis.

Summary updated

BibTeX
@inproceedings{yang2025fitting,
  author = {Zhiyun Yang and Zhihong Luo and Xinjian Ouyang and Ping Wei and Laijun Liu and Dawei Wang and Nan Zhang and Nanning Zheng},
  title = {{Fitting Pair Distribution Function with Backpropagation}},
  booktitle = {Research Square},
  year = {2025},
  doi = {10.21203/rs.3.rs-7236673/v1},
}
Figure