(p, DE, coefficientD=False, z=None, basic=False)
return (tuple(N), tuple(S))
Splitting Square-free Factorization

    Given a derivation D on k[t] and p in k[t], returns (N1, ..., Nm)
    and (S1, ..., Sm) in k[t]^m such that p =
    (N1*N2**2*...*Nm**m)*(S1*S2**2*...*Sm**m) is a splitting
    factorization of p and the Ni and Si are square-free and coprime.
Splitting Square-free Factorization
Splitting Square - free Factorization
def splitfactor_sqf(p, DE, coefficientD=False, z=None, basic=False):
    """
    Splitting Square-free Factorization

    Given a derivation D on k[t] and p in k[t], returns (N1, ..., Nm)
    and (S1, ..., Sm) in k[t]^m such that p =
    (N1*N2**2*...*Nm**m)*(S1*S2**2*...*Sm**m) is a splitting
    factorization of p and the Ni and Si are square-free and coprime.
    """
    # TODO: This algorithm appears to be faster in every case
    # TODO: Verify this and splitfactor() for multiple extensions
    kkinv = [1/x for x in DE.T[:DE.level]] + DE.T[:DE.level]
    if z:
        kkinv = [z]

    S = []
    N = []
    p_sqf = p.sqf_list_include()
    if p.is_zero:
        return (((p, 1),), ())

    for pi, i in p_sqf:
        Si = pi.as_poly(*kkinv).gcd(derivation(pi, DE,
            coefficientD=coefficientD,basic=basic).as_poly(*kkinv)).as_poly(DE.t)
        pi = Poly(pi, DE.t)
        Si = Poly(Si, DE.t)
        Ni = pi.exquo(Si)
        if not Si.is_one:
            S.append((Si, i))
        if not Ni.is_one:
            N.append((Ni, i))

    return (tuple(N), tuple(S))
def splitfactor_sqf ( p , DE , coefficientD = False , z = None , basic = False ) : # TODO: This algorithm appears to be faster in every case # TODO: Verify this and splitfactor() for multiple extensions kkinv = [ 1 / x for x in DE . T [ : DE . level ] ] + DE . T [ : DE . level ] if z : kkinv = [ z ] S = [ ] N = [ ] p_sqf = p . sqf_list_include ( ) if p . is_zero : return ( ( ( p , 1 ) , ) , ( ) ) for pi , i in p_sqf : Si = pi . as_poly ( * kkinv ) . gcd ( derivation ( pi , DE , coefficientD = coefficientD , basic = basic ) . as_poly ( * kkinv ) ) . as_poly ( DE . t ) pi = Poly ( pi , DE . t ) Si = Poly ( Si , DE . t ) Ni = pi . exquo ( Si ) if not Si . is_one : S . append ( ( Si , i ) ) if not Ni . is_one : N . append ( ( Ni , i ) ) return ( tuple ( N ) , tuple ( S ) )