normalize_laurent_polynomial#

normalize_laurent_polynomial(expr, variables=None, normalize_sign=True)#

Normalize a (Laurent) polynomial up to monomials and ±1.

Steps:
  1. Shift exponents of selected variables so that all are nonnegative.

  2. 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