(exprs, opt)
return reps, opt.clone({'gens': gens})
Transform expressions into a multinomial form.
Transform expressions into a multinomial form.
Transform expressions into a multinomial form .
def _parallel_dict_from_expr(exprs, opt):
    """Transform expressions into a multinomial form. """
    if opt.expand is not False:
        exprs = [ expr.expand() for expr in exprs ]

    if any(expr.is_commutative is False for expr in exprs):
        raise PolynomialError('non-commutative expressions are not supported')

    if opt.gens:
        reps, gens = _parallel_dict_from_expr_if_gens(exprs, opt)
    else:
        reps, gens = _parallel_dict_from_expr_no_gens(exprs, opt)

    return reps, opt.clone({'gens': gens})
def _parallel_dict_from_expr ( exprs , opt ) : if opt . expand is not False : exprs = [ expr . expand ( ) for expr in exprs ] if any ( expr . is_commutative is False for expr in exprs ) : raise PolynomialError ( 'non-commutative expressions are not supported' ) if opt . gens : reps , gens = _parallel_dict_from_expr_if_gens ( exprs , opt ) else : reps , gens = _parallel_dict_from_expr_no_gens ( exprs , opt ) return reps , opt . clone ( { 'gens' : gens } )