@@ -1224,22 +1224,22 @@ rand(K::AnticNumberField, r) = rand(Random.GLOBAL_RNG, K, r)
1224
1224
# ##############################################################################
1225
1225
1226
1226
@doc Markdown. doc"""
1227
- NumberField(f::fmpq_poly, s::AbstractString; cached::Bool = true, check::Bool = true)
1227
+ NumberField(f::fmpq_poly, s::Union{AbstractString, Char, Symbol};
1228
+ cached::Bool = true, check::Bool = true)
1228
1229
1229
1230
Return a tuple $R , x$ consisting of the parent object $R $ and generator $x $
1230
1231
of the number field $\m athbb{Q}[x]/(f)$ where $f $ is the supplied polynomial.
1231
1232
The supplied string `s` specifies how the generator of the number field
1232
1233
should be printed.
1233
1234
"""
1234
- function NumberField (f:: fmpq_poly , s:: AbstractString ; cached:: Bool = true , check:: Bool = true )
1235
- S = Symbol (s)
1236
- parent_obj = AnticNumberField (f, S, cached, check)
1235
+ function NumberField (f:: fmpq_poly , s:: Union{AbstractString, Char, Symbol} ; cached:: Bool = true , check:: Bool = true )
1236
+ parent_obj = AnticNumberField (f, Symbol (s), cached, check)
1237
1237
1238
1238
return parent_obj, gen (parent_obj)
1239
1239
end
1240
1240
1241
1241
@doc Markdown. doc"""
1242
- CyclotomicField(n::Int, s::AbstractString, t = "\$ "; cached = true)
1242
+ CyclotomicField(n::Int, s::Union{ AbstractString, Char, Symbol} = "z_ $n ", t = "_ \$ "; cached = true)
1243
1243
1244
1244
Return a tuple $R , x$ consisting of the parent object $R $ and generator $x $
1245
1245
of the $n $-th cyclotomic field, $\m athbb{Q}(\z eta_n)$. The supplied string
@@ -1248,11 +1248,11 @@ provided, the string `t` specifies how the generator of the polynomial ring
1248
1248
from which the number field is constructed, should be printed. If it is not
1249
1249
supplied, a default dollar sign will be used to represent the variable.
1250
1250
"""
1251
- function CyclotomicField (n:: Int , s:: AbstractString = " z_$n " , t = " _\$ " ; cached = true )
1252
- Zx, x = PolynomialRing (FlintZZ, string ( gensym () ); cached = cached)
1251
+ function CyclotomicField (n:: Int , s:: Union{ AbstractString, Char, Symbol} = " z_$n " , t = " _\$ " ; cached = true )
1252
+ Zx, x = PolynomialRing (FlintZZ, gensym (); cached = cached)
1253
1253
Qx, = PolynomialRing (FlintQQ, t; cached = cached)
1254
1254
f = cyclotomic (n, x)
1255
- C, g = NumberField (Qx (f), s ; cached = cached, check = false )
1255
+ C, g = NumberField (Qx (f), Symbol (s) ; cached = cached, check = false )
1256
1256
set_special (C, :show => show_cyclo, :cyclo => n)
1257
1257
return C, g
1258
1258
end
@@ -1264,7 +1264,7 @@ end
1264
1264
1265
1265
1266
1266
@doc Markdown. doc"""
1267
- CyclotomicRealSubfield(n::Int, s::AbstractString, t = "\$ "; cached = true)
1267
+ CyclotomicRealSubfield(n::Int, s::Union{ AbstractString, Char, Symbol} = "(z_ $n + 1/z_ $n )" , t = "\$ "; cached = true)
1268
1268
1269
1269
Return a tuple $R , x$ consisting of the parent object $R $ and generator $x $
1270
1270
of the totally real subfield of the $n $-th cyclotomic field,
@@ -1274,11 +1274,11 @@ the generator of the polynomial ring from which the number field is
1274
1274
constructed, should be printed. If it is not supplied, a default dollar sign
1275
1275
will be used to represent the variable.
1276
1276
"""
1277
- function CyclotomicRealSubfield (n:: Int , s:: AbstractString = " (z_$n + 1/z_$n )" , t = " \$ " ; cached = true )
1278
- Zx, x = PolynomialRing (FlintZZ, string ( gensym () ); cached = cached)
1277
+ function CyclotomicRealSubfield (n:: Int , s:: Union{ AbstractString, Char, Symbol} = " (z_$n + 1/z_$n )" , t = " \$ " ; cached = true )
1278
+ Zx, x = PolynomialRing (FlintZZ, gensym (); cached = cached)
1279
1279
Qx, = PolynomialRing (FlintQQ, t; cached = cached)
1280
1280
f = cos_minpoly (n, x)
1281
- R, a = NumberField (Qx (f), s ; cached = cached, check = false )
1281
+ R, a = NumberField (Qx (f), Symbol (s) ; cached = cached, check = false )
1282
1282
set_special (R, :show => show_maxreal, :maxreal => n)
1283
1283
return R, a
1284
1284
end
0 commit comments