Questions tagged [pymatgen]

Pymatgen (Python Materials Genomics) is a robust, open-source Python library for materials analysis.

It currently powers the public Materials Project (http://www.materialsproject.org), an initiative to make calculated properties of all known inorganic materials available to materials researchers. These are some of the main features:

  • Highly flexible classes for the representation of Element, Site, Molecule, Structure objects.
  • Extensive io capabilities to manipulate many VASP (http://cms.mpi.univie.ac.at/vasp/) and ABINIT (http://www.abinit.org/) input and output files and the crystallographic information file format. This includes generating Structure objects from vasp input and output. There is also support for Gaussian input files and XYZ file for molecules.
  • Comprehensive tool to generate and view compositional and grand canonical phase diagrams.
  • Electronic structure analyses (DOS and Bandstructure).
  • Integration with the Materials Project REST API.

View details here: http://pymatgen.org/

42 questions
0
votes
0 answers

Import nglview in jupyter lab

I'm trying to use nglview to visualize some pymatgen structures in a jupyter lab notebook. Simply using import nglview returns the following error: --------------------------------------------------------------------------- AttributeError …
R Walser
  • 330
  • 3
  • 16
0
votes
0 answers

How to extract data from materials project database using python?

I have written a code using python tools to extract a data from materials project database. I work with a 32 core CPU and 128gb ram. I have split each job with 4 core processor using multiprocessing tool. I have set to skit the particular structure…
0
votes
0 answers

How to find nonequivalent binding sites onto a defected (111) lattice surface

I have a defected surface generated by ATAT (Alloy-Theoretic Automated Toolkit) and I have to create a python script that finds its nonequivalent binding sites for a monodentate molecule. I'm trying to use pymatgen and its get_site_symmetries…
0
votes
0 answers

is there a way to sum several single site DOS's using pymatgen?

Ive created a script to give me a single site(atom) DOS. Is there a way to sum several single sites together, ie atoms surrounding a defect, into one DOS plot using pymatgen. This is what i have so far: from pymatgen.electronic_structure.dos import…
0
votes
1 answer

While doing "from pymatgen.core.io.cif import CifParser" in PYMATGEN i got this error

error details I was trying to convert cif file into Pwscf file for Quantum Espresso.
0
votes
2 answers

Get graph from a structure with pymatgen

Given a cif file I want to obtain the graph representation (as a data structure) of a certain material. I am trying with this cif file which represents the unit cell of CrN. I am trying to use pymatgen's StructureGraph class but I have had some…
suribe06
  • 69
  • 8
0
votes
0 answers

How to resolve cannot import the name coord_cython from pymatgen.util in pymatgen (2022.9.21) with python 3.8?

I am using the Linux operating system on a remote server. I used pip install to install pymatgen 2022.9.21 but I am getting an error which I have pasted below. I tried the older version of Pymatgen, but still could not resolve it. I would appreciate…
0
votes
1 answer

Select rows based on data variable in column and remove others

I have created a DataFrame (df): index compound e_above_hull space 0 CaFeO3 0.052160963499999546 {'symprec': 0.1, 'source': 'spglib', 'symbol': 'Pm-3m', 'number': 221, 'point_group': 'm-3m', 'crystal_system': 'cubic',…
0
votes
1 answer

ipython no error, jupyter has error ModuleNotFoundError: No module named 'ruamel'

I am running a Python package called pymatgen in Jupyter. Jupyter and pymatgen are installed in a conda environment. I have manually installed ruamel using conda's python3, but the same error occurs. The strange thing is that the same code (in this…
Paul Fons
  • 1
  • 1
0
votes
0 answers

how can I resolve this key error in this section of program

I have a problem with this section of my code that it returns to the diffusion analysts of materials from pymatgen.analysis.diffusion.analyzer import ( DiffusionAnalyzer, fit_arrhenius, get_conversion_factor, ) import json from…
babak ab
  • 21
  • 4
0
votes
0 answers

How to access python library stored in separate environment?

For my project, I am using the Pymatgen libraries. I have installed it in a separate environment as "my_pymatgen". Now, during using the import pymatgen command it is giving the error ModuleNotFoundError. How to access this library?
0
votes
1 answer

ImportError: cannot import name 'Molecule' from 'pymatgen' (unknown location)

I am trying to simulate a Si crystal structure with 'pymatgen' in Anaconda3. import pymatgen This code runs without error. But when I run the following code- from pymatgen import Molecule It gives error "ImportError: cannot import name 'Molecule'…
0
votes
2 answers

Saving/Storing pymatgen Structures

I'm currently dealing with a material science dataset having various information. In particular, I have a column 'Structure' with several pymatgen.core.Structure objects. I would like to save/store this dataset as .csv file or something similar but…
James Arten
  • 523
  • 5
  • 16
0
votes
2 answers

IProgress Error while material query via MPRester

I am using python 3.8 in spyder3. I am getting an error while doing: mp=MPRester('api key') data = mp.query(criteria={}, properties=['task_id']) #this line raises error The error is : NameError: name '**IProgress**' is not defined. During…
Rik Ghosh
  • 23
  • 6
0
votes
0 answers

How to print sublists (string) from a list using for-loop in python3?

I am trying to use a for-loop to get each sublist from a list like a list below. My for-loop worked but they only give me the last item of the list 11 times. I would like some help, please. for i in range(len(add_h2o_ver)): print(i,end = " ") …