RationalFunctionFields.jl is a Julia package for computing with subfield of the rational function field
The package can be installed from the Julia registry by
using Pkg
Pkg.add("RationalFunctionFields")The package can be loaded with
using RationalFunctionFieldsFor our introductory example, we consider a subfield of Nemo for handling polynomials and polynomial ring, so we first create the corresponding polynomial ring.
using Nemo
R, (x, y) = polynomial_ring(QQ, ["x", "y"])Now we can create the our field as follows
F = RationalFunctionField([x^2 + y^2, x^3 + y^3, x^4 + y^4])Function field_contains can be used to check if given elements belong to the field with the given probability of correctness (99% in the call below):
containment = field_contains(F, [x, x + y], 0.99)After this call, containment will be an array of two Booleans false (true (constructive_membership function to which we provide tag_names --- the variables names to be used for the generators
expr, tag_dict = constructive_membership(F, [x + y], tag_names = ["s2", "s3", "s4"])Here expr will be an array containing a single element: the expression of
(-1//4*s2^5 + 1//4*s2^3*s4 + 1//2*s2^2*s3^2 + 1//2*s2*s4^2 - s3^2*s4)//(s2*s3*s4 - s3^3)
The dictionary tag_dict will give the correspondence between the variables s2, s3, and s4 used in the above formula:
Dict{QQMPolyRingElem, AbstractAlgebra.Generic.FracFieldElem{QQMPolyRingElem}} with 3 entries:
s3 => x^3 + y^3
s2 => x^2 + y^2
s4 => x^4 + y^4
At this point, we may suspect that the field is in fact equal to the field of symmetric functions (generated by fields_equal function (again, the result will be correct with probability at least 99% since we provide 0.99 as the last argument):
fields_equal(F, RationalFunctionField([x + y, x * y]), 0.99)Or, the idea to check this equality could have passed by: no problem! We can use function simplified_generating_set which tries to find "a simpler" set of generators for the same field:
simplified_generating_set(F)And, voilà, it returns
2-element Vector{AbstractAlgebra.Generic.FracFieldElem{QQMPolyRingElem}}:
x + y
x*y
The package is maintained by Alexander Demin ([email protected]) and Gleb Pogudin ([email protected]).