Exemplo n.º 1
0
def newton_data(H, exceptional=False):
    r"""Determines the "newton data" associated with each side of the polygon.

    For each side :math:`\Delta` of the Newton polygon of `H` we
    associate the data :math:`(q,m,l,`phi)` where

    .. math::

        \Delta: qj + mi = l \\
        \phi_{\Delta}(t) = \sum_{(i,j) \in \Delta} a_{ij} t^{(i-i_0)/q}

    Here, :math:`a_ij x^j y_i` is a term in the polynomial :math:`H` and
    :math:`i_0` is the smallest value of :math:`i` belonging to the
    polygon side :math:`\Delta`.

    Parameters
    ----------
    H : sympy.Poly
        Polynomial in `x` and `y`.

    Returns
    -------
    list
        A list of the tuples :math:`(q,m,l,\phi)`.
    """
    R = H.parent()
    x, y = R.gens()

    if exceptional:
        newton = newton_polygon_exceptional(H)
    else:
        newton = newton_polygon(H)

    # special case when the newton polygon is a single point
    if len(newton[0]) == 1:
        return []

    # for each side dtermine the corresponding newton data: side slope
    # information and corresponding side characteristic polynomial, phi
    result = []
    for side in newton:
        i0, j0 = side[0]
        i1, j1 = side[1]
        slope = QQ(j1 - j0) / QQ(i1 - i0)
        q = slope.denom()
        m = -slope.numer()
        l = min(q * j0 + m * i0, q * j1 + m * i1)
        phi = sum(
            H.coefficient({
                y: i,
                x: j
            }) * x**((i - i0) / q) for i, j in side)
        phi = phi.univariate_polynomial()
        result.append((q, m, l, phi))
    return result
Exemplo n.º 2
0
def newton_data(H, exceptional=False):
    r"""Determines the "newton data" associated with each side of the polygon.

    For each side :math:`\Delta` of the Newton polygon of `H` we
    associate the data :math:`(q,m,l,`phi)` where

    .. math::

        \Delta: qj + mi = l \\
        \phi_{\Delta}(t) = \sum_{(i,j) \in \Delta} a_{ij} t^{(i-i_0)/q}

    Here, :math:`a_ij x^j y_i` is a term in the polynomial :math:`H` and
    :math:`i_0` is the smallest value of :math:`i` belonging to the
    polygon side :math:`\Delta`.

    Parameters
    ----------
    H : sympy.Poly
        Polynomial in `x` and `y`.

    Returns
    -------
    list
        A list of the tuples :math:`(q,m,l,\phi)`.
    """
    R = H.parent()
    x,y = R.gens()

    if exceptional:
        newton = newton_polygon_exceptional(H)
    else:
        newton = newton_polygon(H)

    # special case when the newton polygon is a single point
    if len(newton[0]) == 1:
        return []

    # for each side dtermine the corresponding newton data: side slope
    # information and corresponding side characteristic polynomial, phi
    result = []
    for side in newton:
        i0,j0 = side[0]
        i1,j1 = side[1]
        slope = QQ(j1-j0)/QQ(i1-i0)
        q = slope.denom()
        m = -slope.numer()
        l = min(q*j0 + m*i0, q*j1 + m*i1)
        phi = sum(H.coefficient({y:i,x:j})*x**((i-i0)/q) for i,j in side)
        phi = phi.univariate_polynomial()
        result.append((q,m,l,phi))
    return result