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

Commit 6fb2387

Browse files
committed
34212: log embedding for relative number field
1 parent f531b93 commit 6fb2387

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

src/sage/rings/number_field/number_field_rel.py

+69
Original file line numberDiff line numberDiff line change
@@ -2062,6 +2062,75 @@ def automorphisms(self):
20622062
check=False, universe=self.Hom(self))
20632063
return self.__automorphisms
20642064

2065+
def logarithmic_embedding(self, prec=53):
2066+
r"""
2067+
Return the morphism of ``self`` under the logarithmic embedding
2068+
in the category Set.
2069+
2070+
The logarithmic embedding is defined as a map from the relative number field ``self`` to `\RR^n`.
2071+
2072+
It is defined under Definition 4.9.6 in [Coh1993]_.
2073+
2074+
INPUT:
2075+
2076+
- ``prec`` -- desired floating point precision.
2077+
2078+
OUTPUT:
2079+
2080+
- the morphism of ``self`` under the logarithmic embedding in the category Set.
2081+
2082+
EXAMPLES::
2083+
2084+
sage: K.<k> = CyclotomicField(3)
2085+
sage: R.<x> = K[]
2086+
sage: L.<l> = K.extension(x^5 + 5)
2087+
sage: f = logarithmic_embedding(L)
2088+
sage: f(0)
2089+
(-1, -1, -1, -1, -1)
2090+
sage: f(5)
2091+
(3.21887582486820, 3.21887582486820, 3.21887582486820,
2092+
3.21887582486820, 3.21887582486820)
2093+
2094+
::
2095+
2096+
sage: K.<i> = NumberField(x^2 + 1)
2097+
sage: t = K['t'].gen()
2098+
sage: L.<a> = K.extension(t^4 - i)
2099+
sage: f = logarithmic_embedding(L)
2100+
sage: f(0)
2101+
(-1, -1, -1, -1, -1, -1, -1, -1)
2102+
sage: f(3)
2103+
(2.19722457733622, 2.19722457733622, 2.19722457733622, 2.19722457733622,
2104+
2.19722457733622, 2.19722457733622, 2.19722457733622, 2.19722457733622)
2105+
"""
2106+
def closure_map(x, prec=53):
2107+
"""
2108+
The function closure of the logarithmic embedding.
2109+
"""
2110+
K = self
2111+
K_embeddings = K.places(prec)
2112+
r1, r2 = K.signature()
2113+
r = r1 + r2 - 1
2114+
2115+
from sage.rings.all import RealField
2116+
Reals = RealField(prec)
2117+
2118+
if x == 0:
2119+
return vector([-1 for _ in range(r + 1)])
2120+
2121+
x_logs = []
2122+
for i in range(r1):
2123+
sigma = K_embeddings[i]
2124+
x_logs.append(Reals(abs(sigma(x))).log())
2125+
for i in range(r1, r + 1):
2126+
tau = K_embeddings[i]
2127+
x_logs.append(2 * Reals(abs(tau(x))).log())
2128+
2129+
return vector(x_logs)
2130+
2131+
hom = Hom(self, VectorSpace(RR, len(closure_map(self(0), prec))), Sets())
2132+
return hom(closure_map)
2133+
20652134
def places(self, all_complex=False, prec=None):
20662135
"""
20672136
Return the collection of all infinite places of self.

0 commit comments

Comments
 (0)