def __multidegree(f):
    """
    Computes the multidegree of f.
    """

    mon = f.monomials()
    mon.sort()      # Sorts them with the polynomial ring order
    return mon[-1].degrees()    # The multidegree is the degree of the biggest monomial