Skip to content

Commit 6426296

Browse files
committed
Changed number field embedding target to AA
- Avoids possible future issues caused by rounding precision - Seems to be more efficient Amend: Docstring fix
1 parent 6207fc5 commit 6426296

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/sage/algebras/quatalg/quaternion_algebra.py

+14-9
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
from sage.rings.rational_field import is_RationalField, QQ
5656
from sage.rings.infinity import infinity
5757
from sage.rings.number_field.number_field_base import NumberField
58+
from sage.rings.qqbar import AA
5859
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
5960
from sage.rings.power_series_ring import PowerSeriesRing
6061
from sage.structure.category_object import normalize_names
@@ -1235,7 +1236,7 @@ def is_totally_definite(self):
12351236
# Since we need the list of real embeddings of the number field (instead
12361237
# of just the number of them), we avoid a call of the `is_totally_real()`-
12371238
# method by directly comparing the embedding list's length to the degree
1238-
E = F.real_embeddings()
1239+
E = F.embeddings(AA)
12391240
return len(E) == F.degree() and all(F.hilbert_symbol(self._a, self._b, e) == -1
12401241
for e in E)
12411242

@@ -1260,7 +1261,11 @@ def ramified_places(self, inf=True):
12601261
12611262
Additionally, if ``inf`` is set to ``True``, then the Archimedean
12621263
(AKA infinite) places at which the quaternion algebra ramifies are
1263-
also returned, given by real embeddings of the base field.
1264+
also returned, given as
1265+
1266+
- the embeddings of `\QQ` into `\RR` if the base field is `\QQ`, or
1267+
1268+
- the embeddings of the base number field into the Algebraic Real Field.
12641269
12651270
.. NOTE::
12661271
@@ -1296,12 +1301,12 @@ def ramified_places(self, inf=True):
12961301
([],
12971302
[Ring morphism:
12981303
From: Number Field in a with defining polynomial x^2 - 3 with a = 1.732050807568878?
1299-
To: Real Field with 53 bits of precision
1300-
Defn: a |--> -1.73205080756888,
1304+
To: Algebraic Real Field
1305+
Defn: a |--> -1.732050807568878?,
13011306
Ring morphism:
13021307
From: Number Field in a with defining polynomial x^2 - 3 with a = 1.732050807568878?
1303-
To: Real Field with 53 bits of precision
1304-
Defn: a |--> 1.73205080756888])
1308+
To: Algebraic Real Field
1309+
Defn: a |--> 1.732050807568878?])
13051310
13061311
Extending the base field can also get rid of ramification at infinite
13071312
places while still leaving some ramification at finite places::
@@ -1318,8 +1323,8 @@ def ramified_places(self, inf=True):
13181323
([Fractional ideal (2)],
13191324
[Ring morphism:
13201325
From: Number Field in a with defining polynomial x^2 - x - 1
1321-
To: Real Field with 53 bits of precision
1322-
Defn: a |--> -0.618033988749895])
1326+
To: Algebraic Real Field
1327+
Defn: a |--> -0.618033988749895?])
13231328
13241329
The method does not make sense over an arbitrary base ring::
13251330
@@ -1370,7 +1375,7 @@ def ramified_places(self, inf=True):
13701375
return ram_fin
13711376

13721377
# At this point the infinite ramified places also need to be computed
1373-
return ram_fin, [e for e in F.real_embeddings() if F.hilbert_symbol(a, b, e) == -1]
1378+
return ram_fin, [e for e in F.embeddings(AA) if F.hilbert_symbol(a, b, e) == -1]
13741379

13751380
@cached_method
13761381
def ramified_primes(self):

0 commit comments

Comments
 (0)