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

Commit

Permalink
34212: log embedding as a morphism
Browse files Browse the repository at this point in the history
  • Loading branch information
guojing0 committed Aug 1, 2022
1 parent 6cb6ac8 commit 650dd04
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/sage/rings/number_field/number_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -9293,6 +9293,48 @@ def minkowski_embedding(self, B=None, prec=None):
return sage.matrix.all.matrix(d)

def logarithmic_embedding(self, prec=53):
"""
Return the morphism of ``self`` under the logarithmic embedding
in the category Set.
The logarithmic embedding is defined as a map from the number field ``self`` to `\RR^n`.
It is defined under Definition 4.9.6 in [Cohen1993]_.
INPUT:
- ``prec`` -- desired floating point precision.
OUTPUT:
- a tuple of real numbers.
EXAMPLES::
sage: CF.<a> = CyclotomicField(97)
sage: hom = Hom(CF, EuclideanSpace(1), Sets())
sage: f = hom(logarithmic_embedding(CF(0)))
sage: f(0)
(-1)
sage: f(7)
(1.94591014905531)
::
sage: F.<a> = NumberField(x^3 + 5)
sage: K.<b> = F.extension(x^2 + 2)
sage: hom = Hom(K, EuclideanSpace(2), Sets())
sage: f = hom(logarithmic_embedding(K(0)))
sage: f(0)
(-1, -1)
sage: f(7)
(1.94591014905531, 3.89182029811063)
"""
log_map = self._logarithmic_embedding_helper(prec)
log_hom = Hom(self.base_ring(), EuclideanSpace(len(log_map(0))), Sets())
return log_hom(K(0)._logarithmic_embedding_helper)

def _logarithmic_embedding_helper(self, prec=53):
"""
Return the image of ``self`` under the logarithmic embedding.
Expand Down

0 comments on commit 650dd04

Please sign in to comment.