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
Evaluation of a Monocular Eye Tracking Set-Up

Evaluation of a Monocular Eye Tracking Set-Up As part of my master thesis, I implemented a new state-of-the-art model that is based on the work of Che

Pascal 19 Dec 17, 2022
Basis Set Format Converter

Basis Set Format Converter Repository for the online tool that allows you to enter a basis set in the form of text input for a variety of Quantum Chem

Manas Sharma 3 Jun 27, 2022
Finding project directories in Python (data science) projects, just like there R rprojroot and here packages

Find relative paths from a project root directory Finding project directories in Python (data science) projects, just like there R here and rprojroot

Daniel Chen 102 Nov 16, 2022
Functional tensors for probabilistic programming

Funsor Funsor is a tensor-like library for functions and distributions. See Functional tensors for probabilistic programming for a system description.

208 Dec 29, 2022
An Aspiring Drop-In Replacement for NumPy at Scale

Legate NumPy is a Legate library that aims to provide a distributed and accelerated drop-in replacement for the NumPy API on top of the Legion runtime. Using Legate NumPy you do things like run the f

Legate 502 Jan 03, 2023
Flenser is a simple, minimal, automated exploratory data analysis tool.

Flenser Have you ever been handed a dataset you've never seen before? Flenser is a simple, minimal, automated exploratory data analysis tool. It runs

John McCambridge 79 Sep 20, 2022
Analyze the Gravitational wave data stored at LIGO/VIRGO observatories

Gravitational-Wave-Analysis This project showcases how to analyze the Gravitational wave data stored at LIGO/VIRGO observatories, using Python program

1 Jan 23, 2022
Vectorizers for a range of different data types

Vectorizers for a range of different data types

Tutte Institute for Mathematics and Computing 69 Dec 29, 2022
peptides.py is a pure-Python package to compute common descriptors for protein sequences

peptides.py Physicochemical properties and indices for amino-acid sequences. 🗺️ Overview peptides.py is a pure-Python package to compute common descr

Martin Larralde 32 Dec 31, 2022
The lastest all in one bombing tool coded in python uses tbomb api

BaapG-Attack is a python3 based script which is officially made for linux based distro . It is inbuit mass bomber with sms, mail, calls and many more bombing

59 Dec 25, 2022
The Master's in Data Science Program run by the Faculty of Mathematics and Information Science

The Master's in Data Science Program run by the Faculty of Mathematics and Information Science is among the first European programs in Data Science and is fully focused on data engineering and data a

Amir Ali 2 Jun 17, 2022
Automated Exploration Data Analysis on a financial dataset

Automated EDA on financial dataset Just a simple way to get automated Exploration Data Analysis from financial dataset (OHLCV) using Streamlit and ta.

Darío López Padial 28 Nov 27, 2022
COVID-19 deaths statistics around the world

COVID-19-Deaths-Dataset COVID-19 deaths statistics around the world This is a daily updated dataset of COVID-19 deaths around the world. The dataset c

Nisa Efendioğlu 4 Jul 10, 2022
Statistical package in Python based on Pandas

Pingouin is an open-source statistical package written in Python 3 and based mostly on Pandas and NumPy. Some of its main features are listed below. F

Raphael Vallat 1.2k Dec 31, 2022
simple way to build the declarative and destributed data pipelines with python

unipipeline simple way to build the declarative and distributed data pipelines. Why you should use it Declarative strict config Scaffolding Fully type

aliaksandr-master 0 Jan 26, 2022
BinTuner is a cost-efficient auto-tuning framework, which can deliver a near-optimal binary code that reveals much more differences than -Ox settings.

BinTuner is a cost-efficient auto-tuning framework, which can deliver a near-optimal binary code that reveals much more differences than -Ox settings. it also can assist the binary code analysis rese

BinTuner 42 Dec 16, 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
Python utility to extract differences between two pandas dataframes.

Python utility to extract differences between two pandas dataframes.

Jaime Valero 8 Jan 07, 2023
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
vartests is a Python library to perform some statistic tests to evaluate Value at Risk (VaR) Models

gg I wasn't satisfied with any of the other available Gemini clients, so I wrote my own. Requires Python 3.9 (maybe older, I haven't checked) and opti

RAFAEL RODRIGUES 5 Jan 03, 2023