- galois.Poly.is_square_free() bool
Determines whether the polynomial
over is square-free.Why is this a method and not a property?
This is a method to indicate it is a computationally expensive task.
- Returns:¶
True
if the polynomial is square-free.
Notes
A square-free polynomial
has no irreducible factors with multiplicity greater than one. Therefore, its canonical factorization isExamples
Generate irreducible polynomials over
.In [1]: GF = galois.GF(3) In [2]: f1 = galois.irreducible_poly(3, 3); f1 Out[2]: Poly(x^3 + 2x + 1, GF(3)) In [3]: f2 = galois.irreducible_poly(3, 4); f2 Out[3]: Poly(x^4 + x + 2, GF(3))
Determine if composite polynomials are square-free over
.In [4]: (f1 * f2).is_square_free() Out[4]: True In [5]: (f1**2 * f2).is_square_free() Out[5]: False