# sympy__sympy-21847 # Loki Mode Multi-Agent Patch # Attempts: 1 --- a/sympy/polys/monomials.py +++ b/sympy/polys/monomials.py @@ -127,7 +127,7 @@ def itermonomials(variables, max_degrees, min_degrees=None): for variable in item: if variable != 1: powers[variable] += 1 - if max(powers.values()) >= min_degree: + if sum(powers.values()) >= min_degree: monomials_list_comm.append(Mul(*item)) yield from set(monomials_list_comm) else: @@ -139,7 +139,7 @@ def itermonomials(variables, max_degrees, min_degrees=None): for variable in item: if variable != 1: powers[variable] += 1 - if max(powers.values()) >= min_degree: + if sum(powers.values()) >= min_degree: monomials_list_non_comm.append(Mul(*item)) yield from set(monomials_list_non_comm) else: