Elastic tensors

Hi, users and developers,
For a few weeks you have added more than 6000 compounds contain elastic tensor to reach actually 13934, which is the number indicated on the Material project website. However, MPRester queries are giving inconsistent results. For example, 0 compounds containing 3 elements: this is a strange thing !!
In below you can find my own script used to calculate all the elements containing elastic tensor with the obtained result.
from pymatgen import MPRester

api = MPRester()

compteur = 0
compteuri = 0
texte = “”

for i in range(1, 20):
compteuri = 0
entries = api.get_entries({“nelements”: i}, property_data=[“elasticity”])
for entry in entries:
if entry.data[“elasticity”]:
compteuri = compteuri + 1
compteur = compteur + 1

texte += "Number of elements containing " + str(i) + " atome(s) : " + str(compteuri) + “\n”

texte += "\nThe total number of all elements : " + str(compteur)
print(texte)

And the result:
Number of elements containing 1 atome(s) : 312
Number of elements containing 2 atome(s) : 5021
Number of elements containing 3 atome(s) : 0
Number of elements containing 4 atome(s) : 541
Number of elements containing 5 atome(s) : 31
Number of elements containing 6 atome(s) : 1
Number of elements containing 7 atome(s) : 0
Number of elements containing 8 atome(s) : 0
Number of elements containing 9 atome(s) : 0
Number of elements containing 10 atome(s) : 0
Number of elements containing 11 atome(s) : 0
Number of elements containing 12 atome(s) : 0
Number of elements containing 13 atome(s) : 0
Number of elements containing 14 atome(s) : 0
Number of elements containing 15 atome(s) : 0
Number of elements containing 16 atome(s) : 0
Number of elements containing 17 atome(s) : 0
Number of elements containing 18 atome(s) : 0
Number of elements containing 19 atome(s) : 0

The total number of all elements : 5906

Thank you very much for your help.

That is indeed strange. Unfortunately, I cannot reproduce your result for {"nelements": 3} – I get 8028. I get the same numbers as you for all other values of i.

Thank you very much for the quick answer.
However, we tried several API keys and from several networks, then we always get zero for nelements = 3, which is strange.

Thank you for help

I am seeing this too… I opened a bug report with pymatgen, but I am not sure if it’s an API/server issue or a pymatgen issue. https://github.com/materialsproject/pymatgen/issues/1331

1 Like

Thank you @fxcoudert! It turns out it was indeed a bug in pymatgen’s MPRester.get_entries method. I had used

len(api.query({"nelements": 3, "elasticity": {"$exists": True}}, ["material_id"]))

to get 8028.

MPRester.get_entries should be fixed in the next pymatgen release.