Active Learning framework for atomistic simulations with flexible workflows and HPC submission.
Project description
ALomancy ๐ฎ
Modular Active Learning Workflows for Modern Computational Chemistry
Installation โข Quick Start โข Documentation โข Examples โข Contributing
๐ฏ Overview
ALomnacy is a Python framework for running active learning (AL) workflows for training machine-learned inter-atomic potentials (MLIPs). This package focusses on customization and reproducibility to build robust training datasets and train MLIPs.
Key Features
- ๐ Automated AL Workflows: End-to-end active learning with minimal manual intervention
- ๐ง HPC Integration: Built-in support for remote job submission on HPC clusters
- Parallelization: Ensures that jobs run concurrently where possible
- ๐ Extensible Design: Abstract base classes for easy customization and extension
- ๐ Analysis Tools: Built-in utilities for monitoring and analyzing AL progress
Workflow Overview
graph LR
A[Initial Dataset] --> B[Train MLIP Committee]
B --> C[Generate Structures]
C --> D[Uncertainty Quantification]
D --> E[High-Accuracy Evaluation]
E --> F[Update Dataset]
F --> B
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#e8f5e8
style D fill:#fff3e0
style E fill:#fce4ec
style F fill:#f1f8e9
๐ Installation
From PyPI (Recommended)
pip install alomancy
From Source
git clone https://github.com/yourusername/ALomnacy.git
cd ALomnacy
pip install -e ".[dev]"
Dependencies
- Python 3.9+
- ASE - Atomic Simulation Environment
- WFL - Workflow for atomistic simulations
- Expyre - Remote job execution
โก Quick Start
1. Basic Active Learning Workflow
from alomancy.core import StandardActiveLearningWorkflow
from pathlib import Path
# Initialize workflow
workflow = StandardActiveLearningWorkflow(
initial_train_file_path="train_set.xyz",
initial_test_file_path="test_set.xyz",
config_file_path="config.yaml",
number_of_al_loops=5,
verbose=1
)
# Run the active learning workflow
workflow.run()
2. Configuration File
Create a config.yaml file to specify your computational setup:
mlip_committee:
name: "mace_training"
size_of_committee: 4
epochs: 1000
max_time: "24:00:00"
hpc:
hpc_name: "gpu_cluster"
partitions: ["gpu"]
pre_cmds: ["module load cuda", "source activate mace"]
structure_generation:
name: "md_generation"
number_of_concurrent_jobs: 8
desired_number_of_structures: 100
max_time: "12:00:00"
hpc:
hpc_name: "gpu_cluster"
partitions: ["gpu"]
pre_cmds: ["module load cuda", "source activate mace"]
high_accuracy_evaluation:
name: "dft_evaluation"
max_time: "48:00:00"
hpc:
hpc_name: "cpu_cluster"
partitions: ["cpu"]
pre_cmds: ["module load quantum-espresso"]
node_info:
ranks_per_system: 32
ranks_per_node: 32
threads_per_rank: 1
max_mem_per_node: "128GB"
pwx_path: "/path/to/pw.x"
pp_path: "/path/to/pseudopotentials"
pseudo_dict:
H: "H.pbe-rrkjus_psl.1.0.0.UPF"
O: "O.pbe-n-kjpaw_psl.1.0.0.UPF"
3. Custom Workflow Implementation
Extend the base class for specialized workflows:
from alomancy.core import BaseActiveLearningWorkflow
from ase import Atoms
import pandas as pd
class CustomActiveLearningWorkflow(BaseActiveLearningWorkflow):
def train_mlip(self, base_name: str, mlip_committee_job_dict: dict, **kwargs):
"""Custom MLIP training implementation"""
# Your custom training logic here
return "path/to/trained/model.pt"
def evaluate_mlip(self, mlip_committee_job_dict: dict, **kwargs) -> pd.DataFrame:
"""Custom model evaluation"""
# Your evaluation logic here
return pd.DataFrame({"rmse": [0.1], "mae": [0.05]})
def generate_structures(self, base_name: str, job_dict: dict,
train_data: list[Atoms], **kwargs) -> list[Atoms]:
"""Custom structure generation"""
# Your structure generation logic here
return generated_structures
def high_accuracy_evaluation(self, base_name: str,
high_accuracy_eval_job_dict: dict,
structures: list[Atoms], **kwargs) -> list[Atoms]:
"""Custom high-accuracy evaluation"""
# Your DFT calculation logic here
return evaluated_structures
๐ Examples
Check out the examples/ directory for complete workflow examples:
- Basic Usage: Simple active learning workflow setup
- Custom HPC Configuration: Advanced cluster configuration
- Analysis Scripts: Post-processing and visualization tools
๐๏ธ Project Structure
alomancy/
โโโ analysis/ # Analysis and visualization tools
โโโ configs/ # Configuration management
โโโ core/ # Core active learning framework
โโโ high_accuracy_evaluation/ # DFT calculation modules
โโโ mlip/ # Machine learning potential training
โโโ structure_generation/ # MD and structure generation
โโโ utils/ # Utility functions and helpers
๐ง Key Components
Core Framework
- BaseActiveLearningWorkflow: Abstract base class for AL workflows
- StandardActiveLearningWorkflow: Ready-to-use implementation
MLIP Training
- MACE Integration: Committee training with uncertainty quantification
- Remote Submission: HPC job management for GPU-accelerated training
Structure Generation
- Molecular Dynamics: ASE-based MD simulations with MACE potentials
- Uncertainty Sampling: Intelligent structure selection based on model disagreement
High-Accuracy Evaluation
- Quantum Espresso: Automated DFT calculations for reference data
- Job Management: Parallel submission and monitoring of DFT jobs
๐ Monitoring and Analysis
Monitor your AL progress with built-in analysis tools:
from alomancy.analysis import MACEAnalysis
# Analyze model performance
analyzer = MACEAnalysis("results/")
analyzer.plot_learning_curves()
analyzer.analyze_uncertainty_evolution()
analyzer.generate_report()
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
# Clone the repository
git clone https://github.com/yourusername/ALomnacy.git
cd ALomnacy
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Run linting
ruff check .
ruff format .
Running Tests
# Run all tests
pytest
# Run specific test categories
pytest tests/core_tests/
pytest tests/mlip_train_tests/
pytest tests/high_acc_tests/
# Run with coverage
pytest --cov=alomancy
๐ Citation
If you use ALomnacy in your research, please cite:
@software{alomancy2025,
title={ALomnacy: Modular Active Learning Workflows for Modern Computational Chemistry},
author={Julian Holland},
year={2025},
url={https://github.com/yourusername/ALomnacy},
version={0.1.0}
}
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- The Fritz Haber Institute
๐ Support
- ๐ Documentation: [Link to docs]
- ๐ Bug Reports: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ง Email: holland@fhi.mpg.de
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alomancy-0.1.0.post0.tar.gz.
File metadata
- Download URL: alomancy-0.1.0.post0.tar.gz
- Upload date:
- Size: 70.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f19066cc0bfae3962dfec8de102f6e4a8b56bef78101c036e8128a135696e39
|
|
| MD5 |
20c81d32d06018c32bfbcd2297420a87
|
|
| BLAKE2b-256 |
38a5aaafe7cb1d30fa1feadc516e944dc040fa343ba7456f8b166280f4f8d2bc
|
File details
Details for the file alomancy-0.1.0.post0-py3-none-any.whl.
File metadata
- Download URL: alomancy-0.1.0.post0-py3-none-any.whl
- Upload date:
- Size: 31.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b43f72314b317b884502f5c79ea413c4a33d25764ff5c42534363dd3a82392a4
|
|
| MD5 |
26090d579699768b3580615a4980cea0
|
|
| BLAKE2b-256 |
398483e0784238a25d495ab8cde911a60285fc7f7268167f682fb33fd4b0bd55
|