Skip to content

Commit

Permalink
Prefer symbols over strings in polynomial_ring (#4133)
Browse files Browse the repository at this point in the history
* Prefer symbols over strings in `polynomial_ring`

* Prefer symbols over strings in poly ring shorthand
  • Loading branch information
lgoettgens authored Sep 24, 2024
1 parent 130dabb commit 6238fc7
Show file tree
Hide file tree
Showing 255 changed files with 1,398 additions and 1,398 deletions.
6 changes: 3 additions & 3 deletions docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Here are some illustrating OSCAR examples:
##### Examples

```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> default_ordering(R)
Expand Down Expand Up @@ -90,7 +90,7 @@ Here are examples which indicate how to recover monomials, terms, and
more from a given polynomial.

```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> f = 3*z^3+2*x*y+1
Expand Down Expand Up @@ -143,7 +143,7 @@ julia> tail(f)
```

```jldoctest
julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"])
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y])
(Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[x, y])
julia> F = free_module(R, 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $f \in \mathbb Z[x]_>$, the notions *leading term*, *leading monomial*, *leading
##### Examples

```jldoctest
julia> R, (x, y) = polynomial_ring(ZZ, ["x", "y"]);
julia> R, (x, y) = polynomial_ring(ZZ, [:x, :y]);
julia> reduce(3*x, [2*x])
x
Expand Down Expand Up @@ -50,7 +50,7 @@ We refer to the textbook [AL94](@cite) for more on this.
##### Examples

```jldoctest
julia> R, (x,y) = polynomial_ring(ZZ, ["x","y"])
julia> R, (x,y) = polynomial_ring(ZZ, [:x,:y])
(Multivariate polynomial ring in 2 variables over ZZ, ZZMPolyRingElem[x, y])
julia> I = ideal(R, [3*x^2*y+7*y, 4*x*y^2-5*x])
Expand Down
8 changes: 4 additions & 4 deletions docs/src/CommutativeAlgebra/GroebnerBases/orderings.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Here are some illustrating examples:
##### Examples

```jldoctest
julia> S, (w, x) = polynomial_ring(QQ, ["w", "x"])
julia> S, (w, x) = polynomial_ring(QQ, [:w, :x])
(Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[w, x])
julia> o = lex([w, x])
Expand All @@ -58,7 +58,7 @@ julia> canonical_matrix(o)
[1 0]
[0 1]
julia> R, (w, x, y, z) = polynomial_ring(QQ, ["w", "x", "y", "z"])
julia> R, (w, x, y, z) = polynomial_ring(QQ, [:w, :x, :y, :z])
(Multivariate polynomial ring in 4 variables over QQ, QQMPolyRingElem[w, x, y, z])
julia> o1 = degrevlex([w, x])
Expand Down Expand Up @@ -314,7 +314,7 @@ In OSCAR, block orderings are obtained by the concatenation of individual order
##### Examples

```jldoctest
julia> R, (w, x, y, z) = polynomial_ring(QQ, ["w", "x", "y", "z"])
julia> R, (w, x, y, z) = polynomial_ring(QQ, [:w, :x, :y, :z])
(Multivariate polynomial ring in 4 variables over QQ, QQMPolyRingElem[w, x, y, z])
julia> o = degrevlex([w, x])*degrevlex([y, z])
Expand Down Expand Up @@ -405,7 +405,7 @@ basis vectors as *lex*, and to the $i > j$ ordering as *invlex*. And, we use the
##### Examples

```jldoctest
julia> R, (w, x, y, z) = polynomial_ring(QQ, ["w", "x", "y", "z"]);
julia> R, (w, x, y, z) = polynomial_ring(QQ, [:w, :x, :y, :z]);
julia> F = free_module(R, 3)
Free module of rank 3 over R
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ is_binomial(f::MPolyRingElem)
is_binomial(I::MPolyIdeal)
```
```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> f = 2*x+y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Given a complex `C`,
##### Examples

```jldoctest
julia> R, (x,) = polynomial_ring(QQ, ["x"]);
julia> R, (x,) = polynomial_ring(QQ, [:x]);
julia> F = free_module(R, 1);
Expand Down Expand Up @@ -86,7 +86,7 @@ with maps multiplied by $(-1)^d$.
##### Examples

```jldoctest
julia> R, (x,) = polynomial_ring(QQ, ["x"]);
julia> R, (x,) = polynomial_ring(QQ, [:x]);
julia> F = free_module(R, 1);
Expand Down Expand Up @@ -150,7 +150,7 @@ is_exact(C::ComplexOfMorphisms{ModuleFP})
##### Examples

```jldoctest
julia> R, (x,) = polynomial_ring(QQ, ["x"]);
julia> R, (x,) = polynomial_ring(QQ, [:x]);
julia> F = free_module(R, 1);
Expand All @@ -162,7 +162,7 @@ julia> a = hom(A, B, [x^2*B[1]]);
julia> b = hom(B, B, [x^2*B[1]]);
julia> R, (x,) = polynomial_ring(QQ, ["x"]);
julia> R, (x,) = polynomial_ring(QQ, [:x]);
julia> C = chain_complex([a, b]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ If `F` is a free `R`-module, then
###### Examples

```jldoctest
julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]);
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> F = free_module(R, 3);
Expand Down Expand Up @@ -114,7 +114,7 @@ Alternatively, directly write the element as a linear combination of basis vecto
##### Examples

```jldoctest
julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]);
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> F = free_module(R, 3);
Expand All @@ -138,7 +138,7 @@ Given an element `f` of a free module `F` over a multivariate polynomial ring w
##### Examples

```jldoctest
julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]);
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> F = free_module(R, 3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ If `M` is a subquotient with ambient free `R`-module `F`, then
##### Examples

```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> F = free_module(R, 1)
Expand Down Expand Up @@ -175,7 +175,7 @@ Alternatively, directly write the element as an $R$-linear combination of genera
##### Examples

```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> F = free_module(R, 1)
Expand Down Expand Up @@ -231,7 +231,7 @@ If this is already clear, it may be convenient to omit the test (`check = false`
##### Examples

```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> F = free_module(R, 1)
Expand Down
26 changes: 13 additions & 13 deletions docs/src/CommutativeAlgebra/affine_algebras.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ If `A=R/I` is the quotient of a multivariate polynomial ring `R` modulo an ideal
###### Examples

```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]);
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> A, _ = quo(R, ideal(R, [y-x^2, z-x^3]));
Expand Down Expand Up @@ -141,7 +141,7 @@ or by directly coercing elements of `R` into `A`.
###### Examples

```jldoctest
julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]);
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> A, p = quo(R, ideal(R, [x^3*y^2-y^3*x^2, x*y^4-x*y^2]));
Expand Down Expand Up @@ -225,7 +225,7 @@ If `a` is an ideal of the affine algebra `A`, then
###### Examples

```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]);
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> A, _ = quo(R, ideal(R, [y-x^2, z-x^3]));
Expand Down Expand Up @@ -359,9 +359,9 @@ kernel(F::AffAlgHom)
###### Examples

```jldoctest
julia> D1, (w, x, y, z) = graded_polynomial_ring(QQ, ["w", "x", "y", "z"]);
julia> D1, (w, x, y, z) = graded_polynomial_ring(QQ, [:w, :x, :y, :z]);
julia> C1, (s,t) = graded_polynomial_ring(QQ, ["s", "t"]);
julia> C1, (s,t) = graded_polynomial_ring(QQ, [:s, :t]);
julia> V1 = [s^3, s^2*t, s*t^2, t^3];
Expand All @@ -383,7 +383,7 @@ Ideal generated by
julia> C2, p2 = quo(D1, twistedCubic);
julia> D2, (a, b, c) = graded_polynomial_ring(QQ, ["a", "b", "c"]);
julia> D2, (a, b, c) = graded_polynomial_ring(QQ, [:a, :b, :c]);
julia> V2 = [p2(w-y), p2(x), p2(z)];
Expand All @@ -403,9 +403,9 @@ Ideal generated by
```

```jldoctest
julia> D3,y = polynomial_ring(QQ, "y" => 1:3);
julia> D3,y = polynomial_ring(QQ, :y => 1:3);
julia> C3, x = polynomial_ring(QQ, "x" => 1:3);
julia> C3, x = polynomial_ring(QQ, :x => 1:3);
julia> V3 = [x[1]*x[2], x[1]*x[3], x[2]*x[3]];
Expand Down Expand Up @@ -441,9 +441,9 @@ is_finite(F::AffAlgHom)
###### Examples

```jldoctest
julia> D, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]);
julia> D, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> S, (a, b, c) = polynomial_ring(QQ, ["a", "b", "c"]);
julia> S, (a, b, c) = polynomial_ring(QQ, [:a, :b, :c]);
julia> C, p = quo(S, ideal(S, [c-b^3]));
Expand Down Expand Up @@ -471,9 +471,9 @@ true
```

```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, [ "x", "y", "z"]);
julia> R, (x, y, z) = polynomial_ring(QQ, [ :x, :y, :z]);
julia> C, (s, t) = polynomial_ring(QQ, ["s", "t"]);
julia> C, (s, t) = polynomial_ring(QQ, [:s, :t]);
julia> V = [s*t, t, s^2];
Expand Down Expand Up @@ -528,7 +528,7 @@ noether_normalization(A::MPolyQuoRing)
###### Examples

```jldoctest; setup = :(Singular.call_interpreter("""system("random", 47);"""))
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]);
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> A, _ = quo(R, ideal(R, [x*y, x*z]));
Expand Down
4 changes: 2 additions & 2 deletions docs/src/CommutativeAlgebra/ideals.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If `I` is an ideal of a multivariate polynomial ring `R`, then
###### Examples

```jldoctest
julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"])
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y])
(Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[x, y])
julia> I = ideal(R, [x, y])^2
Expand Down Expand Up @@ -267,7 +267,7 @@ dehomogenizer(H::Homogenizer)
```

```jldoctest
julia> P, (x, y) = polynomial_ring(QQ, ["x", "y"]);
julia> P, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> I = ideal([x^2+y, x*y+y^2]);
Expand Down
20 changes: 10 additions & 10 deletions docs/src/CommutativeAlgebra/localizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ This reflects the way of creating localizations of quotients of multivariate pol
##### Examples

```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]);
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> P = ideal(R, [x])
Ideal generated by
Expand All @@ -127,11 +127,11 @@ true
```

```jldoctest
julia> T, t = polynomial_ring(QQ, "t");
julia> T, t = polynomial_ring(QQ, :t);
julia> K, a = number_field(2*t^2-1, "a");
julia> R, (x, y) = polynomial_ring(K, ["x", "y"]);
julia> R, (x, y) = polynomial_ring(K, [:x, :y]);
julia> I = ideal(R, [2*x^2-y^3, 2*x^2-y^5])
Ideal generated by
Expand Down Expand Up @@ -180,7 +180,7 @@ multiplicatively closed subset of `R`, and `RQL` is the localization of `RQ` at
##### Examples

```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"])
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z])
(Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z])
julia> P = ideal(R, [x])
Expand Down Expand Up @@ -222,11 +222,11 @@ y^2/z^2
```

```jldoctest
julia> T, t = polynomial_ring(QQ, "t");
julia> T, t = polynomial_ring(QQ, :t);
julia> K, a = number_field(2*t^2-1, "a");
julia> R, (x, y) = polynomial_ring(K, ["x", "y"]);
julia> R, (x, y) = polynomial_ring(K, [:x, :y]);
julia> I = ideal(R, [2*x^2-y^3, 2*x^2-y^5])
Ideal generated by
Expand Down Expand Up @@ -294,7 +294,7 @@ of representing `f` by pairs of elements of `RQ` and not the internal representa
##### Examples

```jldoctest
julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]);
julia> R, (x, y, z) = polynomial_ring(QQ, [:x, :y, :z]);
julia> P = ideal(R, [x])
Ideal generated by
Expand Down Expand Up @@ -330,11 +330,11 @@ true
```

```jldoctest
julia> T, t = polynomial_ring(QQ, "t");
julia> T, t = polynomial_ring(QQ, :t);
julia> K, a = number_field(2*t^2-1, "a");
julia> R, (x, y) = polynomial_ring(K, ["x", "y"]);
julia> R, (x, y) = polynomial_ring(K, [:x, :y]);
julia> I = ideal(R, [2*x^2-y^3, 2*x^2-y^5])
Ideal generated by
Expand Down Expand Up @@ -439,7 +439,7 @@ multivariate polynomial rings is similar..
##### Examples

```jldoctest
julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]);
julia> R, (x, y) = polynomial_ring(QQ, [:x, :y]);
julia> f = x^3+y^4
x^3 + y^4
Expand Down
Loading

0 comments on commit 6238fc7

Please sign in to comment.