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

Commit

Permalink
34212: log embedding for number field elements
Browse files Browse the repository at this point in the history
  • Loading branch information
guojing0 committed Jul 25, 2022
1 parent 625ac58 commit 460d5f5
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/sage/rings/number_field/number_field_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4117,6 +4117,34 @@ cdef class NumberFieldElement(FieldElement):
"""
return (self.global_height_non_arch(prec)+self.global_height_arch(prec))/self.number_field().absolute_degree()

def log_embedding(self, x, prec=53):
"""
Return the logarithmic embedding of ``x``.
The logarithmic embedding is a tuple of real embeddings and conjugate
pairs of compelx embeddings.
It is defined under Definition 4.9.6 in [Cohen1993]_.
"""
K = self.base_ring()
K_embeddings = K.places(prec)
r1, r2 = K.signature()
r = r1 + r2 - 1

Reals = RealField(prec)

if x == 0:
return vector([-1 for _ in range(r + 1)])

x_logs = []
for i in range(r1):
sigma = K_embeddings[i]
x_logs.append(Reals(abs(sigma(x))).log())
for i in range(r1, r + 1):
tau = K_embeddings[i]
x_logs.append(2 * Reals(abs(tau(x))).log())

return vector(x_logs)

def numerator_ideal(self):
"""
Return the numerator ideal of this number field element.
Expand Down

0 comments on commit 460d5f5

Please sign in to comment.