Giter Club home page Giter Club logo

whygreedy's Introduction

Linear programming for environmental stability of crystals

NOTE: This branch is for the Comment published on Chemistry of Materials (doi: 10.1021/acs.chemmater.2c02434). For code behind the paper on ChemiRxiv, see the ChemRxiv branch.

In a recent paper by Twyman et al. (Chem. Mater. 2022, 34, 2545-2552), the environmental stability of crystals is investigated by determining the most favored oxidation reaction (lowest reaction enthalpy). This is done using a greedy heuristic algorithm.

In whygreedy.ipynb, we demonstrate that the environmental stability problem can be solved exactly using linear programming, which gives solutions always better than or equivalent to the approximations by greedy algorithms.

Usage

The content of both notebooks should be self-explanatory. To reproduce the notebooks:

  1. Clone this repository and add the root folder to $PYTHONPATH$
  2. Create a virtual environment and install dependencies: pip install -r requirements.txt
  3. Start a Jupyter server and run the notebooks.

precomputed results

The *.pkl files in data folder are precomputed results to save computation time in notebooks. To reproduce them:

  1. download materials project as mp.json.gz using pymatgen as described in downloader.py
  2. extract reactions from mp.json.gz using pairs.py
  3. calculate reaction enthalpies with calculate.py, commands can be found in calculate.sh, and results will be saved as *_records_*.pkl.
  4. combine.py combines *_records_*.pkl to mp_oxidation_records.pkl that will be used in notebooks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.