Skip to content

Commit

Permalink
Merge branch 'master' into UpToDate
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma authored Dec 7, 2023
2 parents 6fa14b2 + caa8888 commit 7f61466
Show file tree
Hide file tree
Showing 57 changed files with 290 additions and 239 deletions.
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Hecke"
uuid = "3e1990a7-5d81-5526-99ce-9ba3ff248f21"
version = "0.22.8"
version = "0.23.0"

[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
Expand Down Expand Up @@ -28,7 +28,7 @@ GAPExt = "GAP"
PolymakeExt = "Polymake"

[compat]
AbstractAlgebra = "0.34"
AbstractAlgebra = "^0.34.4"
Dates = "1.6"
Distributed = "1.6"
GAP = "0.9.6, 0.10"
Expand All @@ -37,7 +37,7 @@ LazyArtifacts = "1.6"
Libdl = "1.6"
LinearAlgebra = "1.6"
Markdown = "1.6"
Nemo = "0.38"
Nemo = "^0.38.2"
Pkg = "1.6"
Polymake = "0.10, 0.11"
Printf = "1.6"
Expand Down
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,32 @@ Here is a quick example of using Hecke:

```julia
julia> using Hecke
...

Welcome to

_ _ _
| | | | | |
| |__| | ___ ___| | _____
| __ |/ _ \/ __| |/ / _ \
| | | | __/ (__| < __/
|_| |_|\___|\___|_|\_\___|
_ _ _
| | | | | |
| |__| | ___ ___| | _____
| __ |/ _ \/ __| |/ / _ \
| | | | __/ (__| < __/
|_| |_|\___|\___|_|\_\___|

Version 0.22.8...
... which comes with absolutely no warranty whatsoever
(c) 2015-2023 by Claus Fieker, Tommy Hofmann and Carlo Sircana

Version 0.10.12...
... which comes with absolutely no warrant whatsoever
(c) 2015-2019 by Claus Fieker, Tommy Hofmann and Carlo Sircana

julia> Qx, x = polynomial_ring(FlintQQ, "x");

julia> f = x^3 + 2;

julia> K, a = number_field(f, "a");

julia> O = maximal_order(K);

julia> O
Maximal order of Number field over Rational Field with defining polynomial x^3 + 2
with basis [1,a,a^2]
Maximal order of Number field of degree 3 over QQ
with basis nf_elem[1, a, a^2]
```
## Documentation
Expand Down
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ nav:
- Misc: misc.md
- Extra features:
- Macros: features/macros.md
- Multi-sets: features/mset.md
- References: 'references.md'
- Examples: 'examples.md'
- Developer:
Expand Down
40 changes: 24 additions & 16 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,48 @@ Here is a quick example of using Hecke:

```julia
julia> using Hecke
...

Welcome to

_ _ _
| | | | | |
| |__| | ___ ___| | _____
| __ |/ _ \/ __| |/ / _ \
| | | | __/ (__| < __/
|_| |_|\___|\___|_|\_\___|
_ _ _
| | | | | |
| |__| | ___ ___| | _____
| __ |/ _ \/ __| |/ / _ \
| | | | __/ (__| < __/
|_| |_|\___|\___|_|\_\___|

Version 0.9.0 ...
Version 0.22.8...
... which comes with absolutely no warranty whatsoever
(c) 2015-2018 by Claus Fieker, Tommy Hofmann and Carlo Sircana
(c) 2015-2023 by Claus Fieker, Tommy Hofmann and Carlo Sircana


julia> Qx, x = polynomial_ring(FlintQQ, "x");

julia> f = x^3 + 2;

julia> K, a = number_field(f, "a");

julia> O = maximal_order(K);

julia> O
Maximal order of Number field over Rational Field with defining polynomial x^3 + 2
with basis [1,a,a^2]
Maximal order of Number field of degree 3 over QQ
with basis nf_elem[1, a, a^2]
```
The documentation of the single functions can also be accessed at the julia prompt. Here is an example:
```
help?> signature
search: signature
help?> absolute_degree
search: absolute_degree absolute_inertia_degree absolute_coordinates is_absolutely_irreducible

absolute_degree(a::FqField)

Return the degree of the given finite field over the prime field.

----------------------------------------------------------------------------
─────────────────────────────────────────────────────────────────────────────────────────────────

signature(O::NfMaximalOrder) -> Tuple{Int, Int}
absolute_degree(L::NumField) -> Int

| Returns the signature of the ambient number field of \mathcal O.
Given a number field L/K, this function returns the degree of L over \mathbf Q.
```
18 changes: 9 additions & 9 deletions docs/src/quad_forms/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ following spaces for the rest of this section:

```@repl 2
using Hecke # hide
K, a = CyclotomicRealSubfield(7);
K, a = cyclotomic_real_subfield(7);
Kt, t = K["t"];
E, b = number_field(t^2-a*t+1, "b");
Q = quadratic_space(K, K[0 1; 1 0])
Expand Down Expand Up @@ -59,7 +59,7 @@ space $H$:

```@repl 2
using Hecke # hide
K, a = CyclotomicRealSubfield(7);
K, a = cyclotomic_real_subfield(7);
Kt, t = K["t"];
E, b = number_field(t^2-a*t+1, "b");
H = hermitian_space(E, 3);
Expand Down Expand Up @@ -96,7 +96,7 @@ Note that the `is_hermitian` function tests whether the space is non-quadratic.

```@repl 2
using Hecke # hide
K, a = CyclotomicRealSubfield(7);
K, a = cyclotomic_real_subfield(7);
Kt, t = K["t"];
E, b = number_field(t^2-a*t+1, "b");
Q = quadratic_space(K, K[0 1; 1 0]);
Expand All @@ -123,7 +123,7 @@ restrict_scalars(::AbstractSpace, ::QQField, ::FieldElem)

```@repl 2
using Hecke # hide
K, a = CyclotomicRealSubfield(7);
K, a = cyclotomic_real_subfield(7);
Kt, t = K["t"];
E, b = number_field(t^2-a*t+1, "b");
Q = quadratic_space(K, K[0 1; 1 0]);
Expand Down Expand Up @@ -160,7 +160,7 @@ of $O_K$ above $7$, one can get:

```@repl 2
using Hecke # hide
K, a = CyclotomicRealSubfield(7);
K, a = cyclotomic_real_subfield(7);
Q = quadratic_space(K, K[0 1; 1 0]);
OK = maximal_order(K);
p = prime_decomposition(OK, 7)[1][1];
Expand Down Expand Up @@ -196,7 +196,7 @@ embed respectively locally or globally into $Q$ or $H$:

```@repl 2
using Hecke # hide
K, a = CyclotomicRealSubfield(7);
K, a = cyclotomic_real_subfield(7);
Kt, t = K["t"];
E, b = number_field(t^2-a*t+1, "b");
Q = quadratic_space(K, K[0 1; 1 0]);
Expand Down Expand Up @@ -247,7 +247,7 @@ orthogonal_projection(::AbstractSpace, ::MatElem)

```@repl 2
using Hecke # hide
K, a = CyclotomicRealSubfield(7);
K, a = cyclotomic_real_subfield(7);
Kt, t = K["t"];
Q = quadratic_space(K, K[0 1; 1 0]);
orthogonal_complement(Q, matrix(K, 1, 2, [1 0]))
Expand All @@ -268,7 +268,7 @@ is_isotropic(::AbstractSpace, p)

```@repl 2
using Hecke # hide
K, a = CyclotomicRealSubfield(7);
K, a = cyclotomic_real_subfield(7);
Kt, t = K["t"];
E, b = number_field(t^2-a*t+1, "b");
H = hermitian_space(E, 3);
Expand All @@ -295,7 +295,7 @@ is_locally_hyperbolic(::HermSpace, ::NfOrdIdl)

```@repl 2
using Hecke # hide
K, a = CyclotomicRealSubfield(7);
K, a = cyclotomic_real_subfield(7);
Kt, t = K["t"];
E, b = number_field(t^2-a*t+1, "b");
H = hermitian_space(E, 3);
Expand Down
2 changes: 1 addition & 1 deletion docs/src/quad_forms/genusherm.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ hermitian_genera(::Hecke.NfRel, ::Int, ::Dict{InfPlc, Int}, ::Union{Hecke.NfRelO

```@repl 2
using Hecke # hide
K, a = CyclotomicRealSubfield(8, "a");
K, a = cyclotomic_real_subfield(8, "a");
Kt, t = K["t"];
E, b = number_field(t^2 - a * t + 1);
p = prime_decomposition(maximal_order(K), 2)[1][1];
Expand Down
23 changes: 18 additions & 5 deletions examples/NFDB.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1175,9 +1175,10 @@ function _p_adic_regulator(K, p)
end
C, mC = completion(K, P, prec)
Rmat = zero_matrix(C, r, r)
D = Dict{nf_elem, LocalFieldElem{qadic, EisensteinLocalField}}()
for i in 1:r
for j in 1:r
Rmat[i, j] = _evaluate_log_of_fac_elem(mC, P, mA(A[i])(mU(U[j + 1]))) # j + 1, because the fundamental units correspond to U[2],..,U[r + 1]
Rmat[i, j] = _evaluate_log_of_fac_elem(mC, P, mA(A[i])(mU(U[j + 1])), D) # j + 1, because the fundamental units correspond to U[2],..,U[r + 1]
end
end
z = _det(Rmat)
Expand All @@ -1189,14 +1190,26 @@ function _p_adic_regulator(K, p)
end
end

function _evaluate_log_of_fac_elem(mC, P, e)
function _evaluate_log_of_fac_elem(mC, P, e::FacElem{nf_elem, AnticNumberField}, D = Dict{nf_elem, LocalFieldElem{qadic, EisensteinLocalField}}())
C = codomain(mC)
K = base_ring(e)
pi = K(uniformizer(P))
# at the moment log() works only for valuation == 0,
# We want to compute
# sum(n * log(mC(pi^(-valuation(b, P)) * b)) for (b, n) in e; init = zero(C))
# but we cache the result of the individual log(), since the elements we look
# at have large intersection for their bases.
#
# At the moment log() works only for valuation == 0,
# but since we have a unit, we can just scale in every factor
l = sum(n * log(mC(pi^(-valuation(b, P)) * b)) for (b, n) in e; init = zero(C))
return l
res = zero(C)
for (b, n) in e
l = get!(D, b) do
bb = mC(pi^(-valuation(b, P)) * b)
return log(bb)
end
res = res + n * l
end
return res
end

function _padic_regulator_non_normal(K, p)
Expand Down
2 changes: 0 additions & 2 deletions src/AlgAss/AlgMat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ basis(A::AlgMat) = A.basis

has_one(A::AlgMat) = true

elem_type(A::AlgMat{T, S}) where { T, S } = AlgMatElem{T, AlgMat{T, S}, S}

elem_type(::Type{AlgMat{T, S}}) where { T, S } = AlgMatElem{T, AlgMat{T, S}, S}

order_type(::AlgMat{QQFieldElem, S}) where { S } = AlgAssAbsOrd{AlgMat{QQFieldElem, S}, elem_type(AlgMat{QQFieldElem, S})}
Expand Down
2 changes: 0 additions & 2 deletions src/AlgAss/AlgQuat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ standard_form(A::AlgQuat) = A.std

has_one(A::AlgQuat) = true

elem_type(A::AlgQuat{T}) where {T} = AlgAssElem{T, AlgQuat{T}}

elem_type(::Type{AlgQuat{T}}) where {T} = AlgAssElem{T, AlgQuat{T}}

is_commutative(A::AlgQuat) = false
Expand Down
2 changes: 0 additions & 2 deletions src/AlgAssAbsOrd/Elem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ export elem_in_algebra

parent_type(::Type{AlgAssAbsOrdElem{S, T}}) where {S, T} = AlgAssAbsOrd{S, T}

parent_type(::AlgAssAbsOrdElem{S, T}) where {S, T} = AlgAssAbsOrd{S, T}

@inline parent(x::AlgAssAbsOrdElem) = x.parent

Base.hash(x::AlgAssAbsOrdElem, h::UInt) = hash(elem_in_algebra(x, copy = false), h)
Expand Down
2 changes: 0 additions & 2 deletions src/AlgAssAbsOrd/Ideal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1447,8 +1447,6 @@ FracIdealSet(O::AlgAssAbsOrd) = IdealSet(O)

elem_type(::Type{AlgAssAbsOrdIdlSet{S, T}}) where {S, T} = AlgAssAbsOrdIdl{S, T}

elem_type(::AlgAssAbsOrdIdlSet{S, T}) where {S, T} = AlgAssAbsOrdIdl{S, T}

parent_type(::Type{AlgAssAbsOrdIdl{S, T}}) where {S, T} = AlgAssAbsOrdIdlSet{S, T}

function Base.one(S::AlgAssAbsOrdIdlSet)
Expand Down
4 changes: 1 addition & 3 deletions src/AlgAssAbsOrd/Order.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
export algebra, integral_group_ring
export algebra, ideal_type, integral_group_ring

add_assertion_scope(:AlgAssOrd)
add_verbosity_scope(:AlgAssOrd)

elem_type(::AlgAssAbsOrd{S, T}) where {S, T} = AlgAssAbsOrdElem{S, T}

elem_type(::Type{AlgAssAbsOrd{S, T}}) where {S, T} = AlgAssAbsOrdElem{S, T}

ideal_type(::AlgAssAbsOrd{S, T}) where {S, T} = AlgAssAbsOrdIdl{S, T}
Expand Down
2 changes: 0 additions & 2 deletions src/AlgAssRelOrd/Elem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export trred

parent_type(::Type{AlgAssRelOrdElem{S, T, U}}) where {S, T, U} = AlgAssRelOrd{S, T, U}

parent_type(::AlgAssRelOrdElem{S, T, U}) where {S, T, U} = AlgAssRelOrd{S, T, U}

@doc raw"""
parent(x::AlgAssRelOrdElem) -> AlgAssRelOrd
Expand Down
4 changes: 1 addition & 3 deletions src/AlgAssRelOrd/Order.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export is_commutative, trred_matrix, any_order, pmaximal_overorder, phereditary_overorder, is_maximal

elem_type(::AlgAssRelOrd{S, T, U}) where {S, T, U} = AlgAssRelOrdElem{S, T, U}
export is_commutative, trred_matrix, any_order, pmaximal_overorder, phereditary_overorder, is_maximal, ideal_type

elem_type(::Type{AlgAssRelOrd{S, T, U}}) where {S, T, U} = AlgAssRelOrdElem{S, T, U}

Expand Down
4 changes: 0 additions & 4 deletions src/EllCrv/EllCrv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -775,10 +775,6 @@ end
#
################################################################################

function elem_type(E::EllCrv{T}) where T
return EllCrvPt{T}
end

function elem_type(::Type{EllCrv{T}}) where T
return EllCrvPt{T}
end
Expand Down
2 changes: 0 additions & 2 deletions src/FunField/HessQR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ function Hecke.denominator(a::Generic.RationalFunctionFieldElem, S::HessQR)
return integral_split(a, S)[2]
end

Nemo.elem_type(::HessQR) = HessQRElem
Nemo.elem_type(::Type{HessQR}) = HessQRElem
Nemo.parent_type(::HessQRElem) = HessQR
Nemo.parent_type(::Type{HessQRElem}) = HessQR
Nemo.is_domain_type(::Type{HessQRElem}) = true

Expand Down
4 changes: 0 additions & 4 deletions src/GenOrd/GenOrd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,10 @@ function elem_type(::Type{GenOrd{S, T}}) where {S, T}
return GenOrdElem{elem_type(S), elem_type(T)}
end

elem_type(::O) where {O <: GenOrd} = elem_type(O)

function parent_type(::Type{GenOrdElem{S, T}}) where {S, T}
return GenOrd{parent_type(S), parent_type(T)}
end

parent_type(::OE) where {OE <: GenOrdElem} = parent_type(OE)

# prepare for algebras, which are not domains
is_domain_type(::Type{GenOrdElem{S, T}}) where {S, T} = is_domain_type(S)

Expand Down
2 changes: 0 additions & 2 deletions src/Grp/GenGrp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ end

elem_type(::Type{GrpGen}) = GrpGenElem

elem_type(::GrpGen) = GrpGenElem

Base.hash(G::GrpGenElem, h::UInt) = Base.hash(G.i, h)

Base.hash(G::GrpGen, h::UInt) = UInt(0)
Expand Down
Loading

0 comments on commit 7f61466

Please sign in to comment.