From 8cecaa6988ddbcc26d2c3c04a7909fbed8dcdc72 Mon Sep 17 00:00:00 2001 From: John Abbott Date: Wed, 1 Oct 2025 15:27:54 +0200 Subject: [PATCH 1/3] Improved doc for polynomial ring element constructors --- docs/src/polynomial.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/src/polynomial.md b/docs/src/polynomial.md index 4c77a6a768..9d14d94698 100644 --- a/docs/src/polynomial.md +++ b/docs/src/polynomial.md @@ -95,8 +95,12 @@ the usual ways of constructing an element of a ring. (R::PolyRing)(c::elem_type(R)) (R::PolyRing{T})(a::T) where T <: RingElement ``` +The third constructor above cannot be used to coerce a polynomial from one ring +to another; instead use evaluation, for instance: `f(y)` where `y` is the +generator of the destination polynomial ring. The fourth constructor creates +a constant polynomial from an elements of the coefficient ring. -For polynommials there is also the following more general constructor accepting +For polynomials there is also the following more general constructor accepting an array of coefficients. ```julia From c3d52300d1635090adc998424de2f2b477a8e6c7 Mon Sep 17 00:00:00 2001 From: John Abbott Date: Mon, 6 Oct 2025 11:34:25 +0200 Subject: [PATCH 2/3] Now recommends map_coefficients over evaluation --- docs/src/polynomial.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/src/polynomial.md b/docs/src/polynomial.md index 9d14d94698..c77041ffe5 100644 --- a/docs/src/polynomial.md +++ b/docs/src/polynomial.md @@ -96,9 +96,10 @@ the usual ways of constructing an element of a ring. (R::PolyRing{T})(a::T) where T <: RingElement ``` The third constructor above cannot be used to coerce a polynomial from one ring -to another; instead use evaluation, for instance: `f(y)` where `y` is the -generator of the destination polynomial ring. The fourth constructor creates -a constant polynomial from an elements of the coefficient ring. +to another; instead use a call like `map_coefficients(identity,f; parent=dest_ring))`, +or alternatively, for _small polynomials_ one can simply use evaluation: +namely, `f(y)` where `y` is the generator of the destination polynomial ring. +The fourth constructor creates a constant polynomial from an element of the coefficient ring. For polynomials there is also the following more general constructor accepting an array of coefficients. From 19800b4013d1b57d36b922287c818160dd650e53 Mon Sep 17 00:00:00 2001 From: JohnAAbbott <124266874+JohnAAbbott@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:50:54 +0200 Subject: [PATCH 3/3] Update docs/src/polynomial.md Co-authored-by: Max Horn --- docs/src/polynomial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/polynomial.md b/docs/src/polynomial.md index c77041ffe5..93efb3d789 100644 --- a/docs/src/polynomial.md +++ b/docs/src/polynomial.md @@ -96,7 +96,7 @@ the usual ways of constructing an element of a ring. (R::PolyRing{T})(a::T) where T <: RingElement ``` The third constructor above cannot be used to coerce a polynomial from one ring -to another; instead use a call like `map_coefficients(identity,f; parent=dest_ring))`, +to another; instead use a call like `map_coefficients(identity, f; parent=dest_ring))`, or alternatively, for _small polynomials_ one can simply use evaluation: namely, `f(y)` where `y` is the generator of the destination polynomial ring. The fourth constructor creates a constant polynomial from an element of the coefficient ring.