tuples_to_laurent#

tuples_to_laurent(pairs, variables)#

Reconstruct an expanded SymPy expression from (exponents, coefficient) pairs.

  • pairs: iterable of (exponents, coefficient), where exponents is a tuple of Rationals.

  • variables: the variable order used for the exponent tuples. If a single Symbol is provided, it’s treated as (that_symbol,). If None, variables are inferred from coefficients (useful for constant-only inputs), and exponents must be empty tuples.

Returns:

Expanded SymPy expression equivalent to the original Laurent polynomial/series.

Parameters:
  • pairs (Iterable[tuple[tuple[Rational, ...], Expr]])

  • variables (Iterable[Symbol] | Symbol)

Return type:

Expr