Giter Club home page Giter Club logo

rdfpy's Introduction

rdfpy

Build Status Documentation Status PyPI version License

rdfpy is a Python module for fast computation of 2D and 3D radial distribution functions (RDFs).

Installation

$ pip install rdfpy

Usage

import numpy as np
from rdfpy import rdf

# create random particle coordinates in a 20x20x20 box
coords = np.random.uniform(0.0, 20.0, size=(2500, 3))  

# compute radial distribution function with step size = 0.1
g_r, radii = rdf(coords, dr=0.1)

You can find a more detailed example in the Documentation.

Note: In order for rdfpy to work correctly, your particles should spatially be in a cuboidal box, where the entire box is filled with particles.

How does it work?

rdfpy achieves significant speed-up due to:

  • Fast nearest-neighbor look-up: a k-d tree is utilized when counting the number of particles as a function of distance from an origin particle.
  • Multiprocessing: computation of the particle count histogram is parallelized across multiple cores, with each core sharing the aforementioned k-d tree.

Authors

rdfpy was developed by Batuhan Yildirim under the supervision of Prof. Jacqueline M. Cole.

Citation

If you use rdfpy in your work, please cite:

@software{rdfpy,
  author       = {Batuhan Yildirim and
                  Hamish Galloway Brown},
  title        = {by256/rdfpy: rdfpy-v1.0.0},
  month        = mar,
  year         = 2021,
  publisher    = {Zenodo},
  version      = {v1.0.0},
  doi          = {10.5281/zenodo.4625675},
  url          = {https://doi.org/10.5281/zenodo.4625675}
}

DOI

Funding

This project was financially supported by the Science and Technology Facilities Council (STFC) and the Royal Academy of Engineering (RCSRF1819\7\10).

rdfpy's People

Contributors

by256 avatar hamishgbrown avatar jan-janssen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rdfpy's Issues

Analytical number density correction

Currently, rdfpy computes the number density by finding the minimum size cuboidal box that can be placed around the given particle coordinates, and dividing the number of particles by the volume of this box.

When the number of particles intersecting the bounds of this box is large, this results in an incorrect number density, causing the resulting radial distribution function to not be centred around 1. This is more of an issue in 3D, where the number of box intersecting particles is significantly greater than the 2D case.

An analytical solution is needed, which finds the particles that intersect the box faces/corners, and computes what proportion of these particles is inside the box. When computing the number density, these intersecting particles should be counted as their proportion which exists inside the box.

This should be implemented as a separate function which will become the default number density calculation in both the rdf2d and rdf3d functions.

I may get around to doing this myself at some point...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.