PyMatGen Compositions¶
Important
This page provides a concise list of available properties and methods, grouped by topic.
Refer to Pymatgen's API docs for detailed descriptions.
Introduction¶
To access the Composition objects from a Structure:
comp = structure.composition
The composition property is also available for Molecule, Cluster, Interface, and more.
Warning
a Composition object can come from a variety of sources. For example, a composition can be for an entire Structure OR just a single chemical component (such as a Molecule, Cluster, Interface, etc.).
Composition Loading¶
from_dictfrom_weight_dict
Composition Exporting¶
as_dictcopyto_data_dictto_html_stringto_jsonto_latex_stringto_pretty_stringto_reduced_dictto_unicode_stringto_weight_dict
Basic Properties¶
alphabetical_formulaanonymized_formulaaverage_electronegchemical_systemelement_compositionelementsformulafractional_compositioniupac_formulahill_formulareduced_compositionreduced_formulaspecial_formulastotal_electronsvaluesweightnum_atoms
Analysis Methods¶
amount_tolerancealmost_equalscontains_element_typeis_elementvalidget_atomic_fractionget_el_amt_dictget_integer_formula_and_factorget_reduced_composition_and_factorget_reduced_formula_and_factorget_wt_fractionoxi_proboxi_state_guessesranked_compositions_from_indeterminate_formula
Dict-like Utils¶
getitemskeys
Charge Utils¶
add_charges_from_oxi_state_guessesallow_negativeremove_chargesreplace
JSON Utils¶
unsafe_hashvalidate_monty_v1validate_monty_v2