# Abelian closure of the rationals

The abelian closure $\mathbf{Q}^\text{ab}$ is the maximal abelian extension of $\mathbf{Q}$ inside a fixed algebraic closure and can explicitly described as

$$$\mathbf{Q}^{\mathrm{ab}} = \mathbf{Q}(\zeta_n \mid n \in \mathbf{N}),$$$

the union of all cyclotomic extensions. Here for $n \in \mathbf{N}$ we denote by $\zeta_n$ a primitive $n$-th root of unity.

## Creation of the abelian closure and elements

abelian_closureMethod
abelian_closure(QQ::RationalField)

Return a pair (K, z) consisting of the abelian closure K of the rationals and a generator z that can be used to construct primitive roots of unity in K.

An optional keyword argument sparse can be set to true to switch to a sparse representation. Depending on the application this can be much faster or slower.

Examples

julia> K, z = abelian_closure(QQ);

julia> z(36)
zeta(36)

julia> K, z = abelian_closure(QQ, sparse = true);

julia> z(36)
-zeta(36, 9)*zeta(36, 4)^4 - zeta(36, 9)*zeta(36, 4)

source

Given the abelian closure, the generator can be recovered as follows:

genMethod
gen(M::SubquoModule{T}, i::Int) where T

Return the ith generator of M.

source
atlas_irrationalityFunction
atlas_irrationality([F::AnticNumberField, ]description::String)

Return the value encoded by description. If F is given and is a cyclotomic field that contains the value then the result is in F, if F is not given then the result has type QQAbElem.

description is assumed to have the format defined in J. H. Conway, R. T. Curtis, S. P. Norton, R. A. Parker, R. A. Wilson (1985), Chapter 6, Section 10.

Examples

julia> Oscar.with_unicode() do
show(atlas_irrationality("r5"))
end;
-2*ζ(5)^3 - 2*ζ(5)^2 - 1

julia> atlas_irrationality(CyclotomicField(5), "r5")
-2*z_5^3 - 2*z_5^2 - 1

julia> Oscar.with_unicode() do
show(atlas_irrationality("i"))
end;
ζ(4)

julia> Oscar.with_unicode() do
show(atlas_irrationality("b7*3"))
end;
-ζ(7)^4 - ζ(7)^2 - ζ(7) - 1

julia> Oscar.with_unicode() do
show(atlas_irrationality("3y'''24*13-2&5"))
end;
-5*ζ(24)^7 - 2*ζ(24)^5 + 2*ζ(24)^3 - 3*ζ(24)
source
atlas_descriptionFunction
atlas_description(val::QQAbElem)

Return a string in the format defined in J. H. Conway, R. T. Curtis, S. P. Norton, R. A. Parker, R. A. Wilson (1985), Chapter 6, Section 10, describing val. Applying atlas_irrationality to the result yields val.

Examples

julia> K, z = abelian_closure(QQ);

julia> val = z(5) + z(5)^4;

julia> str = Oscar.atlas_description(val)
"b5"

julia> val == atlas_irrationality(str)
true
source

## Printing

The n-th primitive root of the abelian closure of will by default be printed as z(n). The printing can be manipulated using the following functions:

genMethod
gen(K::QQAbField, s::String)

Return the generator of the abelian closure K that can be used to construct primitive roots of unity. The string s will be used during printing.

source
set_variable!Method
set_variable!(K::QQAbField, s::String)

Change the printing of the primitive n-th root of the abelian closure of the rationals to s(n), where s is the supplied string.

source
get_variableMethod
get_variable(K::QQAbField)

Return the string used to print the primitive n-th root of the abelian closure of the rationals.

source

### Examples

julia> K, z = abelian_closure(QQ);

julia> z(4)
z(4)

julia> ζ = gen(K, "ζ")
Generator of abelian closure of Q

julia> ζ(5) + ζ(3)
ζ(15)^5 + ζ(15)^3

## Reduction to characteristic $p$

reduceMethod
reduce(val::QQAbElem, F::FinField)

Return the element of F that is the $p$-modular reduction of val, where $p$ is the characteristic of F. An exception is thrown if val cannot be reduced modulo $p$ or if the reduction does not lie in F.

Examples

julia> K, z = abelian_closure(QQ);

julia> F = GF(2, 3);

julia> reduce(z(7), F)
o
source