Skip to content

runtian97/mwcalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MW Calc

A Python package for Si-N molecular generation, deduplication, reorganization, and optimization.

Installation

# Install OpenBabel via conda
conda install conda-forge::openbabel

pip install torch==2.6.0 --index-url https://download.pytorch.org/whl/cu121  # for CUDA 12.1


# Install the package
git clone https://github.com/runtian97/mwcalc.git
cd mwcalc
pip install .

Usage

Molecular weight referece

mw_dict = {
    'N':   14,
    'NH':  14+1,
    'NH2': 14+1*2,
    'Si':  28,
    'SiH': 28 + 1,
    'SiH2': 28 + 1*2,
    'SiH3': 28 + 1*3
}

Complete Workflow

from mwcalc import MolecularWorkflowPipeline
pipeline = MolecularWorkflowPipeline()
results = pipeline.run_complete_workflow(
    target_mw=472,
    output_dir="molecules",
    model_path="esen_sm_conserving_all.pt",  # Add the model path here
    num_mols_per_combo=2000,
    tolerance=0,
    random_seed=0,
    min_distance_threshold=0.4
)

Step-by-Step

from mwcalc.generation import generate_sin_only_molecules
from mwcalc.processing import remove_duplicates, reorganize_output
from mwcalc.optimization import optimize_folder_xyz

# 1. Generate molecules
generate_sin_only_molecules(
    target_mw=472,
    output_dir="molecules",
    num_mols_per_combo=2000,
    tolerance=0,
    random_seed=0,
    min_distance_threshold=0.4  # NEW: Add superposition check parameter
)

# 2. Remove duplicates  
remove_duplicates("molecules", dry_run=False)

# 3. Reorganize
reorganize_output("molecules")

# 4. Optimize (optional)
optimize_folder_xyz("molecules", "esen_sm_conserving_all.pt", fmax=0.02, steps=500)

Command Line

mwcalc run --target-mw 472 --output-dir molecules --model-path esen_sm_conserving_all.pt --num-mols 2000 --tolerance 0 --random-seed 0 --min-distance 0.4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages