Skip to main content

A library for molecular dynamics analysis and RDF calculations

Project description

MagicTools

A Python library for molecular dynamics analysis and Radial Distribution Function (RDF) calculations.

Description

MagicTools provides a comprehensive set of tools for analyzing molecular dynamics simulations, with a focus on:

  • Radial Distribution Functions (RDF): Calculate and analyze pair distribution functions
  • Angular Distribution Functions (ADF): Analyze angular correlations
  • Molecular System Manipulation: Build and modify molecular systems
  • Trajectory Processing: Read and process molecular dynamics trajectories
  • Visualization: Plot distribution functions with customizable settings

Installation

From PyPI

pip install magictools

From source

git clone https://github.com/mposysoev/MagicTools.git
cd magictools
pip install -e .

Requirements

  • Python >= 3.10
  • numpy >= 1.20.0
  • pandas >= 1.3.0
  • matplotlib >= 3.3.0

Optional dependencies

For trajectory reading support:

pip install magictools[trajectory]

Quick Start

Using as a Library

import magictools as mt

# Create a system
system = mt.System()

# Load data and calculate RDF
# ... your code here ...

# Plot results
mt.OnePlot(rdf_data, title="My RDF Analysis")

Using the Command-Line Tool

The package provides a magic-rdf command-line tool for RDF calculations:

magic-rdf -i input.inp

Command-line options:

  • -i <file>: Input file (default: rdf.inp)
  • -np <n>: Run in parallel using n cores
  • --force: Skip trajectory checks
  • --opt_memory_use: Enable memory optimization for large systems
  • --notrim: Disable automatic trimming

Example:

# Run RDF calculation with custom input file
magic-rdf -i my_system.inp

# Run in parallel on 4 cores
magic-rdf -i my_system.inp -np 4

# Run with memory optimization
magic-rdf -i large_system.inp --opt_memory_use

Input File Format

The magic-rdf tool uses MagiC-2 RDF input format. See documentation for detailed format specification.

Example input file:

&PARAMETERS
TRAJECTORY = trajectory.xyz
FORMAT = XYZ
...
&ENDPARAMETERS

Main Classes

  • System: Top-level object representing the entire molecular system
  • MolType: Molecular type definitions and topology
  • Atom, AtomType: Atom representations and atom type definitions
  • Bond, BondType: Bond representations and bond type definitions
  • DF, DFset: Distribution functions and sets of distribution functions
  • Trajectory: Trajectory file handling and processing
  • RDFCalculator: Main calculator for RDF analysis

Main Functions

  • OnePlot(): Plot distribution functions on a single plot
  • MultPlot(): Create multiple plots for distribution function analysis
  • ReadMagic(): Read MagiC format files

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.

Citation

If you use MagicTools in your research, please cite:

TODO: Add citation information

Contact

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

magic_3_tools-0.1.1.tar.gz (93.8 kB view details)

Uploaded Source

Built Distribution

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

magic_3_tools-0.1.1-py3-none-any.whl (101.2 kB view details)

Uploaded Python 3

File details

Details for the file magic_3_tools-0.1.1.tar.gz.

File metadata

  • Download URL: magic_3_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 93.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for magic_3_tools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8a06a88d8f0b921ce723c4d9bdd19e60afc43cd7b4a30a3dc81d7a549fffaab0
MD5 cdd5b75924297d3308531e40bc4b2979
BLAKE2b-256 63b5d460645ca73838825a5f96428df212768bb8bc9fee18272a6098ff02935d

See more details on using hashes here.

File details

Details for the file magic_3_tools-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: magic_3_tools-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 101.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for magic_3_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b09a67a1993cd261941c5ac3d947db380365bd2a9ee309cf4c88781c5fa75c4
MD5 4169970d76fd241f909b943cac26da83
BLAKE2b-256 ff6e42b1fdec482bcad0b03e56e04f18ddbd1feeb5690a6491c76e5f4ffde2f2

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