pymatgen.apps.battery.conversion_battery module

This module contains the classes to build a ConversionElectrode.

class ConversionElectrode(voltage_pairs: Tuple[pymatgen.apps.battery.battery_abc.AbstractVoltagePair], working_ion_entry: pymatgen.entries.computed_entries.ComputedEntry, framework_formula: str, initial_comp_formula: str)[source]

Bases: pymatgen.apps.battery.battery_abc.AbstractElectrode

Class representing a ConversionElectrode, since it is dataclass this object can be constructed for the attributes. However, it is usually easier to construct a ConversionElectrode using one of the classmethods constructors provided.


voltage_pairs: The voltage pairs making up the Conversion Electrode. working_ion_entry: A single ComputedEntry or PDEntry

representing the element that carries charge across the battery, e.g. Li.

initial_comp_formula: Starting composition for ConversionElectrode represented

as a string/formula.

classmethod from_composition_and_entries(comp, entries_in_chemsys, working_ion_symbol='Li', allow_unstable=False)[source]

Convenience constructor to make a ConversionElectrode from a composition and all entries in a chemical system.

  • comp – Starting composition for ConversionElectrode, e.g., Composition(“FeF3”)

  • entries_in_chemsys – Sequence containing all entries in a chemical system. E.g., all Li-Fe-F containing entries.

  • working_ion_symbol – Element symbol of working ion. Defaults to Li.

  • allow_unstable – If True, allow any composition to be used as the starting point of a conversion voltage curve, this is useful for comparing with insertion electrodes

classmethod from_composition_and_pd(comp, pd, working_ion_symbol='Li', allow_unstable=False)[source]

Convenience constructor to make a ConversionElectrode from a composition and a phase diagram.

  • comp – Starting composition for ConversionElectrode, e.g., Composition(“FeF3”)

  • pd – A PhaseDiagram of the relevant system (e.g., Li-Fe-F)

  • working_ion_symbol – Element symbol of working ion. Defaults to Li.

  • allow_unstable – Allow compositions that are unstable


If this electrode contains multiple voltage steps, then it is possible to use only a subset of the voltage steps to define other electrodes. For example, an LiTiO2 electrode might contain three subelectrodes: [LiTiO2 –> TiO2, LiTiO2 –> Li0.5TiO2, Li0.5TiO2 –> TiO2] This method can be used to return all the subelectrodes with some options


adjacent_only – Only return electrodes from compounds that are adjacent on the convex hull, i.e. no electrodes returned will have multiple voltage steps if this is set true


A list of ConversionElectrode objects

get_summary_dict(print_subelectrodes=True) → Dict[source]

Generate a summary dict. Populates the summary dict with the basic information from the parent method then populates more information. Since the parent method calls self.get_summary_dict(print_subelectrodes=True) for the subelectrodes. The current methode will be called from within super().get_summary_dict.


print_subelectrodes – Also print data on all the possible subelectrodes.


A summary of this electrode”s properties in dict format.

property initial_comp[source]

The pymatgen Composition representation of the initial composition

initial_comp_formula: str[source]

Checks if a particular conversion electrode is a sub electrode of the current electrode. Starting from a more lithiated state may result in a subelectrode that is essentially on the same path. For example, a ConversionElectrode formed by starting from an FePO4 composition would be a super_electrode of a ConversionElectrode formed from an LiFePO4 composition.

class ConversionVoltagePair(voltage: float, mAh: float, mass_charge: float, mass_discharge: float, vol_charge: float, vol_discharge: float, frac_charge: float, frac_discharge: float, working_ion_entry: pymatgen.entries.computed_entries.ComputedEntry, framework_formula: str, rxn: pymatgen.analysis.reaction_calculator.BalancedReaction, entries_charge: Iterable[pymatgen.entries.computed_entries.ComputedEntry], entries_discharge: Iterable[pymatgen.entries.computed_entries.ComputedEntry])[source]

Bases: pymatgen.apps.battery.battery_abc.AbstractVoltagePair

A VoltagePair representing a Conversion Reaction with a defined voltage. Typically not initialized directly but rather used by ConversionElectrode. .. attribute:: rxn



BalancedReaction for the step

voltage: float[source]

Voltage for the step

mAh: float[source]

Capacity of the step

vol_charge: float[source]

Volume of charged state

vol_discharge: float[source]

Volume of discharged state

mass_charge: float[source]

Mass of charged state

mass_discharge: float[source]

Mass of discharged state

frac_charge: float[source]

Fraction of working ion in the charged state

frac_discharge: float[source]

Fraction of working ion in the discharged state

entries_charge: [ComputedEntry][source]

Entries in the charged state

entries_discharge: [ComputedEntry][source]

Entries in discharged state

working_ion_entry: ComputedEntry[source]

Entry of the working ion.

entries_charge: Iterable[ComputedEntry][source]
entries_discharge: Iterable[ComputedEntry][source]
classmethod from_steps(step1, step2, normalization_els, framework_formula=None)[source]

Creates a ConversionVoltagePair from two steps in the element profile from a PD analysis.

  • step1 – Starting step

  • step2 – Ending step

  • normalization_els – Elements to normalize the reaction by. To ensure correct capacities.

rxn: BalancedReaction[source]