Home

Awesome

Visit the Github Pages for a nicely formatted HTML page and notebook search functionality.

Introduction

This repo is started by the Materials Virtual Lab as a useful collection of Jupyter notebooks that demonstrate the utilization of open-source codes for the study of materials science.

We frequently get requests (from students, postdocs, collaborators, or just general users) for example codes that demonstrate various capabilities in the open-source software we maintain and contribute to, such as the Materials Project software stack comprising Python Materials Genomics (pymatgen), Custodian, and Fireworks. This repo is a start at building a more sustainable path towards sharing of code examples.

It is not limited to the codes we develop - any use of open source software for materials analysis is welcome. Also, anyone is welcome to contribute.

Running the examples from a browser

                     
2013-01-01-Basic functionalityBinderLaunch CodespaceOpen in Google Colab
2013-01-01-Calculating Reaction Energies with the Materials APIBinderLaunch CodespaceOpen in Google Colab
2013-01-01-Calculating XRD patternsBinderLaunch CodespaceOpen in Google Colab
2013-01-01-Getting crystal structures from online sourcesBinderLaunch CodespaceOpen in Google Colab
2013-01-01-Ordering Disordered StructuresBinderLaunch CodespaceOpen in Google Colab
2013-01-01-Plotting and Analyzing a Phase Diagram using the Materials APIBinderLaunch CodespaceOpen in Google Colab
2013-01-01-Plotting the electronic structure of FeBinderLaunch CodespaceOpen in Google Colab
2016-09-08-Data-driven First Principles Methods for the Study and Design ofBinderLaunch CodespaceOpen in Google Colab
2016-09-08-Data-driven First Principles Methods for the StudyBinderLaunch CodespaceOpen in Google Colab
2016-09-08-Data-driven First Principles Methods for the StudyBinderLaunch CodespaceOpen in Google Colab
2016-09-25-Plotting phonon bandstructure and dosBinderLaunch CodespaceOpen in Google Colab
2017-03-02-Getting data from Materials ProjectBinderLaunch CodespaceOpen in Google Colab
2017-04-03-Slab generation and Wulff shapeBinderLaunch CodespaceOpen in Google Colab
2017-04-14-Inputs and Analysis of VASP runsBinderLaunch CodespaceOpen in Google Colab
2017-05-11-Running Jupyter Notebook on clustersBinderLaunch CodespaceOpen in Google Colab
2017-09-03-Analyze and plot band structuresBinderLaunch CodespaceOpen in Google Colab
2017-12-15-Plotting a Pourbaix DiagramBinderLaunch CodespaceOpen in Google Colab
2018-01-01-ChemEnv - How to automatically identify coordination environments in a structureBinderLaunch CodespaceOpen in Google Colab
2018-03-09-Computing the Reaction Diagram between Two CompoundsBinderLaunch CodespaceOpen in Google Colab
2018-03-14-Plotting COHP from LOBSTERBinderLaunch CodespaceOpen in Google Colab
2018-07-24-Adsorption on solid surfacesBinderLaunch CodespaceOpen in Google Colab
2018-09-25-Structure Prediction using Pymatgen and the Materials APIBinderLaunch CodespaceOpen in Google Colab
2018-11-6-Dopant suggestions using PymatgenBinderLaunch CodespaceOpen in Google Colab
2019-01-04-How to use Boltztrap2 interfaceBinderLaunch CodespaceOpen in Google Colab
2019-01-11-How to plot and evaluate output files from LobsterBinderLaunch CodespaceOpen in Google Colab
2019-03-11-Interface ReactionsBinderLaunch CodespaceOpen in Google Colab
2020-07-15-How to plot a Fermi surfaceBinderLaunch CodespaceOpen in Google Colab
2021-08-26-Magnetic Structure Generation as Input for Initial DFT CalculationsBinderLaunch CodespaceOpen in Google Colab
2021-5-12-Explanation of CorrectionsBinderLaunch CodespaceOpen in Google Colab
2022-07-23 Interactive Crystal Toolkit Structure ViewerBinderLaunch CodespaceOpen in Google Colab
2024-06-27 Charge Density DifferenceBinderLaunch CodespaceOpen in Google Colab

Contributing

  1. Fork this repo and clone.

    git clone git@github.com:<your_github_username>/matgenb
    cd matgenb
    
  2. Write a new notebook in the notebooks folder.

    cd notebooks
    jupyter notebook
    
  3. Notebooks should be well-documented and simple. The idea here is to be pedagogical. A newcomer to the software (with the right materials science background) should be able to follow the logic without too much difficulty. Feel free to add authorship and contact information, as well as works to cite and acknowledge your contributions. In view that scientific codes tend to be continuously being updated, please put in a list of the key pinned dependencies so that other users can install the exact version of software to run the notebook if needed. The best practice is to put a section that provides a commented out pip install command that can be used in Google Colab. For example,

    # Uncomment the subsequent lines in this cell to install dependencies for Google Colab.
    # !pip install pymatgen==2022.2.27
    
  4. Ideally, please update notebooks as needed to use more modern versions of the codes, and you may update the date of the notebook as needed.

  5. Notebooks should be placed in the notebooks folder, and the name should start with the date in YYYY-MM-DD-<intuitive title> format. See existing examples. Remember to add it to the above table too.

  6. In the root folder of the repo, convert the jupyter notebooks to html.

    jupyter nbconvert --to html notebooks/*.ipynb --output-dir docs/_posts
    
  7. Commit and push.

    git add .
    git commit -a -m "Describe your contribution"
    git push
    
  8. Submit a pull request from Github.