Pymatgen (Python Materials Genomics) is a robust, open-source Python library for materials analysis. These are some of the main features:
Highly flexible classes for the representation of Element, Site, Molecule, Structure objects.
Extensive input/output support, including support for VASP (http://cms.mpi.univie.ac.at/vasp/), ABINIT (http://www.abinit.org/), CIF, Gaussian, XYZ, and many other file formats.
Powerful analysis tools, including generation of phase diagrams, Pourbaix diagrams, diffusion analyses, reactions, etc.
Electronic structure analyses, such as density of states and band structure.
Integration with the Materials Project REST API, Crystallography Open Database and other external data sources.
Reference: https://pymatgen.org/
Installing the conda package manager
To install the library we need to install the anaconda which includes conda package manager, python3.9 version and Jupyter Notebook used for scientific computing and data science.
* Download Anaconda installer for Linux.
* Verify your installer hashes
* .Run
accept the default choices
We get the following
* Source the ~/.bashrc file
How to avoid conda to activate base environment?
By default conda init
will add to your .bashrc file for the base environment, which will slow down your terminal.
You can remove them in your .bashrc file or answer no to that question in the last step of your anaconda installation.
And then add the following to your .bashrc file. If you changed the default installation directory, change ~/anaconda3/
to that directory.
To test it, open a new terminal tab or run source .bashrc
. Run conda activate base
, then you should see (base)
in front of your Bash prompt.
Now you can create another environment and activate it using Anaconda. If you frequently use one environment, you can also add conda activate [env]
to your .bashrc
file.
NB: You can install miniconda packae which is a minimal free Conda installer. It’s a thin, bootstrap version that contains just conda, Python, the packages they depend on, and a limited range of other helpful modules like pip, zlib, and a few others.
Installing the Pymatgen library
Note that you might need to ensure a relatively recent version of gcc is available to compile pymatgen. You can use conda to get that:
To install the library we run the following command
Pymatgen is under active development, and new features are added regularly. To upgrade pymatgen to the latest version, use the following command:
We got the following message
0 Comments