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

Commit

Permalink
sage.rings.number_field: Fix up replacement of is_{Real,Complex}[Doub…
Browse files Browse the repository at this point in the history
…le]Field
  • Loading branch information
Matthias Koeppe committed Oct 2, 2021
1 parent 5b988c6 commit 402dbec
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/sage/rings/number_field/number_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -9945,16 +9945,14 @@ def hilbert_symbol(self, a, b, P = None):
if P.domain() is not self:
raise ValueError("Domain of P (=%s) should be self (=%s) in self.hilbert_symbol" % (P, self))
codom = P.codomain()
from sage.rings.complex_mpfr import is_ComplexField
from sage.rings.complex_interval_field import is_ComplexIntervalField
from sage.rings.real_mpfr import is_RealField
from sage.rings.all import (AA, CDF, QQbar, RDF)
if isinstance(codom, sage.rings.abc.ComplexField) or is_ComplexIntervalField(codom) or \
codom is CDF or codom is QQbar:
from sage.rings.all import (AA, QQbar)
if isinstance(codom, (sage.rings.abc.ComplexField, sage.rings.abc.ComplexDoubleField) or is_ComplexIntervalField(codom) or \
codom is QQbar:
if P(self.gen()).imag() == 0:
raise ValueError("Possibly real place (=%s) given as complex embedding in hilbert_symbol. Is it real or complex?" % P)
return 1
if isinstance(codom, sage.rings.abc.RealField) or codom is RDF or codom is AA:
if isinstance(codom, (sage.rings.abc.RealField, sage.rings.abc.RealDoubleField) or codom is AA:
if P(a) > 0 or P(b) > 0:
return 1
return -1
Expand Down Expand Up @@ -12317,7 +12315,7 @@ def refine_embedding(e, prec=None):
return e

# We first compute all the embeddings at the new precision:
if sage.rings.real_mpfr.isinstance(RC, sage.rings.abc.RealField) or RC in (RDF, RLF):
if isinstance(RC, (sage.rings.abc.RealField, sage.rings.abc.RealDoubleField)) or RC == RLF:
if prec == Infinity:
elist = K.embeddings(sage.rings.qqbar.AA)
else:
Expand Down

0 comments on commit 402dbec

Please sign in to comment.