Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify and crossref docstrings for GF and finite_field #1806

Merged
merged 6 commits into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions src/flint/fq_default.jl
Original file line number Diff line number Diff line change
Expand Up @@ -842,16 +842,19 @@ end
###############################################################################

@doc raw"""
finite_field(p::IntegerUnion, d::Int, s::VarName; cached = true, check = true)
finite_field(q::IntegerUnion, s::VarName; cached = true, check = true)
finite_field(f::FqPolyElem, s::VarName; cached = true, check = true)
finite_field(p::IntegerUnion, d::Int, s::VarName = :o; cached::Bool = true, check::Bool = true)
finite_field(q::IntegerUnion, s::VarName = :o; cached::Bool = true, check::Bool = true)
finite_field(f::FqPolyRingElem, s::VarName = :o; cached::Bool = true, check::Bool = true)

Return a tuple $K, a$ consisting of a finite field $K$ of order $q = p^d$ and
algebra generator $x$. The string $s$ is used to designate how the finite field
generator will be printed.
Return a tuple $(K, x)$ of a finite field $K$ of order $q = p^d$, where $p$ is a prime,
and a generator $x$ of $K$ (see [`gen`](@ref) for a definition).
The identifier $s$ is used to designate how the finite field generator will be printed.

If a polynomial $f \in k[X]$ over a finite field $k$ is specified, the relative finite field
$K = k[X]/(f)$ will be constructed as a finite field with base field $k$.
If a polynomial $f \in k[X]$ over a finite field $k$ is specified,
the finite field $K = k[X]/(f)$ will be constructed as a finite
field with base field $k$.

See also [`GF`](@ref) which only returns $K$.

# Examples

Expand Down Expand Up @@ -893,17 +896,19 @@ function finite_field(f::FqPolyRingElem, s::VarName = :o; cached::Bool = true, c
end

@doc raw"""
GF(p::IntegerUnion, d::Int, s::String; cached::Bool, check::Bool)
GF(q::IntegerUnion, s::String; cached::Bool, check::Bool)
GF(f::FqPolyRingElem; s::String; cached::Bool, check::Bool)
GF(p::IntegerUnion, d::Int, s::VarName = :o; cached::Bool = true, check::Bool = true)
GF(q::IntegerUnion, s::VarName = :o; cached::Bool = true, check::Bool = true)
GF(f::FqPolyRingElem, s::VarName = :o; cached::Bool = true, check::Bool = true)

Return a finite field $K$ of order $q = p^d$. The string $s$ is
used to designate how the finite field generator will be printed.
Return a finite field $K$ of order $q = p^d$, where $p$ is a prime.
The identifier $s$ is used to designate how the finite field generator will be printed.

If a polynomial $f \in k[X]$ over a finite field $k$ is specified,
the finite field $K = k[X]/(f)$ will be constructed as a finite
field with base field $k$.

See also [`finite_field`](@ref) which additionally returns a finite field generator of $K$.

# Examples

```jldoctest
Expand All @@ -921,8 +926,8 @@ Finite field of degree 3 over GF(3, 2)
"""
GF

function GF(a::IntegerUnion, s::VarName = :o; cached::Bool = true, check::Bool = true)
return finite_field(a, s; cached = cached, check = check)[1]
function GF(q::IntegerUnion, s::VarName = :o; cached::Bool = true, check::Bool = true)
return finite_field(q, s; cached = cached, check = check)[1]
end

function GF(p::IntegerUnion, d::Int, s::VarName = :o; cached::Bool = true, check::Bool = true)
Expand Down
Loading