PyMatterSim: a Python Data Analysis Library for Computer Simulations of Materials Science, Physics, Chemistry, and Beyond

Y.-C. Hu,J. Tian
2024-11-27
Abstract:Computer simulation has become one of the most important tools in scientific research in many disciplines. Benefiting from the dynamical trajectories regulated by versatile interatomic interactions, various material properties can be quantitatively characterized at the atomic scale. This greatly deepens our understanding of Nature and provides incredible insights supplementing experimental observations. Hitherto, a plethora of literature discusses the computational discoveries in studying glasses in which positional disorder is inherent in their configurations. Motivated by active research and knowledge sharing, we developed a data analysis library in Python for computational materials science research. We hope to help promote scientific progress and narrow some technical gaps for the wide communities. The toolkit mainly focuses on physical analyses of glassy properties from the open-source simulator LAMMPS. Nevertheless, the code design renders high flexibility, with functionalities extendable to other computational tools. The library provides data-driven insights for different subjects and can be incorporated into advanced machine-learning workflows. The scope of the data analysis methodologies applies not only to materials science but also to physics, chemistry, and beyond.
Materials Science,Soft Condensed Matter,Statistical Mechanics,Computational Physics
What problem does this paper attempt to address?
The problem that this paper attempts to solve is how to more effectively analyze the structural and dynamic characteristics of disordered materials through data generated by computer simulations in fields such as materials science, physics, and chemistry. Specifically, the paper introduces PyMatterSim, which is a Python data - analysis library for materials science research. PyMatterSim mainly focuses on the physical analysis of glassy materials obtained from the open - source simulator LAMMPS, but its flexible design enables it to be extended to other computational tools and different research fields. The goal of the paper is to promote the progress of scientific research by providing data - driven insights and to narrow the technological gap between different communities. ### Main contributions of the paper 1. **Development of the PyMatterSim library**: - This library is mainly used to analyze the glassy properties in materials science, but it is also applicable to fields such as physics and chemistry. - It provides multiple structural analysis methods, such as Pair Correlation Function (PCF), Structure Factor, Bond - Orientational Order Parameters, etc. - It supports dynamic analysis, including the dynamics of displacement fields, time - related functions, etc. - It provides a measurement method for the Hessian matrix to analyze the vibration and thermal properties of materials. - It includes a vector analysis module that supports the analysis of high - dimensional vectors or matrices. 2. **Flexibility and extensibility**: - The code design is highly flexible and can be easily extended to other computational tools and different research fields. - It supports the analysis of multi - component systems and is applicable to complex systems such as high - entropy alloys. - It can handle different types of data objects, including Boolean values, scalars, vectors, and tensors. 3. **Data processing and analysis**: - It provides the functions of reading and writing atomic trajectories and supports data generated by different computational methods. - Through the neighbor module and the utility function module, it supports the calculations of structure, dynamics, and other analyses. - It adopts an industry - standard code design and can be used as learning material for future software design. ### Specific analysis methods 1. **Pair Correlation Function (PCF)**: - It is defined as \( g(r)=\frac{1}{N\rho}\sum_{i\neq j}\delta(r - |\vec{r}_{ij}|) \), where \( \rho \) is the number density of the system. - For different atomic species, it is defined as \( g_{\alpha\beta}(r)=\frac{V}{N_\alpha N_\beta}\sum_{i\neq j; i\in\alpha; j\in\beta}\delta(r - |\vec{r}_{ij}|) \). 2. **Structure Factor**: - The number density \( \rho(\vec{q})=\sum_{j}\exp(-i\vec{q}\cdot\vec{r}_j) \) is calculated through Fourier transform. - The structure factor is defined as \( S(\vec{q})=\frac{1}{N}\langle\rho(\vec{q})\rho(-\vec{q})\rangle \). 3. **Bond - Orientational Order Parameters**: - For a two - dimensional system, it is defined as \( \phi_l(j)=\frac{1}{N_j}\sum_{m = 1}^{N_j}\exp(il\theta_m) \), where \( l \) is an important parameter that determines the local particle arrangement. - For complex 2D models, it can be adjusted through weighted vectors or matrices, for example \( \phi_l(j)=\sum \)