When I download the chgcar data using mp_api.client.MPRester(‘api_key’).get_charge_density_from_material_id(‘mpid’), how should I interpret the chgcar object? Specifically, how to interpret the grid for chgcar.data[‘total’] ? Is the grid over the unitcell we get from MPRester(‘api_key’).get_structure_by_material_id(‘mpid’)?
Good question. The grid is over the structure found in the associated task document. To get that data alongside the CHGCAR object, you can pass inc_task_doc=True to get_charge_density_from_material_id alongside the MPID.
Thanks!
Do we need VASP POTCAR files for inc_task_doc=True?
I am getting the following error upon running chgcar, data = mpr.get_charge_density_from_material_id('mp-861724', inc_task_doc=True):
ValueError: No POTCAR for Ac with functional PBE found. Please set the PMG_VASP_PSP_DIR environment in .pmgrc.yaml, or you may need to set PMG_DEFAULT_FUNCTIONAL to PBE_52 or PBE_54 if you are using newer psps from VASP.
I do not have a VASP license, however, I only need the structure (POSCAR file) used in the charge density calculations.