Skip to content

Commit

Permalink
Rename some CamelCase constructors to snake_case
Browse files Browse the repository at this point in the history
FractionField -> fraction_field
LaurentSeriesField -> laurent_series_field
LaurentSeriesRing -> laurent_series_ring
MatrixSpace -> matrix_space
NumberField -> number_field
PolynomialRing -> polynomial_ring
PowerSeriesRing -> power_series_ring
ResidueField -> residue_field
ResidueRing -> residue_ring
  • Loading branch information
fingolfin committed Feb 23, 2023
1 parent acd3ff2 commit 4910b66
Show file tree
Hide file tree
Showing 93 changed files with 1,900 additions and 1,879 deletions.
26 changes: 13 additions & 13 deletions docs/src/constructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ parent object before one can use it to construct element objects.

AbstractAlgebra.jl provides a set of functions for constructing such parent objects.
For example, to create a parent object for univariate polynomials over the integers,
we use the `PolynomialRing` parent object constructor.
we use the `polynomial_ring` parent object constructor.

```julia
R, x = PolynomialRing(ZZ, "x")
R, x = polynomial_ring(ZZ, "x")
f = x^3 + 3x + 1
g = R(12)
```
Expand All @@ -62,14 +62,14 @@ AbstractAlgebra.jl and explain what mathematical domains they represent.
| $R = \mathbb{Z}$ | `R = ZZ` |
| $R = \mathbb{Q}$ | `R = QQ` |
| $R = \mathbb{F}_{p}$ | `R = GF(p)` |
| $R = \mathbb{Z}/n\mathbb{Z}$ | `R = ResidueRing(ZZ, n)` |
| $S = R[x]$ | `S, x = PolynomialRing(R, "x")` |
| $S = R[x, y]$ | `S, (x, y) = PolynomialRing(R, ["x", "y"])` |
| $S = R[[x]]$ (to precision $n$) | `S, x = PowerSeriesRing(R, n, "x")` |
| $S = R((x))$ (to precision $n$) | `S, x = LaurentSeriesRing(R, n, "x")` |
| $S = K((x))$ (to precision $n$) | `S, x = LaurentSeriesField(K, n, "x")` |
| $S = \mathrm{Frac}_R$ | `S = FractionField(R)` |
| $S = R/(f)$ | `S = ResidueRing(R, f)` |
| $S = R/(f)$ (with $(f)$ maximal) | `S = ResidueField(R, f)` |
| $S = \mathrm{Mat}_{m\times n}(R)$| `S = MatrixSpace(R, m, n)` |
| $S = \mathbb{Q}[x]/(f)$ | `S, a = NumberField(f, "a")` |
| $R = \mathbb{Z}/n\mathbb{Z}$ | `R = residue_ring(ZZ, n)` |
| $S = R[x]$ | `S, x = polynomial_ring(R, "x")` |
| $S = R[x, y]$ | `S, (x, y) = polynomial_ring(R, ["x", "y"])`|
| $S = R[[x]]$ (to precision $n$) | `S, x = power_series_ring(R, n, "x")` |
| $S = R((x))$ (to precision $n$) | `S, x = laurent_series_ring(R, n, "x")` |
| $S = K((x))$ (to precision $n$) | `S, x = laurent_series_field(K, n, "x")` |
| $S = \mathrm{Frac}_R$ | `S = fraction_field(R)` |
| $S = R/(f)$ | `S = residue_ring(R, f)` |
| $S = R/(f)$ (with $(f)$ maximal) | `S = residue_field(R, f)` |
| $S = \mathrm{Mat}_{m\times n}(R)$| `S = matrix_space(R, m, n)` |
| $S = \mathbb{Q}[x]/(f)$ | `S, a = number_field(f, "a")` |
34 changes: 17 additions & 17 deletions docs/src/fraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ In order to construct fractions in AbstractAlgebra.jl, one can first construct t
fraction field itself. This is accomplished with the following constructor.

```julia
FractionField(R::Ring; cached::Bool = true)
fraction_field(R::Ring; cached::Bool = true)
```

Given a base ring `R` return the parent object of the fraction field of $R$. By default
Expand All @@ -62,10 +62,10 @@ resulting parent objects to coerce various elements into the fraction field.
**Examples**

```jldoctest
julia> R, x = PolynomialRing(ZZ, "x")
julia> R, x = polynomial_ring(ZZ, "x")
(Univariate Polynomial Ring in x over Integers, x)
julia> S = FractionField(R)
julia> S = fraction_field(R)
Fraction field of Univariate Polynomial Ring in x over Integers
julia> f = S()
Expand All @@ -92,7 +92,7 @@ FactoredFractionField(R::Ring; cached::Bool = true)
**Examples**

```jldoctest
julia> R, (x, y) = PolynomialRing(ZZ, ["x", "y"])
julia> R, (x, y) = polynomial_ring(ZZ, ["x", "y"])
(Multivariate Polynomial Ring in x, y over Integers, AbstractAlgebra.Generic.MPoly{BigInt}[x, y])
julia> S = FactoredFractionField(R)
Expand Down Expand Up @@ -136,10 +136,10 @@ fraction field without constructing the fraction field parent first.
**Examples**

```jldoctest
julia> R, x = PolynomialRing(QQ, "x")
julia> R, x = polynomial_ring(QQ, "x")
(Univariate Polynomial Ring in x over Rationals, x)
julia> S = FractionField(R)
julia> S = fraction_field(R)
Fraction field of Univariate Polynomial Ring in x over Rationals
julia> f = S(x + 1)
Expand Down Expand Up @@ -183,10 +183,10 @@ characteristic is not known an exception is raised.
**Examples**

```jldoctest
julia> R, x = PolynomialRing(QQ, "x")
julia> R, x = polynomial_ring(QQ, "x")
(Univariate Polynomial Ring in x over Rationals, x)
julia> S = FractionField(R)
julia> S = fraction_field(R)
Fraction field of Univariate Polynomial Ring in x over Rationals
julia> f = S(x + 1)
Expand Down Expand Up @@ -238,10 +238,10 @@ denominator(a::FracElem)
**Examples**

```jldoctest
julia> R, x = PolynomialRing(QQ, "x")
julia> R, x = polynomial_ring(QQ, "x")
(Univariate Polynomial Ring in x over Rationals, x)
julia> S = FractionField(R)
julia> S = fraction_field(R)
Fraction field of Univariate Polynomial Ring in x over Rationals
julia> f = S(x + 1)
Expand Down Expand Up @@ -281,7 +281,7 @@ gcd{T <: RingElem}(::FracElem{T}, ::FracElem{T})
**Examples**

```jldoctest
julia> R, x = PolynomialRing(QQ, "x")
julia> R, x = polynomial_ring(QQ, "x")
(Univariate Polynomial Ring in x over Rationals, x)
julia> f = (x + 1)//(x^3 + 3x + 1)
Expand All @@ -308,10 +308,10 @@ Base.sqrt(::FracElem{T}) where {T <: RingElem}
**Examples**

```jldoctest
julia> R, x = PolynomialRing(QQ, "x")
julia> R, x = polynomial_ring(QQ, "x")
(Univariate Polynomial Ring in x over Rationals, x)
julia> S = FractionField(R)
julia> S = fraction_field(R)
Fraction field of Univariate Polynomial Ring in x over Rationals
julia> a = (21//4*x^6 - 15*x^5 + 27//14*x^4 + 9//20*x^3 + 3//7*x + 9//10)//(x + 3)
Expand Down Expand Up @@ -340,7 +340,7 @@ valuation{T <: RingElem}(::FracElem{T}, ::T)
**Examples**

```jldoctest
julia> R, x = PolynomialRing(ZZ, "x")
julia> R, x = polynomial_ring(ZZ, "x")
(Univariate Polynomial Ring in x over Integers, x)
julia> f = (x + 1)//(x^3 + 3x + 1)
Expand Down Expand Up @@ -370,11 +370,11 @@ rand(R::FracField, v...)

```@repl
using AbstractAlgebra # hide
K = FractionField(ZZ)
K = fraction_field(ZZ)
f = rand(K, -10:10)
R, x = PolynomialRing(ZZ, "x")
S = FractionField(R)
R, x = polynomial_ring(ZZ, "x")
S = fraction_field(R)
g = rand(S, -1:3, -10:10)
```

Expand Down
8 changes: 4 additions & 4 deletions docs/src/ideal.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ contain duplicates, zero entries or be empty.
**Examples**

```jldoctest
julia> R, (x, y) = PolynomialRing(ZZ, ["x", "y"]; ordering=:degrevlex)
julia> R, (x, y) = polynomial_ring(ZZ, ["x", "y"]; ordering=:degrevlex)
(Multivariate Polynomial Ring in x, y over Integers, AbstractAlgebra.Generic.MPoly{BigInt}[x, y])
julia> V = [3*x^2*y - 3*y^2, 9*x^2*y + 7*x*y]
Expand Down Expand Up @@ -92,7 +92,7 @@ gens(::Generic.Ideal{T}) where T <: RingElement
**Examples**

```jldoctest
julia> R, x = PolynomialRing(ZZ, "x")
julia> R, x = polynomial_ring(ZZ, "x")
(Univariate Polynomial Ring in x over Integers, x)
julia> V = [1 + 2x^2 + 3x^3, 5x^4 + 1, 2x - 1]
Expand Down Expand Up @@ -128,7 +128,7 @@ intersection(::Generic.Ideal{T}, ::Generic.Ideal{T}) where T <: RingElement
**Examples**

```jldoctest
julia> R, x = PolynomialRing(ZZ, "x")
julia> R, x = polynomial_ring(ZZ, "x")
(Univariate Polynomial Ring in x over Integers, x)
julia> V = [1 + 2x^2 + 3x^3, 5x^4 + 1, 2x - 1]
Expand Down Expand Up @@ -170,7 +170,7 @@ normal_form(::U, ::Generic.Ideal{U}) where {T <: RingElement, U <: Union{PolyEle
**Examples**

```jldoctest
julia> R, (x, y) = PolynomialRing(ZZ, ["x", "y"]; ordering=:degrevlex)
julia> R, (x, y) = polynomial_ring(ZZ, ["x", "y"]; ordering=:degrevlex)
(Multivariate Polynomial Ring in x, y over Integers, AbstractAlgebra.Generic.MPoly{BigInt}[x, y])
julia> V = [3*x^2*y - 3*y^2, 9*x^2*y + 7*x*y]
Expand Down
14 changes: 7 additions & 7 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ This example makes use of multivariate polynomials.
```julia
using AbstractAlgebra

R, (x, y, z) = PolynomialRing(ZZ, ["x", "y", "z"])
R, (x, y, z) = polynomial_ring(ZZ, ["x", "y", "z"])

f = x + y + z + 1

Expand All @@ -73,11 +73,11 @@ using AbstractAlgebra

R = GF(7)

S, y = PolynomialRing(R, "y")
S, y = polynomial_ring(R, "y")

T = ResidueRing(S, y^3 + 3y + 1)
T = residue_ring(S, y^3 + 3y + 1)

U, z = PolynomialRing(T, "z")
U, z = polynomial_ring(T, "z")

f = (3y^2 + y + 2)*z^2 + (2*y^2 + 1)*z + 4y + 3;

Expand All @@ -95,9 +95,9 @@ Here is an example using matrices.
```julia
using AbstractAlgebra

R, x = PolynomialRing(ZZ, "x")
R, x = polynomial_ring(ZZ, "x")

S = MatrixSpace(R, 10, 10)
S = matrix_space(R, 10, 10)

M = rand(S, 0:3, -10:10);

Expand All @@ -111,7 +111,7 @@ using AbstractAlgebra

R, x = QQ["x"]

S, t = PowerSeriesRing(R, 30, "t")
S, t = power_series_ring(R, 30, "t")

u = t + O(t^100)

Expand Down
Loading

0 comments on commit 4910b66

Please sign in to comment.