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.0.tar.gz (93.6 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.0-py3-none-any.whl (101.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: magic_3_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 93.6 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.0.tar.gz
Algorithm Hash digest
SHA256 25d9e6f773e60eef62a451ef44eb14f85da639b17b1ce6b3f246a135a37656b2
MD5 0ac3fe90f16454742ef3f50b25bf90ae
BLAKE2b-256 834f7aac76c2ea397a8f6b428ce45cbca0cd0c7055635ffb50ecffc1fd7e6af1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: magic_3_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 101.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e22fe8bd1d63462bf87d534916d68ca8a6312b989bb3a97411365e6e1109842f
MD5 ac1350f588b20f0db661314c6d190b64
BLAKE2b-256 84582790147bdc6a8cf2eb52e6898abb83c92d1bc92060d1a646cd1a60297eb5

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