Skip to main content

Chemeleon framework for De Novo Generation (DNG) and Crystal Structure Prediction (CSP) tasks

Project description

Chemeleon-DNG: Chemeleon for De Novo Generation

While Chemeleon GitHub repository focuses on text-guided crystal structure generation, this repository provides a framework for De Novo Generation (DNG) and Crystal Structure Prediction (CSP) tasks.

  • CSP (Crystal Structure Prediction): Predicts stable crystal structures from given atom types
  • DNG (De Novo Generation): Generates new crystal structures from scratch

Installation

Prerequisites

  • Python 3.9+
  • PyTorch >= 2.1.0
  • CUDA (optional, for GPU acceleration)

Install the Package

git clone https://github.com/hspark1212/chemeleon-dng.git
cd chemeleon-dng

# Install dependencies
uv sync

Quick Start

Crystal Structure Prediction (CSP)

Generate crystal structures for given chemical formulas:

from chemeleon_dng.sample import sample

sample(
    task="csp",
    formulas=["NaCl", "LiMnO2"],
    num_samples=10,
    output_dir="results",
    device="cpu"
)

[!TIP] Invoke help(sample) to explore all available parameters and usage examples.

For the command line interface, you can use the following command:

python -m chemeleon_dng.sample --task=csp --formulas="NaCl,LiMnO2" --num_samples=10 --output_dir="results" --device=cpu

This command generates 10 crystal structures for the given formulas using the CSP task and saves the CIF files of the generated structures in the results/ directory using CPU.

De Novo Generation (DNG)

Generate novel crystal structures without predefined compositions:

from chemeleon_dng.sample import sample

sample(
    task="dng",
    num_samples=200,
    batch_size=100,
    output_dir="results",
    device="cuda"
)

For the command line interface, you can use the following command:

python -m chemeleon_dng.sample --task=dng --num_samples=200 --batch_size=100 --output_dir="results" --device=cuda

This command generates 200 random crystal structures using the DNG task with two batches of 100 each, and saves the generated structures in the results/ directory using GPU.

Pretrained Models

When you execute scripts/sample.py, it will automatically download the pretrained models from the figshare repository and save them in the ckpts/ directory (if not already present). The pretrained models were trained on mp-20 and alex_mp_20 datasets.

The framework includes pretrained checkpoints located in the ckpts/ directory:

  • chemeleon_csp_alex_mp_20_v0.0.2.ckpt
  • chemeleon_dng_alex_mp_20_v0.0.2.ckpt
  • chemeleon_csp_mp_20_v0.0.2.ckpt
  • chemeleon_dng_mp_20_v0.0.2.ckpt

Benchmarks

For benchmarking purposes, we provide 10,000 sampled structures for the DNG task trained on mp-20 and alex_mp_20 datasets in the benchmarks/ directory. The sampled structures are saved in CIF format and compressed JSON format.

Citation

If you find our work helpful, please cite the following publication:

"Exploration of crystal chemical space using text-guided generative artificial intelligence" Nature Communications (2025)
DOI: 10.1038/s41467-025-59636-y

@article{park2025exploration,
  title={Exploration of crystal chemical space using text-guided generative artificial intelligence},
  author={Park, Hyunsoo and Onwuli, Anthony and Walsh, Aron},
  journal={Nature Communications},
  volume={16},
  number={1},
  pages={1--14},
  year={2025},
  publisher={Nature Publishing Group}
}

License

This project is licensed under the MIT License, developed by Hyunsoo Park as part of the Materials Design Group at Imperial College London.
See the LICENSE file for more details.

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

chemeleon_dng-0.1.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

chemeleon_dng-0.1.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chemeleon_dng-0.1.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for chemeleon_dng-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1f15b94eb2d03ac0d502e92d016ddfb8050c65274cdc9a91fe517f9735000ba6
MD5 a05404a783ca075b259a3ddfe01be312
BLAKE2b-256 5306797a9ae803d00f2f97dcf44b85033b3d9d65f8beda06f72932c2ec17e503

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chemeleon_dng-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for chemeleon_dng-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b3ef7ba0783c2abba94d44d9aebf272d4544a3a52c8421572daa5da06bd14e3
MD5 693f431f31541d6b7a29f79ed9271b39
BLAKE2b-256 b8122236388552e604b528367f3679afe7d60f8c708b0a324660842d2deeef9c

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