WMD-group / SMACT

Python package to aid materials design and informatics
https://smact.readthedocs.io
MIT License
98 stars 21 forks source link

Issue of the charge neutrality check function #55

Closed usccolumbia closed 4 months ago

usccolumbia commented 2 years ago

When we apply the charge neutrality check function of smact to the compositions of the materials project database, we find that up to 25% samples does not have charge neutrality as calculated by your function. These samples should be charge neutral. Can you explain this discrepancy? Is this caused by the assumed oxidation states of elements as used in your code for charge neutrality calculation?

AntObi commented 2 years ago

Would you be able to provide examples for the samples for which the charge neutrality function appears to fail so that we can reproduce the issue?

Edit: If the subset of the compounds that charge neutrality filter doesn't work for are intermetallics, electrides, etc, then that could be the issue as the SMACT package was developed to look at ionic compounds.

usccolumbia commented 2 years ago

Here are some example compositions from MP database that shows non-charge-neutral by your code.

Ac3Cr1 AcAg1 Ac3Zr1 AcMg5 Ac3Eu1 SrAc3 CaAc3 Ac3Yb1 AcMg3 Ac3Np1 AcMg1 SrAc3 Ac3Yb1 AcIn3 Ac3Ce1 Ac3Zr1 AcY3 Ac2Mg1 AcSc3

can u check?

dandavies99 commented 2 years ago

Hi @usccolumbia, all of those examples are intermetallics so, as @AntObi says, would not be identified as charge neutral in SMACT. You'll get the same result for anything where the formal oxidation state of each constituent element is 0, e.g. covalent compounds like Si, C, SiC etc.

sgbaird commented 2 years ago

Any recommendations on alternatives to check the validity of chemical formulas for intermetallics and other non-ionic compounds?

Maybe https://github.com/txie-93/cdvae/blob/main/scripts/eval_utils.py#L121 for example

dandavies99 commented 2 years ago

Hi @sgbaird - yes that check to see whether everything is a metal is exactly what I had in mind.

We don't have anything like this in smact already is because we were primarily interested in finding combinations of elements, up to a certain stoichiometry threshold, to satisfy valency so weren't really interested in intermetallics.

In general, as soon as oxidation_state = 0 is considered, practically all element combinations would be allowed because practically all elements can exist in oxidation state 0. But checking if the elements are all metals (maybe also if they are in the same group?) would certainly be a sensible approach if checking whether an existing formula is valid.

Perhaps we could think about splitting these two ways of working out within the code: 1) I'm working with a (possibly big) list of elements and want to know what combinations are valid up to stoichiometry = n. I need this to be fast and don't need to check intermetallics because in terms of valence these are always going to be fine. 2) I need a function to run against a (possibly big) list of existing formulas to check whether there are elements being forced into dodgy oxidation states.

usccolumbia commented 2 years ago

We did a simple statistics over non-chargeneutral entries in Materials Project database. out of all those, 52.75% are intermetallics...1.43% are covalent non-metal compounds, and 45.8% have at least one metal element, most are oxides.

Why your charge-neutrality check routine fail for so many oxides?

BaErFe4O7 Ba3NaSi2O8 BaTmCo4O7 BaFe3P3O12 BaLuCo4O7 BaMo6I2O25 BaU2P2O19 Ba4Mo2O6F13 Ba8U3Hg3S18 Ba38Na58Li26H1 BaMn3P3O12 K2BaNb2S11 BaYbFe4O7 BaErFe4O7 Ba8Lu3Pt4O18 Ba4SmCu3O9 Ba4Ti6Si4O25 Ba2LiU1O6 Ba2EuCu4O8 KBa3Bi4O12

Mg3Cu9Si16O48 Li9Mn12Cu3O32 LiLa14Cu6O28 Li4Cu2Ni5O12 Na4CuTe2O29 ThU4Cu20Pd5 Sr6Tl3Cu3O16 Na8Nb2Cu4S21 K3Nb2CuSe12 CuH12N6O6 Li3Cu4SnO8 LiNd6Cu2O12 Li5Cu5Sb2O12 Li16Mn15Cu3O36 LiLa20Cu9O40 LiLa8Cu3O16

is any possible fix for this?

dandavies99 commented 2 years ago

Hi @usccolumbia, a few points on this, but overall this is not something that need to be "fixed":

Code example

What procedure are you actually carrying out to check these compounds? It would be very useful if you could provide a code snippet and ideally the output.

Non-charge neutral compounds

When you say you did analysis "over non-charge neutral entries" - do you mean that you selected compounds somehow that are not charge neutral? Or these are the ones you found to be non-charge neutral with smact?

Many formulas are actually unlikely

Ultimately, if there are no known oxidation states for the elements involved that satisfy charge neutrality for the stoichiometry of a given formula, then the compound will fail the charge neutrality test. In many cases, this means the formula is unlikely to lead to a stable compound.

Taking just one of your examples at random, Na4CuTe2O29, there are two entries in the Materials Project for this here and here, both of which are extremely high in energy above the convex hull and would spontaneously decompose. There is no ICSD entry associated with either of these structures so they probably have never been made.

The lesson here is that in this case the smact charge neutrality check is doing its job, and telling you that a compound is unlikely to exist with this formula. The Materials Project does not just contain stable, or even sensible, compounds. To be honest I think most of your examples fall into this category.

Mixed valence

Many of the examples you give with transition metals may be mixed valence compounds and smact (or any algorithm that just looks at formula, not structure) cannot deal with that. For example, BaErFe4O7 can only be charge neutral (assuming Ba2+, Er3+ and O2-) if Fe is Fe2+/Fe3+ at a ratio of 3:1. This may not be the actual answer for this compound, I haven't looked at the structure, but it illustrates the point. In order to try and determine the oxidation states in those compounds you need to analyse the structure, try using the pymatgen bond valence analysis.

aronwalsh commented 2 years ago

@dandavies99 gave quite a comprehensive answer.

I would only add that this is a conventional ionic filter, so failing it tells me that something interesting may be happening chemically. For example, in Ba3NaSi2O8 the sum of the cations is 15+, while (assuming an oxide) the sum of the anions is 16-. So an oxygen hole or O-O bonding could be present. See a related discussion for superconductors here.

usccolumbia commented 2 years ago

our goal is to get a complete formula validity checker with smact. (fixing maybe not a good term -:)

Or these are the ones you found to be non-charge neutral with smact yes. these are the ones that we found to be non-charge neutral with smact.

Ba4SmCu3O9 has ehull 0.004 eV. but it is assigned as not charge-neutral. just wonder if it is possible to assign the label of charge-neutral correctly for this case.

aronwalsh commented 4 months ago

I am closing this as partially addressed with smact_validity() and ongoing work for mixed valence and intermetallic systems