halg-factor-0.6.0.0: Polynomial factorisation algorithms, part of halg computational algebra suite.
Safe HaskellNone
LanguageHaskell2010

Algebra.Ring.Polynomial.Factorise

Synopsis

Factorisation

factorise :: (MonadRandom m, CoeffRing k, FiniteField k, Random k) => Unipol k -> m [(Unipol k, Natural)] Source #

Factorise a polynomial over finite field using Cantor-Zassenhaus algorithm

factorQBigPrime :: MonadRandom m => Unipol Integer -> m (Integer, IntMap (Set (Unipol Integer))) Source #

Factorise the given primitive and square-freeinteger-coefficient polynomial, choosing a large enough prime.

factorHensel :: MonadRandom m => Unipol Integer -> m (Integer, IntMap (Set (Unipol Integer))) Source #

Factorise the given interger-coefficient polynomial by Hensel lifting.

isReducible :: forall k. (FiniteField k, Eq k) => Unipol k -> Bool Source #

Reducibility test for univariate polynomials over finite fields.

Internal helper functions

distinctDegFactor Source #

Arguments

:: forall k. (Eq k, FiniteField k) 
=> Unipol k

Square-free polynomial over finite field.

-> [(Natural, Unipol k)]

Distinct-degree decomposition.

distinctDegFactor f computes the distinct-degree decomposition of the given square-free polynomial over finite field f.

equalDegreeSplitM :: forall k m. (MonadRandom m, Random k, CoeffRing k, FiniteField k) => Unipol k -> Natural -> m (Maybe (Unipol k)) Source #

equalDegreeFactorM :: (Eq k, FiniteField k, MonadRandom m, Random k) => Unipol k -> Natural -> m [Unipol k] Source #

henselStep Source #

Arguments

:: (Eq r, Euclidean r) 
=> r

modulus

-> Unipol r 
-> Unipol r 
-> Unipol r 
-> Unipol r 
-> Unipol r 
-> (Unipol r, Unipol r, Unipol r, Unipol r) 

Given that f = gh (mod m) with sg + th = 1 (mod m) and leadingCoeff f isn't zero divisor mod m, henselStep m f g h s t calculates the unique (g', h', s', t') s.t. f = g' h' (mod m^2), g' = g (mod m), h' = h (mod m), s' = s (mod m), t' = t (mod m), h' monic.

multiHensel Source #

Arguments

:: Natural

prime p

-> Int

iteration count k.

-> Unipol Integer

original polynomial

-> [Unipol Integer]

monic coprime factorisation mod p

-> [Unipol Integer]

coprime factorisation mod p^(2^k).

Monic hensel lifting for many factors.

pthRoot :: forall r. (CoeffRing r, FiniteField r) => Unipol r -> Unipol r Source #

yun :: (CoeffRing r, Field r) => Unipol r -> IntMap (Unipol r) Source #

Yun's method to compute square-free decomposition of a univariate polynomial over field of characteristic \(0\).

Use squareFreeDecompFiniteField for finite fields.

squareFreeDecompFiniteField :: (Eq k, FiniteField k) => Unipol k -> IntMap (Unipol k) Source #

Square-free decomposition of polynomials over a finite field.

Use yun for a polynomials over a field of characteristic zero.