def splitfactor_sqf(p, DE, coefficientD=False, z=None, basic=False):
 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 ) : 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 ) )
splitting square-free factorization given a derivation d on k[t] and p in k[t] .