Skip to main content

High-performance molecular dynamics trajectory analysis (RDF, SSF, VHF, MSD/cMSD, diffusion tensors).

Project description

Ripple

PyPI version Python versions License

Ripple is a high-performance Python package for molecular dynamics trajectory analysis. It uses an ASE-friendly input model, memmap-backed preparation, and threaded C++ kernels to accelerate large trajectory workflows on workstations and HPC systems.

Features

  • Radial distribution function (RDF)
  • Static structure factor (SSF)
  • Van Hove function, self and distinct parts (VHF)
  • Intermediate scattering function, self and distinct parts (ISF)
  • Mean-square displacement (MSD) and collective MSD (cMSD)
  • Diffusion tensor estimation with OLS or block-covariance MCMC

Installation

Install the published package from PyPI:

pip install ripple-hpc

The examples below use ASE to read trajectories:

pip install ase

Install the latest development version from GitHub:

pip install git+https://github.com/Frost-group/Ripple-hpc.git

Workflow model

Ripple follows a two-step workflow:

  1. prepare_* reads a trajectory and writes reusable memmap caches.
  2. *_cal() runs the threaded analysis kernel and returns result objects in memory.

For repeated analyses on the same trajectory, pass reuse_memmap=True and keep a stable trajectory_tag.

Quick start

This example follows the same pattern as tests/smoke_test.py.

from pathlib import Path

from ase.io import iread

from ripple.prepare_diffusion import prepare_diffusion
from ripple.prepare_isf import prepare_isf
from ripple.prepare_rdf import prepare_rdf
from ripple.prepare_ssf import prepare_ssf
from ripple.prepare_vhf import prepare_vhf_distinct, prepare_vhf_self

traj_path = Path("tests/MaceMD_444_0v_700K.xyz")
traj_factory = lambda: iread(str(traj_path), format="extxyz", index=":")

species = "Li"
n_frames = 1000
dt_ps = 0.1
n_workers = 8
save_dir = "ripple_outputs"
traj_tag = "smoke_test"

RDF

rdf_prepared = prepare_rdf(
    traj_factory,
    target_atoms1=species,
    target_atoms2=species,
    n_frames=n_frames,
    save_dir=save_dir,
    pos_dtype="float64",
    reuse_memmap=True,
    trajectory_tag=traj_tag,
)

rdf_res = rdf_prepared.rdf_cal(
    mode="abc",
    r_max=11.0,
    dr=0.05,
    n_workers=n_workers,
)

print(rdf_res.bins.shape)
print(rdf_res.rdf.shape)

VHF

vhf_self_prepared = prepare_vhf_self(
    traj_factory,
    target_atoms=species,
    n_frames=n_frames,
    save_dir=save_dir,
    pos_dtype="float64",
    reuse_memmap=True,
    trajectory_tag=traj_tag,
)

vhf_self_res = vhf_self_prepared.vhf_self_cal(
    mode="abc",
    r_max=36.0,
    dr=0.05,
    n_workers=n_workers,
    timestep_ps=dt_ps,
    lag_max=998,
    lag_stride=2,
)

vhf_distinct_prepared = prepare_vhf_distinct(
    traj_factory,
    target_atoms1=species,
    target_atoms2=species,
    n_frames=n_frames,
    save_dir=save_dir,
    pos_dtype="float64",
    reuse_memmap=True,
    trajectory_tag=traj_tag,
)

vhf_distinct_res = vhf_distinct_prepared.vhf_distinct_cal(
    mode="abc",
    r_max=6.0,
    dr=0.1,
    n_workers=n_workers,
    timestep_ps=dt_ps,
    lag_max=500,
    lag_stride=10,
    normalize=True,
)

print(vhf_self_res.Gs.shape)
print(vhf_distinct_res.Gd.shape)

SSF and ISF

ssf_prepared = prepare_ssf(
    traj_factory,
    target_atoms1=species,
    target_atoms2=species,
    n_frames=n_frames,
    save_dir=save_dir,
    pos_dtype="float64",
    reuse_memmap=True,
    trajectory_tag=traj_tag,
)

ssf_res = ssf_prepared.ssf_cal(
    k_max=5.0,
    dk_shell=0.5,
    n_workers=n_workers,
    max_points=20000,
)

isf_prepared = prepare_isf(
    traj_factory,
    target_atoms1=species,
    target_atoms2=species,
    n_frames=n_frames,
    save_dir=save_dir,
    pos_dtype="float64",
    reuse_memmap=True,
    trajectory_tag=traj_tag,
)

isf_self_res = isf_prepared.isf_self_cal(
    mode="abc",
    q_max=5.0,
    dq_shell=0.5,
    n_workers=n_workers,
    timestep_ps=dt_ps,
    lag_max=500,
    lag_stride=5,
    max_points=20000,
)

isf_distinct_res = isf_prepared.isf_distinct_cal(
    mode="abc",
    q_max=5.0,
    dq_shell=0.5,
    n_workers=n_workers,
    timestep_ps=dt_ps,
    lag_max=500,
    lag_stride=5,
    max_points=20000,
)

print(ssf_res.ssf.shape, ssf_res.shell.shape)
print(isf_self_res.Fs.shape, isf_self_res.lags.shape, isf_self_res.q_shell.shape)
print(isf_distinct_res.Fd.shape, isf_distinct_res.lags.shape, isf_distinct_res.q_shell.shape)

Diffusion tensors from MSD and cMSD

diff_prepared = prepare_diffusion(
    traj_factory,
    target_atoms=species,
    timestep_ps=dt_ps,
    n_frames=n_frames,
    save_dir=save_dir,
    trajectory_tag=traj_tag,
    pos_dtype="float64",
    reuse_memmap=True,
)

msd_res = diff_prepared.msd_cal(n_workers=n_workers)
cmsd_res = diff_prepared.cmsd_cal(n_workers=n_workers)

fit_self_ols = msd_res.diffusion_tensor(
    method="ols",
    fit_lag_frac=(0.05, 0.95),
    fit_n_lags=200,
    psd=False,
)

fit_sigma_mcmc = cmsd_res.diffusion_tensor(
    method="mcmc",
    fit_lag_frac=(0.05, 0.95),
    fit_n_lags=100,
    n_blocks=50,
    min_block_len=10,
    n_samples=1500,
    n_walkers=32,
    n_burn=400,
    n_thin=10,
    seed=42,
    progress=False,
)

print(msd_res.msd_tensor.shape)
print(fit_self_ols.D_tensor)
print(fit_sigma_mcmc.D_tensor)

Input expectations

  • Trajectories can be passed as a sequence, a single-pass iterable with n_frames, or a factory such as lambda: ase.io.iread(...).
  • ASE is not a mandatory package dependency, but it is the recommended reader in the examples.
  • For very large datasets, prefer a trajectory factory plus reuse_memmap=True.

Result objects

Ripple returns typed result objects instead of writing HDF5 files by default. Typical fields are:

  • RDF: rdf_res.rdf, rdf_res.bins
  • VHF: vhf_self_res.Gs, vhf_distinct_res.Gd, times_ps, bins
  • SSF: ssf_res.ssf, ssf_res.shell
  • ISF: isf_self_res.Fs, isf_distinct_res.Fd, q_shell
  • Diffusion: msd_res.msd_tensor, cmsd_res.cmsd_tensor, fit.D_tensor

If you want to remove cached memmaps after analysis, call .clean() on the prepared object.

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ripple_hpc-1.2.6.tar.gz (26.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ripple_hpc-1.2.6-cp312-cp312-win_amd64.whl (820.1 kB view details)

Uploaded CPython 3.12Windows x86-64

ripple_hpc-1.2.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ripple_hpc-1.2.6-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

ripple_hpc-1.2.6-cp311-cp311-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11Windows x86-64

ripple_hpc-1.2.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ripple_hpc-1.2.6-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

ripple_hpc-1.2.6-cp310-cp310-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.10Windows x86-64

ripple_hpc-1.2.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ripple_hpc-1.2.6-cp310-cp310-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file ripple_hpc-1.2.6.tar.gz.

File metadata

  • Download URL: ripple_hpc-1.2.6.tar.gz
  • Upload date:
  • Size: 26.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ripple_hpc-1.2.6.tar.gz
Algorithm Hash digest
SHA256 d5921743eb5e3bbed32b1c2283c148f4a8bc07d9417ca89ff77598858f03fe4b
MD5 c61cca827b33f3731919f7e24330395f
BLAKE2b-256 4fb6f71f01fb31d48bc051c599ebffbeebd1739cbbbee671db1fcd53eab0941f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.2.6.tar.gz:

Publisher: wheels.yml on Lucius2019/Ripple-hpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ripple_hpc-1.2.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: ripple_hpc-1.2.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 820.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ripple_hpc-1.2.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5434ec56fa257752bbe93dc8af5fafd6024e712d98c29b49854d1ace98eb0c8e
MD5 842a5280807da78ef41110859ceab7ff
BLAKE2b-256 0b7133d8873192a2000fcfefd812e060d159ced5bf3eac921df4b762ef9d959e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.2.6-cp312-cp312-win_amd64.whl:

Publisher: wheels.yml on Lucius2019/Ripple-hpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ripple_hpc-1.2.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.2.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8db4d62a26006be6554f03b2acb81987a31b724a18bcb17d31ec268bc2fc9afd
MD5 c83a6fb2b8a31e9c8f85462fb933b334
BLAKE2b-256 0aab6d6d7d473e069b1d154555184f9a16667fe3771a1bd9f7cac7d23c49b5ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.2.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: wheels.yml on Lucius2019/Ripple-hpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ripple_hpc-1.2.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.2.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 da9c278a241ce4093310b76fd9a03d8ee63892c64bbb7ee87bf44206e26d5f9c
MD5 82e1ecb62bcd3102fd4f7b50952d6e16
BLAKE2b-256 1ec19063d3d0d626c6f01c57f89280618071ae1f08116088196ea41049be18b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.2.6-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Lucius2019/Ripple-hpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ripple_hpc-1.2.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: ripple_hpc-1.2.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ripple_hpc-1.2.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 dfb6d15fe55a6df35453ea436b2042fee6593e5c8b57ac548c990d8a547c4316
MD5 34036ca75f9cb47bc5a9093084ca8c38
BLAKE2b-256 1921f590d7c27b87699526f11bdbf47d855fef77c011fbee7d8319a730fa2a6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.2.6-cp311-cp311-win_amd64.whl:

Publisher: wheels.yml on Lucius2019/Ripple-hpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ripple_hpc-1.2.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.2.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 95de51f5b4b9670dda5993f12368f1cb3458c2417a24b419362fd2bcb6fbd10b
MD5 568fa03aeabef19001e19b675084e9e0
BLAKE2b-256 ad9efdd53743c1aaa43cde72f597ca960491927acfa551934ea70f4180879dc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.2.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: wheels.yml on Lucius2019/Ripple-hpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ripple_hpc-1.2.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.2.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a028f8fe61277544e399ed47a1dbb51f8f83f2040e72548f6017b11bb2e65df5
MD5 73bf9b328057a81b1500e125d69834b8
BLAKE2b-256 653582b36e4cec7f5a1d772399db93b5742c2f1299d464d9b2336027b3a7d4c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.2.6-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Lucius2019/Ripple-hpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ripple_hpc-1.2.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: ripple_hpc-1.2.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ripple_hpc-1.2.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4debc5c92257ecc809e75378ba4bdda8eb8310ec143d8a7277e83e5d98e373e2
MD5 01ad9fbf8fd571880beea27ae4ebf89f
BLAKE2b-256 3db1f7532dfa66e4df2e3f2841c56e8b3e761749202b1fb8bc606be41e06bffa

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.2.6-cp310-cp310-win_amd64.whl:

Publisher: wheels.yml on Lucius2019/Ripple-hpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ripple_hpc-1.2.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.2.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ad5f08aa1973a482678616a3d67474d04a3e04ed65ee0df60ba40e53f203550b
MD5 371ef43eb18bcb17ddd013b12ebe6388
BLAKE2b-256 b65974bdf6a27a83025d95471d9d26f5d0e2928348e8891918bbcdc679972373

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.2.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: wheels.yml on Lucius2019/Ripple-hpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ripple_hpc-1.2.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.2.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1f3846849a3d1b9e0352e8320e77db8f56f8864e81eda025167639abf11ad8f2
MD5 ba1e1e78a65b3bb13a082c4a6b0e3048
BLAKE2b-256 611ce0121e65ba9049e56f09c91a6f08419107642995af5d68eec60ed1a5ea8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.2.6-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Lucius2019/Ripple-hpc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page