rhoprint
Physically interpretable descriptors ("fingerprints") extracted from VASP
charge-density (CHGCAR) files, for materials-informatics and ML
interpretability studies.
Developed at CMS Lab, IIT Kanpur (Department of Materials Science and Engineering) alongside work on charge-density-informed ML models for elastic-property prediction (bulk modulus, shear modulus, Young's modulus, formation energy, Debye temperature).
What it computes
For a single CHGCAR file, rhoprint extracts:
| Functional | What it measures |
|---|---|
zeta |
Angular variance of the density gradient relative to nearest-atom direction (0 = radial/ionic, 1 = angular/covalent) |
laplacian_mean, laplacian_std, laplacian_neg_fraction, laplacian_pos_fraction, laplacian_min, laplacian_max |
Grid-level ∇²ρ statistics — a cheap proxy for covalent (∇²ρ<0) vs. ionic/metallic (∇²ρ>0) bonding character |
total_charge, moment_1, moment_2, moment_3, radial_variance |
Radial moments of ρ(r) about the nearest atom |
interstitial_fraction, bond_fraction |
Fraction of electron density in the interstitial / bonding region |
A second layer of derived cross-term descriptors (ratios and products of
the above, e.g. fint_over_lnf) and compositional descriptors (via
pymatgen: mean electronegativity, oxidation state, atomic radius, etc.) can
be computed on top of a dataset of these raw functionals.
Install
pip install rhoprint # once published to PyPI
# or, for development:
git clone https://github.com/CMSLab-IITK/rhoprint
cd rhoprint
pip install -e ".[dev]"
Quickstart
from rhoprint import parse_chgcar, compute_all_grid_functionals
data = parse_chgcar("CHGCAR")
features = compute_all_grid_functionals(data)
print(features)
# {'zeta': 0.31, 'laplacian_mean': ..., 'moment_1': ..., ...}
Batch processing a dataset
from rhoprint import run_batch
df = run_batch(
data_dir="/path/to/materials", # each subdir has a CHGCAR file
out_csv="results/functionals.csv",
n_workers=4,
resume=True,
)
or from the command line:
rhoprint compute path/to/CHGCAR
rhoprint batch --data_dir /path/to/materials --out_csv results/functionals.csv --n_workers 4 --resume
Derived + compositional descriptors on a dataset
import pandas as pd
from rhoprint.functionals.derived import compute_derived_ratios
from rhoprint.functionals.composition import compute_compositional_features_batch
df = pd.read_csv("results/functionals.csv")
comp = compute_compositional_features_batch(df["formula"])
df = pd.concat([df, comp], axis=1)
df = compute_derived_ratios(df)
Known limitations
- Non-orthogonal lattices:
compute_laplacian_griddefaults tomethod="metric_tensor", which is exact for any lattice (orthogonal or not) — it uses the full contravariant metric tensor rather than assuming independent, perpendicular axes. A legacymethod="diagonal"is also available, which reproduces the original approximation (exact only for orthogonal cells; silently wrong on monoclinic/triclinic/some hexagonal cells) — use it only if you need to exactly reproduce numbers computed before this fix, and note it will raise a warning on non-orthogonal lattices. Seerhoprint.functionals.laplacianfor the derivation andtests/test_functionals.pyfor an analytic benchmark demonstrating the difference between the two methods. - QTAIM-style critical-point analysis is not performed;
laplacian_*are grid-level summary statistics, used as a cheap proxy for bonding character rather than a rigorous topological classification. parse_chgcarassumes VASP 5 format (element symbols on their own line). VASP 4-formatCHGCARfiles (no element-symbol line) are not supported.
Citing
See CITATION.cff.
License
MIT — see LICENSE.
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 rhoprint-0.1.0.tar.gz.
File metadata
- Download URL: rhoprint-0.1.0.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3c4dd7d9472e5c43bfef47af38616deece0bc0419bfb3df74a584558e833084
|
|
| MD5 |
e276924804b3a9962f466151b71e2697
|
|
| BLAKE2b-256 |
6dd4f9161976c008681be22f8de1a3895986f5ee6f19d6da4d64753f5d4e7bb0
|
File details
Details for the file rhoprint-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rhoprint-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a6cbaa17a932150257b9a73207015b6d75126eab75f22fbd6bb6ffe30fab111
|
|
| MD5 |
c760140b5c614a6156d81afd5a487b70
|
|
| BLAKE2b-256 |
f9d97f5a07f7c328e6b770bc26b3fb4e8316e43b0c26671be694449aae6eb3ed
|