Skip to content

hkevin01/NanoSimLab

Repository files navigation

NanoSimLab

CI Documentation Status PyPI version Python 3.10+ License: MIT

Lightweight, extensible Brownian dynamics toolkit for nanoparticles and proto-nanorobotics

NanoSimLab provides accessible tools for simulating and analyzing nanoparticle systems using Brownian dynamics, with a focus on nanorobotics research and development. The toolkit runs out-of-the-box with NumPy/SciPy and offers seamless integration with popular computational chemistry and materials science libraries.

πŸš€ Key Features

  • πŸ”¬ Brownian Dynamics Simulations: Overdamped Langevin integration in 2D/3D with periodic boundary conditions
  • βš—οΈ Multiple Pair Potentials: Lennard-Jones, Yukawa/screened Coulomb, with extensible framework
  • πŸ“Š Built-in Analysis: Mean-squared displacement (MSD), radial distribution function (RDF), diffusion coefficients
  • πŸ–₯️ Simple CLI: User-friendly command-line interface for non-programmers
  • πŸ”§ Extensible Architecture: Optional integrations with HOOMD-blue, OpenMM, ASE, MDAnalysis, and more
  • πŸ€– Nanorobotics Focus: Designed for proto-nanobot behavior and collective particle control

πŸ“¦ Installation

Quick Install (Recommended)

pip install nanosimlab

Development Install

git clone https://github.com/hkevin01/NanoSimLab.git
cd NanoSimLab
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e ".[dev,analysis,viz]"

Optional Dependencies

# For advanced analysis and visualization
pip install "nanosimlab[analysis,viz]"

# For molecular simulation integration  
pip install "nanosimlab[molsim,builder]"

# For development
pip install "nanosimlab[dev]"

πŸƒβ€β™‚οΈ Quick Start

Command Line Interface

Run a simple nanoparticle simulation:

# Simulate 200 Lennard-Jones particles
nanosim simulate --n 200 --box 20 --steps 20000 --dt 1e-4 --temp 1.0 \
                 --potential lj --epsilon 1.0 --sigma 1.0 --rcut 2.5 \
                 --out trajectory.npz

# Analyze the results
nanosim analyze --traj trajectory.npz --rdf --msd --diffusion

Python API

import numpy as np
from nanosimlab.system import BDSimulation
from nanosimlab.potentials import LennardJones
from nanosimlab.analysis import msd, rdf

# Create simulation
sim = BDSimulation(
    n=200,                    # Number of particles
    box=20.0,                # Periodic box size
    dim=3,                   # 3D simulation
    temperature=1.0,         # Reduced temperature
    potential=LennardJones(epsilon=1.0, sigma=1.0, rcut=2.5)
)

# Run simulation
trajectory = sim.run(steps=10000, dt=1e-4, save_every=100)

# Analyze results
times, msd_values = msd(trajectory["positions"], trajectory["times"])
r, g_r = rdf(trajectory["positions"], box=trajectory["box"])

# Save results
np.savez("results.npz", 
         positions=trajectory["positions"],
         times=times, msd=msd_values, 
         r=r, rdf=g_r)

🎯 Use Cases

Nanoparticle Self-Assembly

from nanosimlab.potentials import Yukawa

# Simulate charged nanoparticles with screening
sim = BDSimulation(n=100, potential=Yukawa(A=5.0, kappa=1.0))
trajectory = sim.run(steps=50000, dt=5e-5)

Drug Delivery Simulation

# Model drug-carrier nanoparticles in biological medium
sim = BDSimulation(
    n=50, box=15.0, temperature=310/300,  # Body temperature
    potential=LennardJones(epsilon=0.5, sigma=2.0)  # Biocompatible particles
)

Micro-swimmer Collective Behavior

# Simulate active particles with propulsion (future feature)
# sim.add_external_field(PropulsionField(strength=2.0, direction="random"))

πŸ“š Documentation

πŸ”§ Project Structure

NanoSimLab/
β”œβ”€β”€ src/nanosimlab/          # Core package source code
β”‚   β”œβ”€β”€ __init__.py          # Package initialization
β”‚   β”œβ”€β”€ potentials.py        # Pair potential implementations
β”‚   β”œβ”€β”€ integrators.py       # Numerical integration schemes
β”‚   β”œβ”€β”€ system.py            # Main simulation engine
β”‚   β”œβ”€β”€ analysis.py          # Trajectory analysis tools
β”‚   └── cli.py               # Command-line interface
β”œβ”€β”€ tests/                   # Unit and integration tests
β”œβ”€β”€ docs/                    # Documentation source files
β”œβ”€β”€ scripts/                 # Utility scripts
β”œβ”€β”€ data/                    # Example datasets
β”œβ”€β”€ assets/                  # Images and media files
└── pyproject.toml           # Project configuration

πŸ› οΈ Development Roadmap

Current Status (v0.1.0)

  • βœ… Core Brownian dynamics engine
  • βœ… Basic pair potentials (LJ, Yukawa)
  • βœ… MSD and RDF analysis
  • βœ… Command-line interface

Upcoming Features (v0.2.0)

  • πŸ”„ HOOMD-blue GPU backend
  • πŸ”„ Advanced visualization with NGLView
  • πŸ”„ External field support (E/M fields, flow)
  • πŸ”„ Jupyter notebook tutorials

Future Vision (v1.0.0)

  • πŸ“‹ Machine learning integration
  • πŸ“‹ Nanorobot control algorithms
  • πŸ“‹ Multi-scale modeling capabilities
  • πŸ“‹ Commercial simulation package integration

🀝 Contributing

We welcome contributions from the research community! See our Contributing Guide for details on:

  • Setting up development environment
  • Code style and testing requirements
  • Submitting pull requests
  • Reporting bugs and feature requests

πŸ“– Citation

If you use NanoSimLab in your research, please cite:

@software{nanosimlab2025,
  title={NanoSimLab: Brownian Dynamics Toolkit for Nanoparticles and Nanorobotics},
  author={Kevin},
  year={2025},
  url={https://github.com/hkevin01/NanoSimLab},
  version={0.1.0}
}

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Inspired by computational tools in the nanorobotics and materials science communities
  • Built on the robust NumPy/SciPy scientific Python ecosystem
  • Designed to complement existing molecular simulation frameworks

πŸ“ž Support


NanoSimLab: Bridging the gap between nanorobotics theory and simulation practice πŸ”¬πŸ€–

About

Lightweight, extensible Brownian dynamics toolkit for nanoparticles and proto-nanorobotics NanoSimLab provides accessible tools for simulating and analyzing nanoparticle systems using Brownian dynamics, with a focus on nanorobotics research and development. The toolkit runs out-of-the-box with NumPy/SciPy and offers seamless integration.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors