materialsproject/reaction-network

PathwaySolver outputs ValueError: not enough values to unpack (expected 2, got 0).

Opened this issue · 0 comments

Hi! Matt
I am trying to predict the pathway of a particular compound (Li7La3Zr2O12 in my case) through PathwaySolver.

# Mining entries from MP
with MPRester("5vsBE0iuy7xKXUFkxule63VZN9BENXyx") as mpr: 
     print(f"Materialsproject version is {mpr.get_database_version()}") 
     entries = mpr.get_entries_in_chemsys("Li-La-Zr-O")

# Finite-temperature entries and filtering
temp = 1000 + 273 #1000℃
gibbs_entries = GibbsEntrySet.from_computed_entries(entries, temp)
filtered_gibbs_entreis = gibbs_entries.filter_by_stability(0.05)

# Define chemical potential
mu_atmo = 8.617e-5*temp*math.log(0.21)

# Enumerating reactions 
rxns_be = BasicEnumerator().enumerate(filtered_gibbs_entreis)
rxns_boe = BasicOpenEnumerator(open_phases=["O2"]).enumerate(filtered_gibbs_entreis)


# Converting closed-system to open-system 
g_rxns_be = rxns_be.set_chempot(open_el=Element("O"), chempot=mu_atmo)
g_rxns_boe = rxns_boe.set_chempot(open_el=Element("O"), chempot=mu_atmo)
g_rxns_be_boe = g_rxns_be.add_rxn_set(g_rxns_boe)
g_rxns_dupli = g_rxns_be_boe.filter_duplicates()

# Build ReactionNetwork
cf = Softplus(temp=temp)
rn = ReactionNetwork(g_rxns_dupli, cf)
rn.build()
rn.graph

# Find pathways
rn.set_precursors(["Li2O", "ZrO2", "La2O3","O2"])
paths = rn.find_pathways(["Li7La3Zr2O12"], k=5)

# PathwaySolver
ps = PathwaySolver(paths, rn.entries, cf)

# Net reaction
product_entries = []
for i in ["Li7La3Zr2O12"]:
    product_entries.append(rn.entries.get_min_entry_by_formula(i))
    
net_rxn = ComputedReaction.balance(rn.precursors, product_entries)
net_rxn

# Solve pathway
balanced_paths = ps.solve(net_rxn, max_num_combos=4, 
                          intermediate_rxn_energy_cutoff=0.0)

At # Solve pathway steps, ValueError occurred follow as:

image

I also tried changing the value of k in rn.find_pathways, but the error was the same.

Is there something I am missing about the use of PathwaySolver.solve() for calling the balance reaction pathways, or what do you think is going on here?