Questions tagged [pymatgen]
Pymatgen (Python Materials Genomics) is a robust, open-source Python library for materials analysis.
41
questions
0
votes
0
answers
23
views
XRD data conversion
does anyone know how to convert xrd data in .str format to .cif format?
from pymatgen.core import Structure
from pymatgen.io.cif import CifWriter
import os
# Define the directory containing your .str ...
0
votes
0
answers
34
views
ImportError when using abicheck.py with abipy and pymatgen
Hi Stack Overflow community,
I'm encountering an issue when trying to use abicheck.py with the abipy and pymatgen libraries in my abienv conda environment. Here's the command I'm running and the error ...
0
votes
0
answers
41
views
Extraction of a feature for all atoms within a 1×1×1 computational cell at the center of a 3×3×3 supercell
Context:
To account for periodic boundary conditions, feature extraction is performed for all atoms within a 1×1×1 computational cell at the centre of a 3×3×3 supercell.
Actually, I want to extract ...
0
votes
0
answers
95
views
Problem when using AdsorbateSiteFinder/find_adsorption_sites with Pymatgen
I'm trying to find the adsorption binding sites of a lattice provided by a quantum espresso input file which has the following cell vectors:
kbasis=([[-5.14439960600149, 4.455181658787211, 0.0], [-3....
0
votes
0
answers
163
views
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:
-----------------------------------------------------...
0
votes
0
answers
98
views
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 ...
0
votes
0
answers
20
views
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 ...
0
votes
0
answers
52
views
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 ...
0
votes
1
answer
202
views
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
616
views
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 ...
3
votes
0
answers
602
views
Can't install Pymatgen [Could not build wheels for pymatgen]
I'm trying to install pymatgen but it returns the following error:
ERROR: Could not build wheels for pymatgen, which is required to install pyproject.toml-based projects
The complete error is as ...
0
votes
1
answer
78
views
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, '...
-1
votes
1
answer
133
views
Getting all combinations of a string with subscript and specif format
I have seen various combination formats. But I have to try something new.
Lets say, we have three lists:
A = ('Li', 'B', 'C', 'N')
B = ('Li', 'B', 'C', 'N')
X = ('O', 'Br', 'Cl')
All the element of ...
1
vote
0
answers
487
views
How to extract conventional standard type CIF files from Materials Project through pymatgen or matminer
I use Matminer to get CIF file from Materials Project.The code is:
from matminer.data_retrieval.retrieve_MP import MPDataRetrieval
mpdr = MPDataRetrieval(api_key='My_key')
df = mpdr.get_dataframe(...
2
votes
1
answer
1k
views
Can't import pymatgen.core "No module named 'pymatgen.core'"
I've used pip install pymatgen with Python 3.9.1 on Windows 10 to install pymatgen, but I'm getting the following error:
Traceback (most recent call last):
File "D:\code\pymatgen\...
0
votes
1
answer
1k
views
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. ...
0
votes
0
answers
174
views
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,
...
0
votes
0
answers
102
views
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 ...
0
votes
1
answer
931
views
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 ...
1
vote
1
answer
881
views
Pymatgen Installation issue with Anaconda python 3.8 ? Monty module not found?
I am eager to get started with Materials Simulation. I am facing issues trying to install Pymatgen with Anaconda. Here are the things I did. I am using Win 8.1 x64, Python 3.8.
First I tried to ...
0
votes
2
answers
696
views
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 ...
1
vote
2
answers
703
views
Google Colab shows error while installing pymatgen
I'm trying to install pymatgen in Google colab via the following command:
!pip install pymatgen
This throws the following error:
Collecting pymatgen
Using cached https://files.pythonhosted....
1
vote
0
answers
52
views
Download data with topological classification
In the materials project database, In the electronic structure part of compounds, there is a tag for “Topological Classification”. I am wondering if this data can be added to the properties of the ...
0
votes
2
answers
1k
views
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: ...
0
votes
0
answers
174
views
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 ...
1
vote
1
answer
53
views
which() command can find executable only with ./
I'm using pymatgen, which has a class BaderAnalysis (https://github.com/materialsproject/pymatgen/blob/v2020.4.29/pymatgen/command_line/bader_caller.py).
This class needs a executable called bader (...
-2
votes
1
answer
129
views
How to writing files using Python For-loop
I am new to SO and self-learning Python.
I am using Pymatgen to study computational material science and I have a question which I have been struggling with and couldn't find an answer anywhere.
I ...
0
votes
1
answer
464
views
command line utility of pymatgen
I have installed the python package pymatgen and it perfectly works when I use it in my Jupyter notebooks. However, now I wanted to do the POSCAR setup as specified here: https://pymatgen.org/...
0
votes
1
answer
372
views
Cleave specific termination with SlabGenerator in Pymatgen
I'm trying to use pymatgen model to cleave a specific termination on Fe2O3 and Al2O3. In SlabGenerator, one of its parameter is in_unit_planes(bool), default =false.
It said in the instruction that ...
0
votes
1
answer
718
views
Pymatgen: How to convert query result to structure
We have existing code to get some material properties for many materials (>60,000).
from pymatgen import MPRester
mpr = MPRester(api_key="")
criteria={"nelements":{'$lt':4}}
properties=["...
0
votes
2
answers
2k
views
Extracting the coordinates and atom types from a pymatgen structure object
What is the syntax for extracting the atomic coordinates list, [[x1, y1, z1], [x2, y2, z2], ...] and atomic species list, eg. [1,1,1,1,...] from a pymatgen structure object?
0
votes
1
answer
194
views
What Does the coordinate list next to the cartesian coordinates of an atom represent in neighbor_list
I was trying to analyze the result obtained by using pymatgen.analysis.local_env module by using min_dist approach by using following script:
from pymatgen.analysis.local_env import
...
0
votes
1
answer
292
views
add atoms randomly around an atom in vasp poscar using pymatgen
I am trying to find all atoms of type A in a VASP POSCAR and then randomly add "n" atoms of type B in a sphere of radius ("r") centered at each site of type A atom using pymatgen and return each time ...
0
votes
1
answer
1k
views
Pymatgen XRD Plot
I am following the XRD plot tutorial and as it told in this tutorial I imported
from pymatgen import Lattice, Structure
from pymatgen.analysis.diffraction.xrd import XRDCalculator
from IPython....
0
votes
1
answer
723
views
Pymatgen- Installing modules [pymatgen.apps.borg.queen]
it is a very basic question but I stuck it.
I have installed pymatgen and following this phase diagram tutorial. WHen I try to import pymatgen.borg it gives me an error
I guess I need to install ...
0
votes
1
answer
118
views
Magnetic moments relative to crystal axes?
I am using pymatgen to write .mcif files. My structures always have collinear magnetic moments of magnitude 4 along z, but before writing them to the file I noticed that pymatgen transforms them with ...
2
votes
1
answer
522
views
Converting a primitive structure to conventional standard with pymatgen?
How do I convert a primitive structure to the conventional standard representation with pymatgen?
1
vote
3
answers
1k
views
How to install pymatgen for Python 2.7.x and not 3.6
The pymatgen module is supposed to work for Python 2.7.x or 3. Files for both are available (https://anaconda.org/matsci/pymatgen/files). My Python (sys.version) is 2.7.11.
I tried installing with ...
1
vote
1
answer
4k
views
pymatgen plotting DOS
I am trying to plot DOS (density of states) with pymatgen but I can't make it work. First time encountering self and class functions in python so I am at a loss.
This link explains the package that ...
2
votes
1
answer
2k
views
How to get all bond angles within a structure, using pymatgen?
So, using pymatgen, I have a structure object. What I want to do is get all of the bond angles within the structure. I could loop over every atom to get all bond angles, but this would include every ...
0
votes
1
answer
1k
views
Simple phase diagram using pymatgen
I've been getting familiar with the pymatgen package and need to make phase diagrams. There's a quick tutorial on this web page that goes through how to make a ternary diagram, but I actually want to ...