PyChemia, Python Framework for Materials Discovery and Design

Overview

Build Status PyPI version Coverage Status Documentation Status HitCount

PyChemia, Python Framework for Materials Discovery and Design

PyChemia

PyChemia is an open-source Python Library for materials structural search. The purpose of the initiative is to create a method agnostic framework for materials discovery and design using a variety of methods from Minima Hoping to Soft-computing based methods. PyChemia is also a library for data-mining, using several methods to discover interesting candidates among the materials already processed.

The core of the library is the Structure python class, it is able to describe periodic and non-periodic structures. As the focus of this library is structural search the class defines extensive capabilities to modify atomic structures.

The library includes capability to read and write in several ab-initio codes. At the level of DFT, PyChemia support VASP, ABINIT and Octopus. At Tight-binding level development is in process to support DFTB+ and Fireball. This allows the library to compute electronic-structure properties using state-of-the-art ab-initio software packages and extract properties from those calculations.

Installation

You can install pychemia in several ways. We are showing 3 ways of installing PyChemia inside a Virtual environment. A virtual environment is a good way of isolating software packages from the pacakges installed with the Operating System. The decision on which method to use depends if you want to use the most recent code or the package uploaded from time to time to PyPi. The last method is particularly suited for developers who want to change the code and get those changes operative without an explicit instalation.

Installing with pip from pypi.org on a virtual environment

This method installs PyChemia from the packages uploaded to PyPi every month. It will provides a version of PyChemia that is stable.

First, create and activate the virtual environment. We are using the name pychemia_ve, but that is arbitrary.

virtualenv pychemia_ve
source pychemia_ve/bin/activate

When the virtual environment is activated, your prompt changes to (pychemia_ve)...$. Now, install pychemia with pip

python3 -m pip install pychemia

Installing with pip from a cloned repo on a virtual environment

This method installs PyChemia from the Github repo. The method will install PyChemia from the most recent sources.

First, create and activate the virtual environment. We are using the name pychemia_ve, but that is arbitrary.

virtualenv pychemia_ve
source pychemia_ve/bin/activate

Second, clone the repository from GitHub

git clone https://github.com/MaterialsDiscovery/PyChemia.git

Finally, install from the repo folder

python3 -m pip install PyChemia

Using PyChemia from repo folder on a virtual environment

This method is mostly used for development. In this way PyChemia is not actually installed and changes to the code will take inmediate effect.

First, create and activate the virtual environment. We are using the name pychemia_ve, but that is arbitrary.

virtualenv pychemia_ve
source pychemia_ve/bin/activate

Clone the repository

git clone https://github.com/MaterialsDiscovery/PyChemia.git

Go to repo folder, install Cython with pip and execute setup.py to build the Cython modules.

cd PyChemia
python3 -m pip install Cython
python3 setup.py build_ext --inplace
python3 setup.py build

Finally, install the packages required for PyChemia to work

python3 -m pip install -r requirements.txt

Set the variable $PYTHONPATH to point to PyChemia folder, in the case of bash it will be:

export PYTHONPATH=`path`

On C shell (csh or tcsh)

setenv PYTHONPATH `path`

PyChemia requirements

PyChemia relies on a number of other python packages to operate. Some of them are mandatory and they must be installed. Other packages are optional and their absence will only constrain certain capabilities.

Mandatory

  1. Python >= 3.6 The library is tested on Travis for Python 3.6 up to 3.9 Support for Python 2.7 has been removed

    https://travis-ci.org/MaterialsDiscovery/PyChemia

  2. Numpy >= 1.19 Fundamental library for numerical intensive computation in Python. Numpy arrays are essential for efficient array manipulation.

  3. SciPy >= 1.5 Used mostly for Linear Algebra, FFT and spatial routines.

  4. Spglib >= 1.9 Used to determine symmetry groups for periodic structures

  5. Matplotlib >= 3.3 Used to plot band structures, densities of states and other 2D plots

  6. PyMongo >= 3.11 Used for structural search PyChemia relies strongly in MongoDB and its python driver. For the MongoDB server, any version beyond 3.11 should be fine. We have tested pychemia on MongoDB 4.0

  7. psutil >= 5.8 Cross-platform lib for process and system monitoring in Python

Optional

  1. nose >= 1.3.7 A python library for testing, simply go to the source directory and execute

    nosetests -v

  2. pytest Another utility for testing.

  3. Pandas Library for Data Analysis used by the datamining modules

  4. PyMC PyMC is a python module that implements Bayesian statistical models and fitting algorithms Important for the datamining capabilities of PyChemia

  5. Mayavi >= 4.1 Some basic visualization tools are incorporated using this library

  6. ScientificPython >2.6 This library is used for reading and writing NetCDF files

  7. pymatgen >= 2.9 pymatgen is an excellent library for materials analysis

  8. ASE Atomic Simulation Environment is another good library for ab-initio calculations. Quite impressive for the number of ab-initio packages supported

  9. qmpy The Python library behind the Open Quantum Materials Database. The OQMD is a database of DFT calculated structures. For the time being the database contains more than 300000 structures, with more than 90% of them with the electronic ground-state computed.

  10. coverage >= 4.0.1 Provides code coverage analysis

  11. python-coveralls To submit coverage information to coveralls.io

    https://coveralls.io/github/MaterialsDiscovery/PyChemia

Documentation

Instructions for installation, using and programming scripts with PyChemia can be found on two repositories for documentation:

Documentation is hosted on Read the Docs also available with Short URLs readthedocs and rtfd

Documentation is also hosted on Python Hosted

Sources

The main repository is on GitHub

Sources and wheel binaries are also distrubuted on PyPI or PyPI

Structure of the Library

PyChemia

PyChemia

Contributors

  1. Prof. Aldo H. Romero [West Virginia University] (Project Director)

  2. Guillermo Avendaño-Franco [West Virginia University] (Basic Infrastructure)

  3. Adam Payne [West Virginia University] (Bug fixes (Populations, Relaxators, and KPoints) )

  4. Irais Valencia Jaime [West Virginia University] (Simulation and testing)

  5. Sobhit Singh [West Virginia University] (Data-mining)

  6. Francisco Muñoz [Universidad de Chile] (PyPROCAR)

  7. Wilfredo Ibarra Hernandez [West Virginia University] (Interface with MAISE)

Comments
  • conda-forge package

    conda-forge package

    Hi,

    I recently create the pychemia conda forge package, now it is possible to install PyChemia via:

    conda install -c conda-forge pychemia
    

    I was wondering if one of the core developers is interested in joining me in maintaining the package.

    Best,

    Jan

    opened by jan-janssen 2
  • Installaltion problem

    Installaltion problem

    Dear Developers,

    I am trying to install pychemia by

    pip3 install pychemia --user

    But it fails with following errors. Any help is appreciated.

    ERROR: Complete output from command python setup.py egg_info: ERROR: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-rd5hvw21/pychemia/setup.py", line 141, in data = write_version_py() File "/tmp/pip-install-rd5hvw21/pychemia/setup.py", line 89, in write_version_py release_data, FULLVERSION, GIT_REVISION = get_version_info() File "/tmp/pip-install-rd5hvw21/pychemia/setup.py", line 47, in get_version_info rf = open('setup.json') FileNotFoundError: [Errno 2] No such file or directory: 'setup.json' Using Cython: True ---------------------------------------- ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-rd5hvw21/pychemia/

    Thanks,

    Best \Alex

    opened by akentphonon 1
  • Removed pyximport from lennardjones since it only works if cython is installed.

    Removed pyximport from lennardjones since it only works if cython is installed.

    Dear Guillermo,

    Since setup.py already compiles the shared library required for lennardjones utilities for both cython and non-cython, this is unnecessary. It would be useful in the case that the shared library is not compiled and the import from the .pyx file needed to be imported directly without any compilation whatsoever.

    With the current setup.py, keeping the .pyx and .c in the distribution package will make sure it will work when both cython is present and not present.

    Best, Uthpala

    opened by uthpalaherath 0
  • Fixed lennardjones error that arises when installing with pip

    Fixed lennardjones error that arises when installing with pip

    Hello Guillermo,

    I added the lines: import pyximport pyximport.install()

    to init.py and lj.py in pychemia/code/lennardjones to fix an import error that occurs when installing PyChemia with pip.

    Best, Uthpala

    opened by uthpalaherath 0
  • Created VaspXML object as a CodeOutput object, fixed a bug in reading…

    Created VaspXML object as a CodeOutput object, fixed a bug in reading…

    … outcar, added writing to text and returning dict to DensityOfStates object

    1. Created VaspXML object as a CodeOutput object. a lot of features was added such as total,projcted and parametric density of states.
    2. fixed a bug in reading outcar energies
    3. added writing to text and returning dict to DensityOfStates object
    opened by petavazohi 0
  • Conserve repeating order of atoms in POSCAR -update

    Conserve repeating order of atoms in POSCAR -update

    This update allows the repeating order in atoms in POSCAR to be conserved.

    For example:

    Sr V O 1.0 3.8465199999999999 0.0000000000000000 0.0000000000000000 0.0000000000000000 3.8465199999999999 0.0000000000000000 0.0000000000000000 0.0000000000000000 3.8465199999999999 Sr V Sr O 1 1 1 3 Direct 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.0000000000000000 0.5000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.0000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000

    Here the order Sr, V, Sr, O will be conserved when using the structure to generate POTCARs and POSCARs for kgrid, encut convergence and relaxation with PyChemia. Otherwise, it reverts to Sr, V, O ignoring the order of the repetition.

    This is helpful for performing calculations for heterostructures where atoms in layers are ordered separately. The order of the POTCAR concatenation will follow this too.

    -Uthpala

    opened by uthpalaherath 0
  • Conserve repeating order of atoms in POSCAR

    Conserve repeating order of atoms in POSCAR

    This update allows the repeating order in atoms in POSCAR to be conserved.

    For example:

    Sr V O 1.0 3.8465199999999999 0.0000000000000000 0.0000000000000000 0.0000000000000000 3.8465199999999999 0.0000000000000000 0.0000000000000000 0.0000000000000000 3.8465199999999999 Sr V Sr O 1 1 1 3 Direct 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.0000000000000000 0.5000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000 0.5000000000000000 0.0000000000000000 0.0000000000000000 0.5000000000000000 0.5000000000000000

    Here the order Sr, V, Sr, O will be conserved when using the structure to generate POTCARs and POSCARs for kgrid, encut convergence and relaxation with PyChemia. Otherwise, it reverts to Sr, V, O ignoring the order of the repetition.

    This is helpful for performing calculations for heterostructures where atoms in layers are ordered separately. The order of the POTCAR concatenation will follow this too.

    -Uthpala

    opened by uthpalaherath 0
  • free energy atom are changed to free energy per atom for convergence

    free energy atom are changed to free energy per atom for convergence

    changed the free energy in the convergence to free energy per atom. Also fixed the bug with kpoint converges best kpoint grid. previously it was taking the last calculated kgrid as the best kgrid.

    chaged La and Ac group to 'd' in pychemia/utils/periodic as they don't have f electrons. I hope I'm write

    opened by petavazohi 0
  • tutorial/example for

    tutorial/example for "predict next experiment"

    Be it composition- or structure-based, could you point to a place in the docs or provide an example that follows the general idea of:

    from pychemia import Discover()
    mdl = Discover()
    mdl.fit(X_train)
    next_experiment = mdl.suggest_next_experiment()
    

    I'm hoping to be able to compare PyChemia with mat_discover.

    opened by sgbaird 2
  • updated relax.py to keep EDIFF provided by user and only use 1E-04 if not provided

    updated relax.py to keep EDIFF provided by user and only use 1E-04 if not provided

    Hello Guillermo,

    In some of my structural relaxation I wanted to keep a lower EDIFF value so I added this in relax.py to use the EDIFF provided by the user in the INCAR. If not provided it will use the default value of EDIFF=1E-04.

    I simply changed:

         # How to change EDIFF
            if vj.input_variables["EDIFF"] > -0.01 * vj.input_variables["EDIFFG"]:
                vj.input_variables["EDIFF"] = round_small(
                    -0.01 * vj.input_variables["EDIFFG"]
                )
            else:
                    vj.input_variables["EDIFF"] = 1e-4
    

    to

            # How to change EDIFF
            if vj.input_variables["EDIFF"] > -0.01 * vj.input_variables["EDIFFG"]:
                vj.input_variables["EDIFF"] = round_small(
                    -0.01 * vj.input_variables["EDIFFG"]
                )
            else:
                if self.extra_vars["EDIFF"]:
                    vj.input_variables["EDIFF"] = self.extra_vars["EDIFF"]
                else:
                    vj.input_variables["EDIFF"] = 1e-4
    

    If you think it's something that is useful please merge it and add it to pip.

    Thank you,

    Best, Uthpala

    opened by uthpalaherath 7
  • new branch

    new branch

    Hi, I am haidi. I feel the code framework of pychemia is the best one among all CSP software i know. But more thing need to be done to make it user friendly and high effiency. I have add some code into it , would you please open a devel branch for developing ?

    opened by haidi-ustc 2
Owner
Materials Discovery Group
Materials Discovery
Materials Discovery Group
Multiple Pairwise Comparisons (Post Hoc) Tests in Python

scikit-posthocs is a Python package that provides post hoc tests for pairwise multiple comparisons that are usually performed in statistical data anal

Maksim Terpilowski 264 Dec 30, 2022
Desafio 1 ~ Bantotal

Challenge 01 | Bantotal Please read the instructions for the challenge by selecting your preferred language below: Español Português License Copyright

Maratona Behind the Code 44 Sep 28, 2022
Python Practicum - prepare for your Data Science interview or get a refresher.

Python-Practicum Python Practicum - prepare for your Data Science interview or get a refresher. Data Data visualization using data on births from the

Jovan Trajceski 1 Jul 27, 2021
This repo contains a simple but effective tool made using python which can be used for quality control in statistical approach.

This repo contains a powerful tool made using python which is used to visualize, analyse and finally assess the quality of the product depending upon the given observations

SasiVatsal 8 Oct 18, 2022
statDistros is a Python library for dealing with various statistical distributions

StatisticalDistributions statDistros statDistros is a Python library for dealing with various statistical distributions. Now it provides various stati

1 Oct 03, 2021
Bigdata Simulation Library Of Dream By Sandman Books

BIGDATA SIMULATION LIBRARY OF DREAM BY SANDMAN BOOKS ================= Solution Architecture Description In the realm of Dreaming, its ruler SANDMAN,

Maycon Cypriano 3 Jun 30, 2022
A Streamlit web-app for a data-science project that aims to evaluate if the answer to a question is helpful.

How useful is the aswer? A Streamlit web-app for a data-science project that aims to evaluate if the answer to a question is helpful. If you want to l

1 Dec 17, 2021
Projeto para realizar o RPA Challenge . Utilizando Python e as bibliotecas Selenium e Pandas.

RPA Challenge in Python Projeto para realizar o RPA Challenge (www.rpachallenge.com), utilizando Python. O objetivo deste desafio é criar um fluxo de

Henrique A. Lourenço 1 Apr 12, 2022
Instant search for and access to many datasets in Pyspark.

SparkDataset Provides instant access to many datasets right from Pyspark (in Spark DataFrame structure). Drop a star if you like the project. 😃 Motiv

Souvik Pratiher 31 Dec 16, 2022
Retail-Sim is python package to easily create synthetic dataset of retaile store.

Retailer's Sale Data Simulation Retail-Sim is python package to easily create synthetic dataset of retaile store. Simulation Model Simulator consists

Corca AI 7 Sep 30, 2022
CPSPEC is an astrophysical data reduction software for timing

CPSPEC manual Introduction CPSPEC is an astrophysical data reduction software for timing. Various timing properties, such as power spectra and cross s

Tenyo Kawamura 1 Oct 20, 2021
HyperSpy is an open source Python library for the interactive analysis of multidimensional datasets

HyperSpy is an open source Python library for the interactive analysis of multidimensional datasets that can be described as multidimensional arrays o

HyperSpy 411 Dec 27, 2022
Fitting thermodynamic models with pycalphad

ESPEI ESPEI, or Extensible Self-optimizing Phase Equilibria Infrastructure, is a tool for thermodynamic database development within the CALPHAD method

Phases Research Lab 42 Sep 12, 2022
A Python module for clustering creators of social media content into networks

sm_content_clustering A Python module for clustering creators of social media content into networks. Currently supports identifying potential networks

72 Dec 30, 2022
pyhsmm MITpyhsmm - Bayesian inference in HSMMs and HMMs. MIT

Bayesian inference in HSMMs and HMMs This is a Python library for approximate unsupervised inference in Bayesian Hidden Markov Models (HMMs) and expli

Matthew Johnson 527 Dec 04, 2022
Very useful and necessary functions that simplify working with data

Additional-function-for-pandas Very useful and necessary functions that simplify working with data random_fill_nan(module_name, nan) - Replaces all sp

Alexander Goldian 2 Dec 02, 2021
A notebook to analyze Amazon Recommendation Review Dataset.

Amazon Recommendation Review Dataset Analyzer A notebook to analyze Amazon Recommendation Review Dataset. Features Calculates distinct user count, dis

isleki 3 Aug 22, 2022
Tools for the analysis, simulation, and presentation of Lorentz TEM data.

ltempy ltempy is a set of tools for Lorentz TEM data analysis, simulation, and presentation. Features Single Image Transport of Intensity Equation (SI

McMorran Lab 1 Dec 26, 2022
Collections of pydantic models

pydantic-collections The pydantic-collections package provides BaseCollectionModel class that allows you to manipulate collections of pydantic models

Roman Snegirev 20 Dec 26, 2022
Data collection, enhancement, and metrics calculation.

l3_data_collection Data collection, enhancement, and metrics calculation. Summary Repository containing code for QuantDAO's JDT data collection task.

Ruiwyn 3 Dec 23, 2022