#9407: fixed fields for dirichlet characters and conductors and dirichlet
characters for abelian fields
-----------------------------------------------------------+----------------
Reporter: wuthrich | Owner:
davidloeffler
Type: enhancement | Status:
needs_work
Priority: minor | Milestone:
sage-4.6.1
Component: number fields | Keywords:
Dirichlet characters, abelian fields, class field theory
Author: Michael Daub, John Bergdall, Chris Wuthrich | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------------------------------------+----------------
Comment(by fwclarke):
I think the computation of fixed field polynomials can be made fasterusing
Gauss's formula for the products of periods; see Disquisitiones §343
and/or van der Waerden §54. The formula involves only the exponents of
$\zeta$ in the cyclotomic field $\QQ(\zeta)$, so the computation can be
carried out computing only with integers (so any concerns about precision
are avoided).
The code with which I've been testing this follows. I've removed the
requirement that the order d is prime, which is unnecessary, and dealt
separately with the easy cases d = 2 and f = 1.
{{{
def fixed_field_polynomial_new(self):
ZZ = IntegerRing()
n = ZZ(self.conductor())
if not n.is_prime():
raise NotImplementedError, 'the conductor %s is supposed to be
prime' % n
d = self.order()
# check that there will be such a field of degree d inside QQ(zeta_n)
if euler_phi(n) % d != 0:
raise ValueError, 'No field exists because %s does not divide
%s=phi(%s)' % (d,euler_phi(n),n)
f = euler_phi(n)/d
S = PolynomialRing(ZZ, 'x')
if f == 1:
return cyclotomic_polynomial(n, S.gen())
if d == 2:
if n.mod(4) == 1:
s = -1
else:
s = 1
return S([s*(n + s)/4, 1, 1])
# Using the notation of van der Waerden, where $\zeta$ is a primitive
# $n$-root of unity,
# $$
# \eta_i = \sum_{j=0}^{f-1}\zeta^{g^{i+dj}},
# $$
# is represented by eta[i] as the list of exponents.
#
# gen_index is a dictionary such that gen_index[r] = i if the exponent r
# occurs in eta[i]. Thus $\eta^{(r)} = \eta_i$ in van der Waerden's
# notation.
R = IntegerModRing(n)
g = R.unit_gens()[0]
gen_index = {}
eta = []
for i in range(d):
eta.append([])
for j in range(f):
r = g**(i + d*j)
eta[i].append(r)
gen_index[r] = i
# Using Gauss's formula
# $$
# \eta^{(r)}\eta^{(s)} = \sum_{j=0}^{f-1}\eta^{(r+sg^{dj})}
# $$
# (with $r=1$), we construct the matrix representing multiplication by
# $\eta_0=\eta^{(1)}$ with respect to the basis consisting of the
$\eta_i$.
# Its characteristic polynomial generates the field. The element
# $\eta^(0)$=f=-f\sum_{i=0}^{d-1}\eta_i$ is represented by eta_zero.
V = FreeModule(ZZ, d)
eta_zero = V([-f]*d)
m = []
for j in range(d):
v = 0
for e in eta[j]:
try:
s = V.gen(gen_index[1 + e])
except KeyError:
s = eta_zero
v += s
m.append(v)
m = matrix(m)
return m.charpoly(S.0)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9407#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.