While assigning A and B sites in the 1,034 cubic (Pm-3m) ABX₃ perovskite entries of database version 2026.09.28, we found that for 117 entries the structure description gives no coordination number for the A cation. Example: TlCuF₃ (mp-554973), where Tl has twelve F at 2.887–2.892 Å and the next atoms (Cu) at 3.54 Å.
Running pymatgen’s CrystalNN on these structures reproduces the problem. With default settings, the A ion receives zero neighbours in 128 entries, mostly with large post-transition A cations (Tl⁺, Pb²⁺, Hg²⁺, Cd²⁺, Ag⁺, Bi³⁺) or Li/Rb. Assigning oxidation states and counting only cation–anion bonds fixes about half of them. Switching off the distance cut-off (
CrystalNN(distance_cutoffs=None)) gives 12 for A and 6 for B in all 1,034 entries, consistent with the descriptions wherever they state both numbers (917 entries).It appears the default distance cut-off excludes the real A–X distances for these large cations. Affected entries include PbZrO₃ (mp-1068577), PbHfO₃ (mp-22535), RbPbCl₃ (mp-1209191) and a series of Tl, Hg, Cd and Ag compounds. I can share the full list of entries and the script.
Could you share the script and the exact error you encountered? This would help us reproduce the issue on our end. Thanks!
Hi Min-Hsueh,
And thanks for your reply. Please find attached the list of 117 cubic Pm-3m entries whose structure descriptions do not state the A-site coordination, and a short Colab notebook that reproduces the issue for one entry.
The notebook downloads the structure and the description of the chosen entry, lists the atoms around the A cation (12 anions at the same distance, then a clear gap), and counts the A neighbours with pymatgen’s CrystalNN. With the default settings, CrystalNN finds 0 neighbours for A; with distance_cutoffs=None, it finds the expected 12. This seems to be why the A-site sentence is missing from the descriptions. To test another entry, change MATERIAL_ID and A at the top of the second cell.
Kind Regards
M Hezam
Hi Mahmoud:
Thank you for bringing this to our attention! I can confirm that I was able to reproduce the issue on my end.
To address this in our database, we’ll need more time to develop a more comprehensive approach to selecting specific configurations for different systems. We currently use CrystalNN() with its default settings, as we believe this is suitable for the majority of materials and allows us to generate descriptions systematically.
In the meantime, for your specific case, I would suggest using the following code to generate the description yourself, with the corrections distance_cutoffs you pointed out.
from mp_api.client import MPRester
from robocrys import StructureCondenser, StructureDescriber
from pymatgen.analysis.local_env import CrystalNN
def get_description(structure):
symprecs = [0.01, 0.1, 1.0e-3]
for isymprec, symprec in enumerate(symprecs):
# occasionally, symmetry detection fails - give a few chances to modify symprec
try:
condenser = StructureCondenser(
symprec=symprec,
near_neighbors=CrystalNN(distance_cutoffs=None)
)
condensed_structure = condenser.condense_structure(structure)
break
except ValueError as exc:
if isymprec == len(symprecs) - 1:
raise exc
for desc_fmt in ["unicode", "html", "raw"]:
try:
describer = StructureDescriber(
describe_symmetry_labels=False, fmt=desc_fmt, return_parts=False
)
description = describer.describe(condensed_structure)
break
except ValueError as exc:
# pymatgen won't convert a "subscript period" character to unicode
# in these cases, the description is still generated but unicode
# parsing failed - use html instead
if "subscript period" not in str(exc):
raise exc
return description
MATERIAL_ID = "mp-1206910"
# retrieve structure
with MPRester() as mpr:
structure = mpr.get_structure_by_material_id(MATERIAL_ID)
description = get_description(structure)
print(description)
Thank you for confirming the issue and for the code — it works well for our case. Glad it may help improve the descriptions in a future release.
Kind Regards
M Hezam