normalize_laurent_polynomial#
- normalize_laurent_polynomial(expr, variables=None, normalize_sign=True)#
Normalize a (Laurent) polynomial up to monomials and ±1.
- Steps:
Shift exponents of selected variables so that all are nonnegative.
Optionally flip overall sign so the leading term has positive coefficient.
- Parameters:
expr (Expr) – SymPy expression (may have negative exponents).
variables (Iterable[Symbol] | None) – Variables to consider. If None, use all free symbols.
normalize_sign (bool) – If True, ensure leading term’s coefficient is positive.
- Returns:
Expr – A canonicalized expression.
- Return type:
Expr