(Utility for algebraic equations)
Library of utiltity for algebraic equations
Algebra.MinimalDecompositionField(poly [,fac0]))
Returns
[ext_field, modulus, facts, roots, addelems]
Here the elements are: ext_field the mimimal decomposition field of poly, modulus the irreducible polynomial needed for the decompositions, facts the linear factors of poly over ext_field, roots the roots of poly and addelems the elements to extend the base field to ext_field.
fac0 makes the factorization fast. (facts and fact0 are the instance of Algebra::Factors).
Example:
require "algebra" PQ = Polynomial(Rational, "x") x = PQ.var f = x**4 + 2 field, modulus, facts, roots, addelems = Algebra.MinimalDecompositionField(f) p modulus #=> [a^4 + 2, b^2 + a^2] p facts #=> (x - a)(x + a)(x - b)(x + b) p roots #=> [a, -a, b, -b] p addelems #=> [a, b] fp = Polynomial(field, "x") x = fp.var facts1 = Factors.new(facts.collect{|g, n| [g.call(x), n]}) p facts1.pi == f.convert_to(fp) #=> true
Algebra::Polynomial#minimal_decompositon_field([fact0])
Same as Algebra.MinimalDecompositionField(self [,fact0])).
Algebra.MinimalPolynomial(element, poly1[, poly2[, poly3...]])
Returns the mimimal polynmial of element
by the extention poly1, poly2, poly3...
.
Example: Get the mimimal polymial of the square root of 2 + the square root of 3 + the square root of 5.
PQ = MPolynomial(Rational) a, b, c = PQ.vars("abc") p MinimalPolynomial(a + b + c, a**2-2, b**2-3, c**2-5) #=> x^8 - 40x^6 + 352x^4 - 960x^2 + 576