Hi,
I’m trying to find partial charges (e.g. Bader, DDEC) for bulk crystals in materials project (i.e. not molecules, MOFs).
Are these available anywhere?
Best,
Thomas
Hi,
I’m trying to find partial charges (e.g. Bader, DDEC) for bulk crystals in materials project (i.e. not molecules, MOFs).
Are these available anywhere?
Best,
Thomas
Hi @Thomas_Warford, there was a batch of Bader charge analyses performed on the MP charge densities (CHGCARs and AECCARs) by @Martin_Siron1, who generously contributed these back to MP.
I’ve made these available via MPContribs - after running pip install mpcontribs-client, you can retrieve all of the bader-charge decorated structures using the normal API client:
from mp_api.client import MPRester
from pymatgen.core import Structure
from mpcontribs.client import Attachment
from monty.serialization import loadfn, dumpfn
with MPRester() as mpr:
attachment_ids = {
entry["attachments"][0]["id"] for entry in mpr.contribs.query_contributions(
{"project": "mp_charges"},
fields=["attachments"],
paginate=True,
)["data"]
}
paths = mpr.contribs.download_attachments(list(attachment_ids))
structures = {}
for path in paths:
entries = loadfn(path)
for entry in entries:
structure = Structure.from_str(
Attachment(entry).unpack(), fmt = "json"
)
structures[structure.properties["task_id"]] = structure
dumpfn(structures, "mp_structures_with_bader.json.gz")
Great! Thank you both for making this accessible.
@Aaron_Kaplan @Martin_Siron1 I have a question about the data: why are there multiple taskids for most materialids?
There are typically multiple tasks which compose a material in MP, see this docs page for an explanation or here for an example