Skip to main content

Fast algorithms for MD trajectories

Project description

Rust Simulation Tools

CI/CD PyPI version Python versions

Fast, numerically stable MD trajectory processing implemented in Rust with a clean python API. Installable via pip, integrates smoothly with MDAnalysis or mdtraj, and ships with tests.

Installation

pip install rust-simulation-tools

Features

  • Fast: Rust implementation with SIMD optimizations
  • 🎯 Accurate: Numerically stable Kabsch alignment and fragment-based unwrapping
  • 🧪 Well tested: Comprehensive test suite with >80% coverage
  • 🧩 Easy integration: Works directly with MDAnalysis selections/indices

Usage

import MDAnalysis as mda
from rust_simulation_tools import kabsch_align

# Load trajectory
u = mda.Universe("topology.pdb", "trajectory.dcd")

# Select alignment atoms
align_selection = u.select_atoms("backbone")
align_indices = align_selection.indices

# Get coordinates
reference = u.atoms.positions.copy()
trajectory = np.array([ts.positions for ts in u.trajectory])

# Align
aligned = kabsch_align(trajectory, reference, align_indices)

API Reference

kabsch_align(
    trajectory: np.ndarray,      # float, shape [n_frames, n_atoms, 3]
    reference: np.ndarray,       # float, shape [n_atoms, 3]
    align_idx: np.ndarray        # int,   shape [n_alignment_atoms]
) -> np.ndarray                  # float, shape [n_frames, n_atoms, 3]

unwrap_system(
    trajectory: np.ndarray,      # float, shape [n_frames, n_atoms, 3]
    box_dimensions: np.ndarray,  # float, shape [n_frames, 3]
    fragment_idx: np.ndarray     # int,   shape [n_atoms]
) -> np.ndarray                  # float, shape [n_frames, n_atoms, 3]

Development

# Clone repository
git clone https://github.com/msinclair-py/rust-simulation-tools.git
cd rust-simulation-tools

# Install development dependencies
pip install maturin pytest pytest-cov numpy

# Build and install in development mode
maturin develop --release

# Install with pip
pip install target/wheels/name-of-package.whl

# Run tests
pytest tests/ -v --cov

License

MIT 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

rust_simulation_tools-0.1.7.tar.gz (2.1 MB view details)

Uploaded Source

Built Distributions

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

rust_simulation_tools-0.1.7-cp312-cp312-win_amd64.whl (191.9 kB view details)

Uploaded CPython 3.12Windows x86-64

rust_simulation_tools-0.1.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (306.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.1.7-cp312-cp312-macosx_11_0_arm64.whl (258.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rust_simulation_tools-0.1.7-cp311-cp311-win_amd64.whl (190.2 kB view details)

Uploaded CPython 3.11Windows x86-64

rust_simulation_tools-0.1.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.1.7-cp311-cp311-macosx_11_0_arm64.whl (257.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rust_simulation_tools-0.1.7-cp310-cp310-win_amd64.whl (190.2 kB view details)

Uploaded CPython 3.10Windows x86-64

rust_simulation_tools-0.1.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.1.7-cp310-cp310-macosx_11_0_arm64.whl (257.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

rust_simulation_tools-0.1.7-cp39-cp39-win_amd64.whl (190.4 kB view details)

Uploaded CPython 3.9Windows x86-64

rust_simulation_tools-0.1.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.1.7-cp39-cp39-macosx_11_0_arm64.whl (257.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file rust_simulation_tools-0.1.7.tar.gz.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7.tar.gz
Algorithm Hash digest
SHA256 7fa2d2d30d76fd99a1c8b70e14362acae98894c228f1b26dbc5c77f9f30e33ca
MD5 d30b5223547b36f31a4c9aa403a3582e
BLAKE2b-256 a407abd30f2587893263c7a77f6bc3e2748e7a561f92aeb53d7bc37e27d3682c

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c606b8d80a84d6a5a3965d8dd844bcac6a5eecdfb6186d59bb45c8b0becf6f54
MD5 a8fee74204d4b2c1a36b021ff6d7da4c
BLAKE2b-256 d470fe07b7125600e0fff74fa9b3682695104b505c38ee10d4bff09d474cae27

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8eab37bc840f6bc0ea6d95663d87bc145294910d914db07db483d2e9f65c7d22
MD5 bfca7406a2f646167988fd9902e38240
BLAKE2b-256 68b3a23471f2c0b244464e6148305cc7313b1761baef995b1eacf5aa12db0b02

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1bc4bada92396e744f8904276cd7709d1f850a31ca4ff6d72856a2ce58962362
MD5 5d0adeceafbd32e7788e2c1524014164
BLAKE2b-256 fe97ceae7563b7a6f9457aa55947890ea68897719c55fc667e2b4ebe9b8b5bb3

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 861116be300854dc83459c159c17d80cf443919e7a295eea9dc131c4d416672b
MD5 01514c99a8c2e70341e452a4e15542f2
BLAKE2b-256 399d65c87fb36e4d1a3124106369b1ed4d3f872dfb70e6e9e5ca3b6485e0f8e6

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc754b195138c59bf4e81eb6cbd2de11814c0b13506cbdb6fa7555ddec7f92f7
MD5 1f21190c0bdd706037d2dda1b0f43d8e
BLAKE2b-256 a45e8c4d86aa49de34f4f44930b6f97af85ca888f80e1334ef851ae9ef3023ae

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e0a969844a464d2f1b0eb5148a7c2827eae72ae828308c244e66692298ac00b8
MD5 23f9c363816ebb3d41493a27c5d29e6b
BLAKE2b-256 c01de6fe1feca2b8aebe7ccd56bec1b0a70c431049d28ae7c3e1ad5d307e05ae

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3bfec7b2e65aaf22118253c2d129ec939ddc96eabc2b6ca32bd44b2e97e69b39
MD5 2eae29249cd2ffa51f5a1aff79943eb6
BLAKE2b-256 c5044a1f4d8d6b71d4b9dcac98c32b5b7e25ccc2b1d8685da96b716ae5d703e1

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 784fa4442f355470b1da8b5b9f782f44ab65dd6c80ce987ea9a5e2a414121215
MD5 c7fa65d956c66254d324402516939477
BLAKE2b-256 a5ed8258d776f275ddebd14799a75c166fc3d062141deb9ecfea11f1ddef9cb7

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5b4f6573eee80c204823f54eaff7fd2e512eacd75a51169b817ffb359e8a65d5
MD5 a3975612923bbb09625f98a9d1ec8f27
BLAKE2b-256 f71f088baeccf0d3ffe17ddf92591dc26c10a8d81e71da0f45c895501ab1fc29

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0f7f2781bf2c71fee49f07c34a06b09ae557f1f717b209886040aa6d0b945e8c
MD5 661a715cdd25b755f3496eec5427066c
BLAKE2b-256 ebac5c4faf06f4d24af6b8ace8d2cf89b7be3a6ffd578d082739c9bf5d5ec367

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b447bbbd56c291bdfb8bf3f3cc9d6ee306407894dfff8ebb70064e82fb643918
MD5 ddb9560a3635555095a75add0a58d3bc
BLAKE2b-256 63abb71a398241ef024fc7b2df15cd7ddcd85993c1d588bca62143f8fd33e7dd

See more details on using hashes here.

File details

Details for the file rust_simulation_tools-0.1.7-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.7-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a7ad8d8a750859446c9e548fedcaebc158e6b7b061f6f4abb182f6360865e28
MD5 e2182ac5986583fbcf84e5482ee31fcb
BLAKE2b-256 6e330da1381caeddba56da2b2d91079f5372fa6cec737a9ef04bdc20e4eaf96a

See more details on using hashes here.

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