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.4.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.4-cp312-cp312-win_amd64.whl (190.7 kB view details)

Uploaded CPython 3.12Windows x86-64

rust_simulation_tools-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.1.4-cp312-cp312-macosx_11_0_arm64.whl (257.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rust_simulation_tools-0.1.4-cp311-cp311-win_amd64.whl (189.3 kB view details)

Uploaded CPython 3.11Windows x86-64

rust_simulation_tools-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (304.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.1.4-cp311-cp311-macosx_11_0_arm64.whl (256.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rust_simulation_tools-0.1.4-cp310-cp310-win_amd64.whl (189.2 kB view details)

Uploaded CPython 3.10Windows x86-64

rust_simulation_tools-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (304.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.1.4-cp310-cp310-macosx_11_0_arm64.whl (256.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

rust_simulation_tools-0.1.4-cp39-cp39-win_amd64.whl (189.5 kB view details)

Uploaded CPython 3.9Windows x86-64

rust_simulation_tools-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

rust_simulation_tools-0.1.4-cp39-cp39-macosx_11_0_arm64.whl (256.5 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4.tar.gz
Algorithm Hash digest
SHA256 dd478b6536d74cd13ff0a56c57726498a88c8a0bea8393c96909509f3040a315
MD5 ed9956c5c856a3f658bc423b3712165c
BLAKE2b-256 ef202254e6f57596498bcdadace61c464a36ee0a9d3bd42629f77ac820067f1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 740de8c5d3515538448beb036fed6e2abaa4a1ef1c48818a331d2c778194fe16
MD5 9db4c2bffefea0041c734a3569d7d4e4
BLAKE2b-256 1337fa28ef0071143094265e55e6f34f90624cd837bfc818c12286870373ac5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 04b5d03c0f933a7269109a875d03caa2eb2cd73c706c6adf5ab705a5001cfd6b
MD5 c2e28a64228c1563581ee631174d3458
BLAKE2b-256 42682aae337129c9a843b2bc4216994a6bb871ebf9befa60f3a3bdbdea6c526e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a794caf377c29d6ba09c4b9e37f4e28a3c8aa1b70d99f9015c7f8944db7667aa
MD5 56e090b10bce6a2c6b2bc9d3fbb1b6dd
BLAKE2b-256 bdd6a92a2abbd21a12010819b1c61299acbe6a061ca1528a7e04b711a37696e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 dc57aba2ce5e46a449a73261998b4deb068c78d616456ef7cd22751938be5a80
MD5 c6bf272219c35cbdfa506982ae78cc95
BLAKE2b-256 bdd77b121181f67175a06072404c73cd031c2009680128c63a490e81e972326d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca3976d9d4dcaa13e2f20a951f1d33e7ffcad692440a14594dca508a1a467035
MD5 e3feaa5ed8adb7ff254f01bbdd05ac22
BLAKE2b-256 c3282852ba8cd0448893f5b871a05e2634ae020a3b180cdd82f5096eb141b61f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e4c2730bde2b2c7cacc0f5baff32932dde336886b91e338308ba5833bfc76b8
MD5 e9e8a2fa2703821ec2705c326ad7c034
BLAKE2b-256 ad59199efa89a9ba0a8587da9dd911270e676458250891cfe24078b6d89eaadc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c032b1ec9704b320a220ba4438b28d5326606f57ce2368876da3b6af82d014ea
MD5 3bd2dbb427f0a019d638fd9cd3c3509f
BLAKE2b-256 43af78e4c7c19c713434e62f398f168d384738a3f70c85b36f45359a40bd6438

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d89d3f626f7b0fd013bf7008d7b9a20dd466b16c44eddf1be55f847d0e8faf8f
MD5 4e97cdd47ed9577da57a077e7ecd3fa8
BLAKE2b-256 ac8b1e528b579fabc816cdc8e8495d676759bd7c2beb528035acbd6dcd028458

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1eac6da16372704d3bab0689ea46debe414294213adbf5eb32c6181be8fb3795
MD5 ef01605b89d8327d312280e44b4e3a7e
BLAKE2b-256 36069638a54a2e3d5464e51bc253be378010940765b150a5a757b509ccc5f782

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 321afabbf6a63eb7bad6696ed6c788f44ad6c97a80174fc4b9c677953046bf4c
MD5 1548974366576bfd5a8859360ee097cb
BLAKE2b-256 a1d227a279f7b570f088b08acef1cd67984c4fa844c2ca0fa8393459f73417ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d0b19b229d0c68ea90533efa1fb4da41d424e4f5b8beb0ebcbb614eb4d351dcb
MD5 12604af8f12894d6b8e51a8ff9f37fa6
BLAKE2b-256 d4ffb007b526d61b814cf8f8a70f92670ff9f21c0f4a61e5eaae83283cfec5af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_simulation_tools-0.1.4-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f0b26e61758d94a1118803db5da0248485d2e748977766279e773ee9c068dd08
MD5 4ff0eedd7d796e79650ac94c7151662d
BLAKE2b-256 4a2dd87c9bbe8bdbac48f8362b9eaf846e095128d3e494add256942ccef67742

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