I have a multivariate polynomial in sympy and I'd like to get a list of all the coefficients with the exponent tuples, i.e., for
import sympy
X = [sympy.Symbol(f"x{k}") for k in range(4)]
p = sympy.poly(5 * X[0] ** 2 * X[3] - 2 * X[1] ** 4, X)
# p.all_coeffs() # not possible
I'd want
[(5, (2, 0, 0, 1)), (-2, (0, 4, 0, 0))]
Any hint on how to achieve this?