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

Uniform base_field_type handling #1706

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/Hecke.jl
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@
embedding_type(x) = embedding_type(typeof(x))
embedding_type(T::DataType) = throw(MethodError(embedding_type, (T,)))

base_field_type(x) = base_field_type(typeof(x))
base_field_type(T::DataType) = throw(MethodError(base_field_type, (T,)))

Check warning on line 560 in src/Hecke.jl

View check run for this annotation

Codecov / codecov/patch

src/Hecke.jl#L559-L560

Added lines #L559 - L560 were not covered by tests

################################################################################
#
Expand Down
4 changes: 0 additions & 4 deletions src/LocalField/LocalField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@ prime(K::LocalField) = prime(base_field(K))
#
################################################################################

base_field_type(K::LocalField{S, T}) where {S <: FieldElem, T <: LocalFieldParameter} = parent_type(S)
base_field_type(::Type{LocalField{S, T}}) where {S <: FieldElem, T <: LocalFieldParameter} = parent_type(S)

elem_type(::Type{LocalField{S, T}}) where {S <: FieldElem, T <: LocalFieldParameter} = LocalFieldElem{S, T}

dense_poly_type(K::LocalField{S, T}) where {S <: FieldElem, T <: LocalFieldParameter} = Generic.Poly{LocalFieldElem{S, T}}
dense_poly_type(::Type{LocalField{S, T}}) where {S <: FieldElem, T <: LocalFieldParameter} = Generic.Poly{LocalFieldElem{S, T}}

################################################################################
#
# Basic predicates
Expand Down
8 changes: 2 additions & 6 deletions src/Map/NumField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,9 @@
#
################################################################################

base_field_type(::AbsSimpleNumField) = QQField
base_field_type(::Type{AbsSimpleNumField}) = QQField

Check warning on line 185 in src/Map/NumField.jl

View check run for this annotation

Codecov / codecov/patch

src/Map/NumField.jl#L185

Added line #L185 was not covered by tests

base_field_type(::AbsNonSimpleNumField) = QQField

base_field_type(::RelSimpleNumField{T}) where {T} = parent_type(T)

base_field_type(::RelNonSimpleNumField{T}) where {T} = parent_type(T)
base_field_type(::Type{AbsNonSimpleNumField}) = QQField

Check warning on line 187 in src/Map/NumField.jl

View check run for this annotation

Codecov / codecov/patch

src/Map/NumField.jl#L187

Added line #L187 was not covered by tests

base_field_type(::Type{RelNonSimpleNumField{T}}) where {T} = parent_type(T)

Expand Down
2 changes: 2 additions & 0 deletions src/Misc/RelFiniteField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
return F.defining_polynomial::dense_poly_type(T)
end

base_field_type(::Type{RelFinField{S}}) where S = parent_type(S)

Check warning on line 59 in src/Misc/RelFiniteField.jl

View check run for this annotation

Codecov / codecov/patch

src/Misc/RelFiniteField.jl#L59

Added line #L59 was not covered by tests

base_field(F::RelFinField{S}) where S= base_ring(F.defining_polynomial)::parent_type(S)

characteristic(F::RelFinField) = characteristic(base_field(F))
Expand Down
Loading