pystencils.sympyextensions.math.normalize_product

pystencils.sympyextensions.math.normalize_product#

pystencils.sympyextensions.math.normalize_product(product)#

Expects a sympy expression that can be interpreted as a product and returns a list of all factors.

Removes sp.Pow nodes that have integer exponent by representing them as single factors in list.

Return type:

List[Expr]

Returns:

  • for a Mul node list of factors (‘args’)

  • for a Pow node with positive integer exponent a list of factors

  • for other node types [product] is returned

Parameters:

product (Expr)