Hi @ZKaiser,
I think this question might be more appropriate on the pymatgen google group (or pymatgen issues page if you believe it’s a bug), or directed to @Anubhav_Jain who developed this feature.
But basically, the reason you are getting oxidation states of zero is because the algorithm can’t find a charge-balanced combination of common oxidation states for the elements present in that composition.
For example, see CoO4: Co has common oxidation states (2, 3) and O has common oxidation states (-2, ), as defined by pymatgen’s Element
class. There is no simple combination of these that is charge balanced for this composition. However, it is possible to include less common oxidation states in this analysis by using the all_oxi_states
argument, for example:
comp = Composition('CoO4')
comp.oxi_state_guess(all_oxi_states=True)
This returns:
({'Co': 4.0, 'O': -1.0},
{'Co': 5.0, 'O': -1.25},
{'Co': 2.0, 'O': -0.5},
{'Co': 3.0, 'O': -0.75},
{'Co': 1.0, 'O': -0.25},
{'Co': -1.0, 'O': 0.25})
as possible combinations of oxidation state for that composition. More details on how these algorithms work can be found in the pymatgen documentation.
Finally, you should also ask if oxidation state even makes sense in this instance. It’s possible that a formal valence isn’t well defined. Looking up CoO4 in Materials Project gives mp-1079523, which is a material with a very small band gap, and likely has a lot of metallic character. In many cases, an oxidation state of 0 might also be a sensible answer.
Hope this helps,
Matt