Created
May 31, 2012 17:51
-
-
Save mpkocher/2845028 to your computer and use it in GitHub Desktop.
Pymatgen Composition Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymatgen.core.structure import Composition | |
ds = [] | |
ds.append(dict(Mn=20, O=20)) | |
ds.append(dict(Fe=3, O=4)) | |
ds.append(dict(Li=2, Co=2, O=4)) | |
for d in ds: | |
c = Composition.from_dict(d) | |
print c.formula | |
print c.reduced_formula | |
print c.to_dict | |
print c.anonymized_formula | |
print c.to_reduced_dict | |
print c.num_atoms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment