RDF/ADF computation tools with periodic-table-based labeling
Project description
rdfadf Package
1. Summary
rdfadf is for computing
RDF (Radial Distribution Function) and
ADF (Angular Distribution Function)
for crystalline and amorphous materials with high numerical accuracy.
This script was developed for educational purposes and has not been optimized for computational speed. As a result, it may become significantly slower when applied to very large systems with a high number of particles. This script is primarily built using the functionality provided by the Atomic Simulation Environment (ASE) https://ase-lib.org/.
Key features:
- Fully PBC-aware RDF / ADF computation
- Native support for ASE (
ase.Atoms) - Flexible selection of central and neighbor atoms using: element symbols / block (s,p,d,f) / group (G#) / period (P#) / All
- RDF:
- Normalized per central atom
- Optional 4πr² normalization
- Cumulative counts → direct coordination number (CN)
- ADF:
- Distance filtering (r_min, r_max)
- Normalized per central atom
- Optional Gaussian smoothing
- Optimized for research, MD trajectory analysis, and materials informatics workflows
2. Installation
Install the package from the project root directory:
pip install .
Uninstall:
pip uninstall rdfadf -y
3. Inputs
The package accepts ASE Atoms objects:
from ase.io import read
atoms = read("POSCAR")
atoms = read("structure.cif")
atoms = read("output.traj")
4. Label Specification
You can classify central and neighbor atoms using:
| Category | Example | Meaning |
|---|---|---|
| Element | "Li", "O", "Co" | Specific element |
| All | "All" | All elements in the structure |
| Block | "s", "p", "d", "f" | s/p/d/f block |
| Group | "G16" | Group 16 |
| Period | "P3" | Period 3 |
Examples:
"Li"–"O"→ Li–O RDF"Co"–"All"→ Co around all elements"d"–"p"→ d-block vs p-block atoms"G1"–"O"→ Group 1 elements around O
5. RDF Function
compute_general_rdf(atoms, center_label, neighbor_label, ...)
Output includes:
r,
g_raw_norm,
g_smooth,
g_raw2,
g_smooth2,
cumulative_raw,
cumulative_smooth
cumulative_raw is the coordination number (CN) curve.
6. ADF Function
compute_general_adf(atoms, center_label, neigh1_label, neigh2_label, ...)
Supports:
- Distance filtering (r_min, r_max)
- Normalization per central atom
- Gaussian smoothing
7. Example (RDF)
from rdfadf import compute_general_rdf
from ase.io import read
atoms = read("POSCAR")
r, g_raw, g_smooth, g_raw2, g_smooth2, cn_raw, cn_smooth = compute_general_rdf(
atoms,
center_label="Co",
neighbor_label="O",
rcut=6.0,
bins=200,
sigma=2.0
)
8. Example (ADF)
from rdfadf import compute_general_adf
from ase.io import read
atoms = read("POSCAR")
theta, adf_raw, adf_smooth = compute_general_adf(
atoms,
center_label="Co",
neigh1_label="O",
neigh2_label="O",
rcut=4.0,
r_min=1.0,
r_max=3.0,
bins=180,
sigma=2.0
)
9. Notes
- ADF computation may be more expensive than RDF (O(N × n_neighbors²))
atoms.pbc = Trueis required for proper PBC handling- Large MD trajectories require frame-by-frame analysis
- Adjust
binsandrcutdepending on the system
10. License
MIT License is recommended.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rdfadf-0.1.0.tar.gz.
File metadata
- Download URL: rdfadf-0.1.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02d70be6725fd7fbd151f971bb788feea84a116d9daa4432eac012e4d0e8cc5e
|
|
| MD5 |
cca52772e07b6e82b696171be12a4294
|
|
| BLAKE2b-256 |
2eb8389e0fea2fb38dd474747611dc4bf4f378c8f58ae668ebfc9e090078fb80
|
File details
Details for the file rdfadf-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rdfadf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
129d7edf9740bef4e74acbbda7c7b8135b5be6fb5c09a9b6c3eb6e82b8525b67
|
|
| MD5 |
282b14d55a22760cd91e24c0c235aef2
|
|
| BLAKE2b-256 |
2037e510a51e710f8afb5735f0322ab613e12e793d570c082fa7d9b13066246c
|