casting

A Continuous Action Space Tree search for INverse desiGn (CASTING)

https://github.com/sbanik2/casting

Science Score: 41.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 8 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.2%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

A Continuous Action Space Tree search for INverse desiGn (CASTING)

Basic Info
Statistics
  • Stars: 13
  • Watchers: 2
  • Forks: 5
  • Open Issues: 0
  • Releases: 4
Created over 3 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation

README.md

colab Release License Commit Size Downloads Doi

CASTING

A Continuous Action Space Tree search for INverse desiGn (CASTING) Framework and Materials Discovery

Table of Contents

Introduction

A pseudocode implementation of CASTING framework (Paper) for optimization of atomic nanoclusters only. This code uses MCTS (Monte Carlo Tree Search) as base optimizer.

    Fast and accurate prediction of optimal crystal structure, topology, and microstructures is important for accelerating the design and discovery of new materials. Material properties are strongly correlated to the underlying structure and topology – inverse design is emerging as a powerful tool to discover new and increasingly complex materials that meet targeted functionalities. CASTING provides a unified framework for fast, scalable and accurate prediction & design of materials.

(back to top)

Prerequisites

This package requires: - scipy - LAMMPS - pymatgen - pandas - numpy - networkx - ase

(back to top)

Installation

Manual Installation

Install the anaconda package. Then, conda env create --name CASTING conda activate CASTING git clone https://github.com/sbanik2/CASTING.git pip install -r requirements.txt python setup.py install

Installation with pypi

``` pip install CASTING

``` ***The package requires python lammps binding to run. First, lammps package needs to be downloaded from LAMMPS download and compiled. The instructions on python integration can be found here LAMMPS-Python.

(back to top)

Running the code

First, all the parameters crystal (constrains), LAMMPS parameters (pair style, pair coefficient etc.) and the perturbation parameter need to be set. The composition is given for e.g., a Au<2>Al<3> as "composition":{"Au":2,"Al:3"}. In a file (for e.g., RunOpt.py) we define,

``` python from CASTING.utilis import rdatafame,getlattice from CASTING.MCTS import MCTS from CASTING.clusterfun import createRandomData from CASTING.lammpsEvaluate import LammpsEvaluator from CASTING.perturb import perturbate

In[6]:

import random import numpy as np

seed = 12

random.seed(seed) np.random.seed(seed)

In[9]:

rmin = {"Au-Au":2} # minimum allowed interatomic distance rmax = {"Au-Au":4} # maximum allowed interatomic distance box_dim = 50 # box dimension

--------crystal constrains-----------

constrains = { "composition":{"Au":1}, "atoms":13, "rmin":rdatafame(rmin), "rmax":rdatafame(rmax), "lattice":getlattice(boxdim),
}

-------------perturbation------------

pt = { 'max_mutation': 0.05, # mutation in fraction of box length }

-----------------lammps parameters-------------------

lammpspar = { 'constrains':constrains, 'pairstyle': "pairstyle eam", 'paircoeff': "pair_coeff * * Au.eam" # Provide full path of potential file here }

```

Once the parameters are set, the evaluator (LAMMPS calculator) & the perturbator is to be initialized and a structure for root node is created.

``` python

rootdata = createRandomData(constrains,multiplier= 10)

perturb = perturbate(pt). perturb evaluator = LammpsEvaluator(lammps_par).evaluate

```

Finally, Call MCTS with all the hyperparameters added. Details of individual hyperparameters for the optimizer can be found here Paper.

``` python

MCTS( rootdata, perturb , evaluator, niterations=2000, headexpand=10, nexpand=3, nsimulate=3, nplayouts=10, exploreconstant=1, maxdepth=12, a=0, selected_node=0, )

```

Run the code

python RunOpt.py

The optimization produces a "dumpfile.dat" output containing all the crystal parameters and the energy values as the output. To extract the structures in either 'poscar' or 'cif' format, one can use the 'StructureWriter' module.

``` python

from CASTING.writer import StructureWriter

numtowrite = 10 # number of stuctures to extract writer = StructureWriter( "dumpfile.dat", outpath="structures", objfile="energy.dat", fileformat="poscar" # "poscar" or "cif" ) writer.write( numto_write, sort=True) # sort to arrange in increasing order of energy

``` This will extract 'numtowrite' number of structures in ascending order of objective.

(back to top)

Optimization of Gold nanocluster

An example optimization of Gold (Au) nanocluster is given in "example" directory. We have used CASTING to optimize the already known global minima (Sutton-Chen) of 13 atom Au nanocluster (Icosahedral structure). Details on additional examples can be found in Paper.

(back to top)

Launch in Colab

An example optimization of a Gold (Au) - Sutton-Chen nanocluster in the form of a Jupyter notebook that does not require LAMMPS Python binding has been provided in the notebooks directory. This can be launched in Google Colab using the link.

Carbon metastable polymorphs

We have also used CASTING to sample metastable polymorphs of Carbon(C). All the structures are then further relaxed with DFT. The unique polymorphs and their corresponding DFT energies have been provided in “C_polymorphs” directory.

(back to top)

Citation

``` @article{banik2023continuous, title={A continuous action space tree search for INverse desiGn (CASTING) framework for materials discovery}, author={Banik, Suvo and Loefller, Troy and Manna, Sukriti and Chan, Henry and Srinivasan, Srilok and Darancet, Pierre and Hexemer, Alexander and Sankaranarayanan, Subramanian KRS}, journal={npj Computational Materials}, volume={9}, number={1}, pages={1--16}, year={2023}, publisher={Nature Publishing Group} }

```

(back to top)

License

CASTING is distributed under MIT License. See LICENSE for details.

(back to top)

Owner

  • Name: Suvo Banik
  • Login: sbanik2
  • Kind: user
  • Location: Chicago
  • Company: University of Illinois at Chicago

Ph.D. Student | Computational Material Science | Machine Learning | Coding enthusiast!

Citation (citations.bib)

@article{banik2023continuous,
  title={A continuous action space tree search for INverse desiGn (CASTING) framework for materials discovery},
  author={Banik, Suvo and Loefller, Troy and Manna, Sukriti and Chan, Henry and Srinivasan, Srilok and Darancet, Pierre and Hexemer, Alexander and Sankaranarayanan, Subramanian KRS},
  journal={npj Computational Materials},
  volume={9},
  number={1},
  pages={1--16},
  year={2023},
  publisher={Nature Publishing Group}
}

GitHub Events

Total
  • Watch event: 3
  • Fork event: 1
Last Year
  • Watch event: 3
  • Fork event: 1

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 89
  • Total Committers: 1
  • Avg Commits per committer: 89.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Suvo Banik s****2@u****u 89
Committer Domains (Top 20 + Academic)
uic.edu: 1

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 47 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
pypi.org: casting

A continuous action space tree search for inverse design (CASTING)

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 47 Last month
Rankings
Dependent packages count: 6.6%
Forks count: 19.6%
Average: 23.2%
Stargazers count: 25.5%
Dependent repos count: 30.6%
Downloads: 33.7%
Maintainers (1)
Last synced: 11 months ago