CellListMap.jl: Efficient and customizable cell list implementation for calculation of pairwise particle properties within a cutoff
收藏资源简介:
N-body simulations and trajectory analysis rely on the calculation of attributes that depend on pairwise particle distances within a cutoff. Interparticle potential energies, forces, distribution functions, neighbor lists, and distance-dependent distributions, for example, must be calculated. Cell lists are widely used to avoid computing distances outside the cutoff. However, efficient cell list implementations are difficult to customize. Here, we provide a fast and parallel implementation of cell lists in Julia that allows the mapping of custom functions dependent on particle positions in 2 or 3 dimensions. Arbitrary periodic boundary conditions are supported. Automatic differentiation and unit propagation can be used. The implementation provides a framework for the development of new analysis tools and simulations with custom potentials. The performance of resulting computations is comparable to state-of-the-art implementations of neighbor list algorithms and cell lists, available in specialized software. Examples are provided for the computation of potential energies, forces, distribution of pairwise velocities, neighbor lists and other typical calculations in molecular and astrophysical simulations. The Julia package is freely available at http://m3g.github.io/CellListMap.jl. Interfacing with Python and R with minimal overhead is possible.
N体模拟与轨迹分析依赖于对截断半径内粒子间两两距离相关属性的计算。例如,粒子间势能、作用力、分布函数、邻接列表以及与距离相关的分布等,均需通过此类计算获得。单元格列表(cell lists)被广泛用于规避对截断半径外的粒子距离进行不必要的计算,但高效的单元格列表实现往往难以进行自定义定制。本研究提供了一套基于Julia语言的快速并行单元格列表实现方案,支持针对二维或三维空间中的粒子位置映射自定义函数,可兼容任意形式的周期性边界条件,同时支持自动微分与单位传递功能。本实现为基于自定义势能的新型分析工具开发与模拟研究提供了通用框架,其计算性能可与专业软件中现存的顶尖邻接列表算法与单元格列表实现方案相媲美。本方案提供了势能计算、作用力计算、两两速度分布统计、邻接列表生成以及分子与天体物理模拟中其他典型计算任务的示例。该Julia程序包可在http://m3g.github.io/CellListMap.jl免费获取,且可通过极低的开销与Python、R语言进行对接。



