Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Fix bug in decomposition_type
Browse files Browse the repository at this point in the history
  • Loading branch information
roed314 committed Sep 9, 2022
1 parent 5fb2a6e commit e538c5d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/sage/rings/number_field/number_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -5998,12 +5998,21 @@ def decomposition_type(self, p):
2
sage: M.decomposition_type(Q1)
[(2, 5, 1)]
Check that :trac:`34514` is fixed::
sage: K.<a> = NumberField(x^4 + 18*x^2 - 1)
sage: R.<y> = K[]
sage: L.<b> = K.extension(y^2 + 9*a^3 - 2*a^2 + 162*a - 38)
sage: [L.decomposition_type(i) for i in K.primes_above(3)]
[[(1, 1, 2)], [(1, 1, 2)], [(1, 2, 1)]]
"""
v0 = self.base_ring().valuation(p)
e0 = v0.value_group().gen().denominator()
f0 = v0.residue_field().degree()
# Ideally we would compute f using the degree, but residue fields of relative extensions are currently implemented using polynomial quotient rings (this will hopefully be improved after #28485).
C0 = v0.residue_field().cardinality()
valuations = v0.extensions(self)
ef = [(v.value_group().gen().denominator() // e0, v.residue_field().degree() // f0) for v in valuations]
ef = [(v.value_group().gen().denominator() // e0, v.residue_field().cardinality().exact_log(C0)) for v in valuations]
return sorted([(e, f, g) for ((e, f), g) in Counter(ef).items()])

def gen(self, n=0):
Expand Down

0 comments on commit e538c5d

Please sign in to comment.