materialsproject / api

New API client for the Materials Project
https://materialsproject.github.io/api/
Other
105 stars 33 forks source link

Inconsistencies in Indexing between MP docs and XAS docs? #916

Open niyucao opened 2 weeks ago

niyucao commented 2 weeks ago

Hello!

I've recently been trying to work with XAS data from the Materials Project and stumbled across a potential issue/point of confusion when comparing materials between MP docs and XAS docs. I pull MP docs using:

docs = mpr.materials.summary.search(element="S")

and I pull XAS docs using:

xas = mpr.materials.xas.search(absorbing_element = "S", edge = Edge.K)

When looking at the same material IDs, I've noticed that sometimes the indexing choices for the atom of choice (Sulfur in this case) are different between MP docs and XAS docs. Here are a few examples of different cases I've come across:

- Material mp-21276: This material (Pb4S4) indexes sulfur atoms as [4,5,6,7] in MP docs, but XAS docs indexes the absorbing Sulfur atom as [1] because it considers the reduced composition (PbS) when indexing instead of the full composition. In fact, MP docs lists the full composition as Pb4S4 and reduced composition as PbS, but XAS docs references both the full and reduced compositions as PbS.

- Material mp-12843: This material (Y4Cu4S8) has both MP docs and XAS docs correctly identify the full versus reduced compositions, and when indexing, they both reference the full composition rather than the reduced composition. However, the order in which the element types are listed changes between MP docs and XAS docs. In MP docs, it is S8Cu4Y4, so the sulfur atoms are indexed [0,1,2,3,4,5,6,7], while in XAS docs, it is Y4Cu4S8, so the absorbing sulfur atom is instead indexed [12] instead of something between 0 and 7.

- Material mp-28105: This material (Ni51S54) is the opposite of the first example, in the sense that MP docs indexes Sulfur atoms as [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34] meaning that it indexes according to the reduced composition (Ni17S18) rather than the full composition. XAS docs, however, references the full composition when indexing, so the index of the absorbing atom is [81]. If one looks up what MP docs says the full composition is, it says Ni17S18 rather than Ni51S54, as XAS docs says it is.

I've tried to compare the structures returned for a given material between MP docs and XAS docs, and using the .matches() function returns True. I am a bit confused by this and am having trouble seeing the affine equivalence of two structures if the number of atoms are different. Additionally, I had trouble finding information on what kind of affine transformations I can apply to get the two structures to look equivalent.

Any help or insight would be greatly appreciated on how this indexing, elemental ordering, etc. was done and how I can recover index matching between MP docs and XAS docs for the same material!

Thank you very much!

munrojm commented 6 days ago

@niyucao sorry for such a delayed response. I have noted the issue and am looking into it. However, please post this on our forum as well if you haven't already: https://matsci.org/c/materials-project/8.