Skip to main content

High-performance molecular dynamics trajectory analysis (RDF, SSF, VHF, ISF, four-point functions, diffusion and non-Gaussian metrics).

Project description

Ripple

PyPI version Python versions License

Ripple is a high-performance Python package for molecular dynamics trajectory analysis. It turns ASE-compatible trajectories into reusable NumPy memory-mapped caches and evaluates structural, dynamical, diffusion, non-Gaussian, and four-point correlation observables with threaded C++ kernels.

The package is designed for repeated analysis of large trajectories on workstations and high-performance computing systems. A trajectory is prepared once, written to a compact cache, and then reused by multiple calculations without rereading the original trajectory file.

Installation

pip install ripple-hpc

Ripple requires Python 3.10+. The only hard runtime dependency is NumPy. Prebuilt wheels are published for the supported CPython versions; source builds require a C++17 compiler and CMake.

What It Computes

  • Pair structure:
    • radial distribution functions for same-species or cross-species pairs
    • shell-averaged partial static structure factors in reciprocal space
  • Single-particle dynamics:
    • self part of the van Hove correlation function
    • self part of the intermediate scattering function
  • Distinct-particle dynamics:
    • distinct part of the van Hove correlation function
    • distinct part of the intermediate scattering function
  • Diffusion and transport:
    • mean-squared displacement tensor curves
    • collective mean-squared displacement tensor curves
    • diffusion tensor fitting by ordinary least squares or generalized least squares
  • Non-Gaussian displacement statistics:
    • lag-resolved scalar non-Gaussian parameter alpha_2(t)
    • fourth-order displacement cumulant tensor kappa_4(t)
    • directional and covariance-whitened summaries of the fourth-order cumulant
  • Dynamic heterogeneity and four-point correlations:
    • four-point dynamic susceptibility chi_4(t)
    • real-space four-point correlation function G_4(r,t)
    • shell-averaged four-point structure factor S_4(q,t)

Mathematical Reference

The formulas below use plain text notation for consistent rendering on package indexes. Ripple applies shell averaging, selected-lag averaging, and normalization inside the calculation methods.

Density mode:
rho_A(q,t) = sum_{i in A} exp[i q . r_i(t)]

Radial distribution function:
g_AB(r) = < sum_{i in A} sum_{j in B}' delta(r - |r_j - r_i|) >
          / [rho_B shell_measure(r)]

Partial static structure factor:
S_AA(q) = < |rho_A(q,t)|^2 / N_A >
S_AB(q) = < Re[rho_A(q,t) rho_B(q,t)^*] / sqrt(N_A N_B) >

Self van Hove correlation function:
G_s(r,t) = < delta(r - |r_i(t0 + t) - r_i(t0)|) >

Distinct van Hove correlation function:
G_d(r,t) = < sum_{i in A} sum_{j in B}'
                 delta(r - |r_j(t0 + t) - r_i(t0)|) >

Self intermediate scattering function:
F_s(q,t) = < exp[i q . (r_i(t0 + t) - r_i(t0))] >

Distinct intermediate scattering function:
F_d(q,t) = < Re[rho_A(q,t0) rho_B(q,t0 + t)^*] >

Mean-squared displacement tensor:
M_self(t) = < Delta r_i(t) Delta r_i(t)^T >

Collective mean-squared displacement tensor:
M_collective(t) = (1 / N) < Delta R(t) Delta R(t)^T >
Delta R(t) = sum_i Delta r_i(t)

Diffusion tensor model:
M(t) = 2 D t + C

Scalar non-Gaussian parameter:
alpha_2(t) = 3 < |Delta r(t)|^4 > / [5 < |Delta r(t)|^2 >^2] - 1

Fourth-order displacement cumulant tensor:
kappa_4,ijkl(t) =
    < delta r_i delta r_j delta r_k delta r_l >
  - < delta r_i delta r_j >< delta r_k delta r_l >
  - < delta r_i delta r_k >< delta r_j delta r_l >
  - < delta r_i delta r_l >< delta r_j delta r_k >

Binary mobility field for four-point correlations:
c_i(t0,t; a) = Theta(|r_i(t0 + t) - r_i(t0)| - a)
delta c_i(t0,t) = c_i(t0,t; a) - <c(t)>

Four-point dynamic susceptibility:
chi_4(t) = N Var_t0[(1 / N) sum_i c_i(t0,t; a)]

Real-space four-point correlation function:
G_4(r,t) = < sum_{i != j} delta c_i(t0,t) delta c_j(t0,t)
                 delta(r - |r_j(t0) - r_i(t0)|) >

Four-point structure factor:
S_4(q,t) = (1 / N) < |sum_i delta c_i(t0,t) exp[i q . r_i(t0)]|^2 >

Basic Workflow

Ripple uses a two-step workflow:

  1. memmap_create(...) reads trajectory frames and writes one reusable PreparedTrajectory cache.
  2. *_cal(prepared, ...) derives any observable-specific memmaps it needs, runs the compiled kernel, and returns a typed result object.

Use memmap_load(...) with the same save_dir and trajectory_tag to reuse an existing cache without rereading the original trajectory.

Minimal Example

from ase.io import iread

from ripple import alpha2_cal, memmap_create, msd_cal, rdf_cal

traj = lambda: iread("trajectory.extxyz", format="extxyz", index=":")
species = "Li"

prepared = memmap_create(
    traj,
    n_frames=1000,
    save_dir="ripple_cache",
    trajectory_tag="run_001",
    pos_dtype="float64",
)
rdf = rdf_cal(
    prepared,
    target_atoms1=species,
    target_atoms2=species,
    mode="abc",
    r_max=10.0,
    dr=0.05,
    n_workers=8,
)
print(rdf.bins, rdf.rdf)

msd = msd_cal(
    prepared,
    target_atoms=species,
    timestep_ps=0.1,
    n_workers=8,
    drift_correction="framework_equal",
)
alpha2 = alpha2_cal(
    prepared,
    target_atoms=species,
    timestep_ps=0.1,
    n_workers=8,
    drift_correction="framework_equal",
)
fit = msd.diffusion_tensor(method="ols")
print(msd.msd_tensor.shape, alpha2.alpha2.shape, fit.D_tensor)

Public Entry Points

  • Prepare/load: memmap_create(...), memmap_load(...), returning PreparedTrajectory.
  • Radial distribution function: rdf_cal(prepared, ...).
  • Static structure factor: ssf_cal(prepared, ...).
  • Self and distinct van Hove correlation functions: vhf_self_cal(prepared, ...) and vhf_distinct_cal(prepared, ...).
  • Self and distinct intermediate scattering functions: isf_self_cal(prepared, ...) and isf_distinct_cal(prepared, ...).
  • Mean-squared displacement, collective mean-squared displacement, and non-Gaussian displacement statistics: msd_cal(prepared, ...), cmsd_cal(prepared, ...), alpha2_cal(prepared, ...), and kappa4_cal(prepared, ...).
  • Four-point dynamic susceptibility, real-space four-point correlation function, and four-point structure factor: chi4_cal(prepared, ...), G4_cal(prepared, ...), and S4_cal(prepared, ...).

Notes

  • Trajectories may be passed as sequences, iterables with n_frames, or factories such as lambda: ase.io.iread(...).
  • Radial real-space calculations support one-, two-, and three-dimensional periodic subspaces through the mode argument. Reciprocal-space structure factors require full three-dimensional periodic boundary conditions.
  • Static-cell trajectories store one cell frame in the cache. Variable-cell trajectories store the cell for every frame and the kernels account for the changing geometry.
  • Periodic analyses validate the required periodic axes before entering the C++ kernels.
  • The diffusion module requires continuous unwrapped trajectory coordinates. It uses Atoms.positions directly and does not unwrap periodic images during preparation.
  • PreparedTrajectory.clean() removes the full cache directory owned by the object, including main cache files and lazily generated derived memmaps.

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.4.2.tar.gz (91.5 kB 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.4.2-cp312-cp312-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.12Windows x86-64

ripple_hpc-1.4.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ripple_hpc-1.4.2-cp312-cp312-macosx_11_0_arm64.whl (932.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

ripple_hpc-1.4.2-cp312-cp312-macosx_10_13_x86_64.whl (999.9 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

ripple_hpc-1.4.2-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11Windows x86-64

ripple_hpc-1.4.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ripple_hpc-1.4.2-cp311-cp311-macosx_11_0_arm64.whl (911.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

ripple_hpc-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl (981.9 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

ripple_hpc-1.4.2-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10Windows x86-64

ripple_hpc-1.4.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ripple_hpc-1.4.2-cp310-cp310-macosx_11_0_arm64.whl (898.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

ripple_hpc-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl (968.9 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: ripple_hpc-1.4.2.tar.gz
  • Upload date:
  • Size: 91.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ripple_hpc-1.4.2.tar.gz
Algorithm Hash digest
SHA256 94e334c0f9921750d13001e9674a38f1e0b6a181758705a65c2933c9db079c39
MD5 e09567cbbd7229064f6cc15643908dc3
BLAKE2b-256 50b22b38330925f6294739f710a81bd814645c458ee068694745cbc06d2ef7c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2.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.4.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: ripple_hpc-1.4.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ripple_hpc-1.4.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d385e549e66680a5827c0735d1955ea16a4538c9003cb340a585bf4918116fc4
MD5 ae3956218f6c0d57eb0116e318780c28
BLAKE2b-256 d157c31c43cd413840bf6cf8a7a9a3ae37f7b0661a3b0f1fb7dff6fffa6dcc6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-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.4.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.4.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 dd12930ef8730c2f194d90a09db08660ccf17aa6830b665f35683cb0dcf42943
MD5 2bb0952d8bcce6a72a879d444f0598e4
BLAKE2b-256 d4d9e6768c037c5fd8f41b1abff7f382614c76c3adbb79d320d6717ecbff329a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-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.4.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.4.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 67856bcacf876edb2d9103d46e4d7a02b783e7a41e89c2a8cbe6b53f4ff97203
MD5 cde706f8e57ed9bb03b262e735def4b6
BLAKE2b-256 a9c7eda5cc72e88a3dd1c9d468511a32a184a14c3c7d8f948d71c98a6f2585aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-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.4.2-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.4.2-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 303aafdeb249106b2a76263db3681afadf73dd6a37f388135cce8d998a94c184
MD5 11e12fa0ece3d1f1c79a9a63edcda2e2
BLAKE2b-256 6e122bf014d9ac70af432a7c4eed89f903da6eee6ad6d6c9393d8c8069332517

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-cp312-cp312-macosx_10_13_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.4.2-cp311-cp311-win_amd64.whl.

File metadata

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

File hashes

Hashes for ripple_hpc-1.4.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b93e7ddf8a370c9d19511bd86f5c82d5406be7a6294dd742ec24fdd07255ea78
MD5 7d86bd106e521ff6511ca4bea09f864f
BLAKE2b-256 d1e0bc4b908a62e62e026c093f2f97ba77611560ecf62c91ec09d020fc4908c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-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.4.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.4.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e47884b0bc75af11b960af964603a8b71af82538506ed0cb94a639e799e6aa05
MD5 18bf6c735f0a3198ba624b9e6f3fa136
BLAKE2b-256 a335ca717f54407fada9b996b5508aaaefdd4d2bf2943743041e1b15d2051999

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-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.4.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.4.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 020310be321ae22a48f58348b1493bdcb507802bc8b9c1ba6033f49781f27243
MD5 a4eb897eb9994f7eb48b7f5db4bae33e
BLAKE2b-256 1ec656ce53e7ada802542677901af496fea27b98790df07a4f97a2aee7934746

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-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.4.2-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e11299444c45221e6302c8cf925097056a1b26e345a667e39a829aade089ade8
MD5 671d1ec48f5a1e6f3a01f53f69441a50
BLAKE2b-256 983851110c51427c146f3831c7b54b35cb6b2f34c1adf32c3332aeef4d190db2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-cp311-cp311-macosx_10_9_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.4.2-cp310-cp310-win_amd64.whl.

File metadata

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

File hashes

Hashes for ripple_hpc-1.4.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c6e238b7b7873416cd11457c22d4afcfa5763fcb056f004fd192f20dcb226a08
MD5 5864e4facda8fa403f1d84f91024120a
BLAKE2b-256 30ca11f9f10bb4e96760ca69b0fd1bb9617ef95cd7e5f2a8b412dbdccd09a1cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-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.4.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.4.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 38250c43423fc0ddcd6aec411f69b8a72d998f986ee7d4f5c6a187a5609d23fa
MD5 67f50d38a8fdf8ca508a89b16cf664e1
BLAKE2b-256 a8cfbbb2c1053070c5e98d1827a9b90950237a41365e60b2d43692b140e2d21f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-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.4.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.4.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 35d70c9a05a8ea083ceeef331c3d2d11e3581af371dde5cedefdb733ca8b496a
MD5 34c339ff89e16ff2b47cfa7dc1660044
BLAKE2b-256 4c8432f9d41ff984d1e542083cc2b4f3908651f3f740e332d4a21d7e225e7e74

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-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.

File details

Details for the file ripple_hpc-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ripple_hpc-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b22fc7a94e895c4cfee8a3f1744b806cd302f4035de83d1a76c64dce6dc76e82
MD5 b748111c81f97d2307553797e15a880a
BLAKE2b-256 e9dee7cf060802f2c01c02204d51f88a098ced483dd22db7ab354c2e056dbab2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ripple_hpc-1.4.2-cp310-cp310-macosx_10_9_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.

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