Action polynomial rings
An action polynomial ring over the commutative ring $R$ is a polynomial ring
\[S = R[\, (u_i)_J \mid i \in \lbrace 1, \ldots, m \rbrace, J \in \mathbb{Z}_{\geq 0}^n ]\]
in the countably infinitely many jet variables $(u_i)_J$, equipped with $n$ commuting $R$-linear action maps $\sigma_1, \ldots, \sigma_n$, where $m$ and $n$ are positive integers. The symbols $u_1, \ldots, u_m$ are called elementary symbols, the multiindices $J \in \mathbb{Z}_{\geq 0}^n$ are called jets.
The $j$-th action map has the property that, when applied to a jet variable, it increments the $j$-th entry of its jet by one. Depending on the setting it also has further properties, e.g. it is multiplicative for difference polynomial rings and it is a derivation for differential polynomial rings.
In Oscar we provide the action polynomial interface via the abstract types ActionPolyRing{T} <: Ring and ActionPolyRingElem{T} <: RingElem. The type parameter T is the element type of the coefficient ring. All concrete subtypes use the functionality of universal polynomials from the AbstractAlgebra package for polynomial arithmetic, as well as maintaining variables and adding new ones on demand. Any action polynomial ring maintains a sorted list of currently tracked jet variables, that can be accessed and extended by a number of methods, see, e.g., Element Constructors. The jet variables are sorted with respect to a user-defined ranking.
The set of valid jet variables of an action polynomial ring depend only on the integers $m$ and $n$ and are thus known at the time of construction. For reasons of efficiency, we keep the list of tracked jet variables as short as possible and track jet variables only, if necessary. The list of currently tracked jet variables is obtained using gens.
Currently, there are two concrete subtypes available, namely DifferencePolyRing{T} and DifferentialPolyRing{T} with element types DifferencePolyRingElem{T} and DifferentialPolyRingElem{T}. See difference polynomial rings and differential polynomial rings for their unique functionality.
Specifying jet variables
Recall that a jet variable is of the form $(u_i)_J$ with $i \in \lbrace 1, \ldots, m \rbrace$ and $J \in \mathbb{Z}_{\geq 0}^n$. There are four ways in which jet variables can be specified as an input for methods, which can be found below. The first two do not require the jet variable in question to be tracked, the last two do.
- By a tuple consisting of the index
iand the jetJ. - By passing the tuple as separate arguments, starting with the index.
- By passing the index of the jet variable in the list of the currently tracked jet variables.
- By immediately passing the jet variable as an element of an action polynomial ring.
For many methods, e.g. degree or derivative we provide all the above versions, but only record one in this documentation for readability. Usually, we choose the second version from the above list.
Element Constructors
(A::ActionPolyRing)() returns the zero polynomial of the action polynomial ring A. (A::ActionPolyRing)(a::T) where {T<:RingElement} returns a as an element of A, if possible. This can be used for creating constant polynomials.
The next three methods take input arguments specifying a jet variable or a vector of jet variables. After calling one of them, the provided action polynomial ring A will track all jet variables specified.
gen — Method
gen(A::ActionPolyRing, i::Int, jet::Vector{Int})Return the jet variable of the action polynomial ring A specified by i and jet. If this jet variable was untracked, it is tracked afterwards. The jet variable may also be specified by a tuple, see Specifying jet variables. Additionally, the jet variable may also be specified by an integer but the corresponding method gen(A::ActionPolyRing, i::Int) slightly differs in its functionality, as it cannot create new jet variables.
Examples
julia> dpr = differential_polynomial_ring(ZZ, [:a, :b, :c], 4)[1]; gen(dpr, 1, [3,1,0,0])
a[3,1,0,0]
julia> gen(dpr, (1, [3,2,0,0]))
a[3,2,0,0]
julia> gens(dpr)
5-element Vector{DifferentialPolyRingElem{ZZRingElem}}:
a[3,2,0,0]
a[3,1,0,0]
a[0,0,0,0]
b[0,0,0,0]
c[0,0,0,0]This function is part of the experimental code in Oscar. Please read here for more details.
getindex — Method
getindex(A::ActionPolyRing, i::Int, jet::Vector{Int})Alias for gen(A, i, jet).
This function is part of the experimental code in Oscar. Please read here for more details.
gens — Method
gens(A::ActionPolyRing, jet_idxs::Vector{Tuple{Int, Vector{Int}}})Return the jet variables of the action polynomial ring A specified by the entries of jet_idxs as a vector and track all new jet variables.
Examples
julia> dpr = differential_polynomial_ring(ZZ, [:a, :b, :c], 4)[1]; gens(dpr, [(1, [3,1,0,0]), (1, [3,2,0,0])])
2-element Vector{DifferentialPolyRingElem{ZZRingElem}}:
a[3,1,0,0]
a[3,2,0,0]
julia> gens(dpr)
5-element Vector{DifferentialPolyRingElem{ZZRingElem}}:
a[3,2,0,0]
a[3,1,0,0]
a[0,0,0,0]
b[0,0,0,0]
c[0,0,0,0]This function is part of the experimental code in Oscar. Please read here for more details.
Polynomials can be created by applying the usual arithmetic operations, such as +, -, *, and ^, to jet variables.
Generators and variables
gen — Method
gen(A::ActionPolyRing, i::Int)Among the currently tracked jet variables of A, return the i-th largest one.
Examples
julia> dpr = difference_polynomial_ring(ZZ, [:a, :b, :c], 4)[1]; gen(dpr, 2)
b[0,0,0,0]
julia> set_ranking!(dpr; partition = [[0,1,1],[1,0,0]]); gen(dpr, 2)
c[0,0,0,0]This function is part of the experimental code in Oscar. Please read here for more details.
gens — Method
gens(A::ActionPolyRing)Return the currently tracked jet variables of the action polynomial ring A as a vector. The jet variables are sorted with respect to the ranking of A, leading with the largest jet variable.
Examples
julia> dpr = difference_polynomial_ring(ZZ, [:a, :b, :c], 4)[1]; gens(dpr)
3-element Vector{DifferencePolyRingElem{ZZRingElem}}:
a[0,0,0,0]
b[0,0,0,0]
c[0,0,0,0]
julia> set_ranking!(dpr; partition = [[0,1,1],[1,0,0]]); gens(dpr)
3-element Vector{DifferencePolyRingElem{ZZRingElem}}:
b[0,0,0,0]
c[0,0,0,0]
a[0,0,0,0]
julia> gens(dpr, [(1, [1,1,1,1]), (2, [1,1,1,1])]);
julia> gens(dpr)
5-element Vector{DifferencePolyRingElem{ZZRingElem}}:
b[1,1,1,1]
b[0,0,0,0]
c[0,0,0,0]
a[1,1,1,1]
a[0,0,0,0]This function is part of the experimental code in Oscar. Please read here for more details.
vars — Method
vars(p::ActionPolyRingElem)Return the jet variables actually occuring in p as a vector. The jet variables are sorted with respect to the ranking of the action polynomial ring containing p, leading with the largest jet variable.
This function is part of the experimental code in Oscar. Please read here for more details.
leader — Method
We also provide the usual ngens and nvars methods that respectively return the number of currently tracked jet variables.
Basic methods for action polynomial rings
n_elementary_symbols — Method
elementary_symbols — Method
n_action_maps — Method
Iterators
The following iterators are available for elements of action polynomial rings. The entries across the different iterators are guaranteed to match. Moreover, the order of the entries of the iterators depends only on the ranking of the action polynomial ring, leading with the most significant entry.
coefficients — Method
coefficients(p::ActionPolyRingElem)Return an iterator for the coefficients of p with respect to the ranking of the parent of p.
Examples
julia> dpr, (a,b,c) = difference_polynomial_ring(ZZ, [:a, :b, :c], 4; partition = [[0,1,1],[1,0,0]]); f = -2*a*b + a*c + 3*b^2;
julia> cf = coefficients(f)
Coefficients iterator of 3*b[0,0,0,0]^2 - 2*a[0,0,0,0]*b[0,0,0,0] + c[0,0,0,0]*a[0,0,0,0]
julia> collect(cf)
3-element Vector{ZZRingElem}:
3
-2
1This function is part of the experimental code in Oscar. Please read here for more details.
exponents — Method
exponents(p::ActionPolyRingElem)Return an iterator for the exponents of p with respect to the ranking of the parent of p.
Examples
julia> dpr, (a,b,c) = difference_polynomial_ring(ZZ, [:a, :b, :c], 4; partition = [[0,1,1],[1,0,0]]); f = -2*a*b + a*c + 3*b^2;
julia> ef = exponents(f)
Exponents iterator of 3*b[0,0,0,0]^2 - 2*a[0,0,0,0]*b[0,0,0,0] + c[0,0,0,0]*a[0,0,0,0]
julia> collect(ef)
3-element Vector{Vector{Int64}}:
[2, 0, 0]
[1, 0, 1]
[0, 1, 1]This function is part of the experimental code in Oscar. Please read here for more details.
monomials — Method
monomials(p::ActionPolyRingElem)Return an iterator for the monomials of p with respect to the ranking of the parent of p.
Examples
julia> dpr, (a,b,c) = difference_polynomial_ring(ZZ, [:a, :b, :c], 4; partition = [[0,1,1],[1,0,0]]); f = -2*a*b + a*c + 3*b^2;
julia> mf = monomials(f)
Monomials iterator of 3*b[0,0,0,0]^2 - 2*a[0,0,0,0]*b[0,0,0,0] + c[0,0,0,0]*a[0,0,0,0]
julia> collect(mf)
3-element Vector{DifferencePolyRingElem{ZZRingElem}}:
b[0,0,0,0]^2
a[0,0,0,0]*b[0,0,0,0]
a[0,0,0,0]*c[0,0,0,0]This function is part of the experimental code in Oscar. Please read here for more details.
terms — Method
terms(p::ActionPolyRingElem)Return an iterator for the terms of p with respect to the ranking of the parent of p.
Examples
julia> dpr, (a,b,c) = difference_polynomial_ring(ZZ, [:a, :b, :c], 4; partition = [[0,1,1],[1,0,0]]); f = -2*a*b + a*c + 3*b^2;
julia> tf = terms(f)
Terms iterator of 3*b[0,0,0,0]^2 - 2*a[0,0,0,0]*b[0,0,0,0] + c[0,0,0,0]*a[0,0,0,0]
julia> collect(tf)
3-element Vector{DifferencePolyRingElem{ZZRingElem}}:
3*b[0,0,0,0]^2
-2*a[0,0,0,0]*b[0,0,0,0]
a[0,0,0,0]*c[0,0,0,0]This function is part of the experimental code in Oscar. Please read here for more details.
Iterator based methods
The following methods are based on the iterators for elements of action polynomial rings.
Basic access to entries of the iterators:
exponent_vector — Method
Access to the first and last entries:
leading_coefficient — Method
leading_coefficient(p::ActionPolyRingElem{T}) -> TReturn the leading coefficient of the polynomial p, i.e. the coefficient of the first (with respect to the ranking of the action polynomial ring containing it) nonzero term.
This function is part of the experimental code in Oscar. Please read here for more details.
leading_monomial — Method
leading_term — Method
trailing_coefficient — Method
trailing_coefficient(p::MPolyRingElem)Return the trailing coefficient of the polynomial $p$, i.e. the coefficient of the last nonzero term.
sourcetrailing_coefficient(p::ActionPolyRingElem{T}) -> TReturn the trailing coefficient of the polynomial p, i.e. the coefficient of the last (with respect to the ranking of the action polynomial ring containing it) nonzero term, or zero if the polynomial is zero.
This function is part of the experimental code in Oscar. Please read here for more details.
trailing_monomial — Method
trailing_term — Method
Other useful methods:
is_monomial — Method
Miscellaneous
In this subsection, we enumerate methods that might be useful but primarily exists, because they already do for other polynomial types.
Constant polynomials
is_constant — Method
constant_coefficient — Method
constant_coefficient(p::ActionPolyRingElem{T}) -> TReturn the constant coefficient of p. Does not throw an error for the zero polynomial like trailing_coefficient.
This function is part of the experimental code in Oscar. Please read here for more details.
Degree
degree — Method
degree(p::ActionPolyRingElem, i::Int, jet::Vector{Int}) -> IntReturn the degree of the polynomial p in the jet variable specified by i and jet. If this jet variable is valid but still untracked, return $0$. This method allows all versions described in Specifying jet variables.
This function is part of the experimental code in Oscar. Please read here for more details.
degrees — Method
degrees(p::ActionPolyRingElem)Return an array of the degrees of the polynomial p in terms of each jet variable. The jet variables are sorted with respect to the ranking of the action polynomial ring containing p, leading with the largest variable.
This function is part of the experimental code in Oscar. Please read here for more details.
total_degree — Method
Derivative
derivative — Method
derivative(p::ActionPolyRing, i::Int, jet::Vector{Int})Return the derivative of p with respect to the jet variable specified by i and jet. This method allows all versions described in Specifying jet variables.
This function is part of the experimental code in Oscar. Please read here for more details.
Discriminant and resultant
discriminant — Method
resultant — Method
resultant(f::ActionPolyRingElem, g::ActionPolyRingElem, i::Int, jet::Vector{Int})Return the resultant of f and g regarded as univariate polynomials in the jet variable specified by i and jet. This method allows all versions described in Specifying jet variables.
This function is part of the experimental code in Oscar. Please read here for more details.
Evaluation
The following function allows evaluation of a polynomial at all its variables. The result is always in the ring that a product of a coefficient and one of the values belongs to, i.e. if all the values are in the coefficient ring, the result of the evaluation will be too.
evaluate — Method
evaluate(a::ActionPolyRingElem{T}, vals::Vector{V}) where {T <: RingElement, V <: Ringelement}Evaluate the polynomial expression by substituting in the supplied values in the array vals for each of the tracked jet variables. The evaluation will succeed if multiplication is defined between elements of the coefficient ring of a and elements of vals.
This function is part of the experimental code in Oscar. Please read here for more details.
The following functions allow evaluation of a polynomial at some of its variables. Note that the result will be a product of values and an element of the polynomial ring, i.e. even if all the values are in the coefficient ring and all variables are given values, the result will be a constant polynomial, not a coefficient.
evaluate — Method
evaluate(a::ActionPolyRingElem{T}, vars::Vector{Int}, vals::Vector{V}) where {T <: RingElement, V <: Ringelement}Evaluate the polynomial expression by substituting in the supplied values in the array vals for the corresponding jet variables specified by the indices given by the array vars; see Specifying jet variables. The evaluation will succeed if multiplication is defined between elements of the coefficient ring of a and elements of vals.
This function is part of the experimental code in Oscar. Please read here for more details.
evaluate — Method
evaluate(a::PolyT, vars::Vector{PolyT}, vals::Vector{V}) where {PolyT <: ActionPolyRingElem, V <: Ringelement}Evaluate the polynomial expression by substituting in the supplied values in the array vals for the corresponding jet variables from the vector vars; see Specifying jet variables. The evaluation will succeed if multiplication is defined between elements of the coefficient ring of a and elements of vals.
This function is part of the experimental code in Oscar. Please read here for more details.
Univariate polynomials
is_univariate — Method
to_univariate — Method
to_univariate(R::PolyRing{T}, p::ActionPolyRingElem{T}) where {T <: RingElement}Assuming the polynomial p is actually a univariate polynomial, convert the polynomial to a univariate polynomial in the given univariate polynomial ring R. An exception is raised if the polynomial p involves more than one jet variable.
This function is part of the experimental code in Oscar. Please read here for more details.
to_univariate — Method
to_univariate(p::ActionPolyRingElem)Assuming the polynomial p is actually a univariate polynomial in the jet variable x, convert the polynomial to a univariate polynomial in a univariate polynomial ring over the same coefficient ring in the variable x. If p is constant, it is considered to be a polynomial in the largest tracked jet variable of its parent. An exception is raised if the polynomial p involves more than one jet variable.
This function is part of the experimental code in Oscar. Please read here for more details.
univariate_coefficients — Method
univariate_coefficients(p::ActionPolyRingElem, i::Int, jet::Vector{Int})Return the coefficient vector of p regarded as a univariate polynomial in the jet variable specified by i and jet, leading with the constant coefficient. This method allows all versions described in Specifying jet variables.
This function is part of the experimental code in Oscar. Please read here for more details.