numpoly.align_exponents

numpoly.align_exponents(*polys: numpoly.typing.PolyLike)Tuple[numpoly.baseclass.ndpoly, ...][source]

Align polynomials such that the exponents are the same.

Aligning exponents assumes that the indeterminants is also aligned.

Args:
polys:

Polynomial to make adjustment to.

Return:

Same as polys, but internal adjustments made to make them compatible for further operations.

Example:
>>> q0, q1 = numpoly.variable(2)
>>> poly1 = q0*q1
>>> poly2 = numpoly.polynomial([q0**5, q1**3-1])
>>> poly1.exponents
array([[1, 1]], dtype=uint32)
>>> poly2.exponents
array([[0, 0],
       [0, 3],
       [5, 0]], dtype=uint32)
>>> poly1, poly2 = numpoly.align_exponents(poly1, poly2)
>>> poly1
polynomial(q0*q1)
>>> poly2
polynomial([q0**5, q1**3-1])
>>> poly1.exponents
array([[0, 0],
       [0, 3],
       [1, 1],
       [5, 0]], dtype=uint32)
>>> poly2.exponents
array([[0, 0],
       [0, 3],
       [1, 1],
       [5, 0]], dtype=uint32)