Opened 16 months ago
Closed 16 months ago
#31628 closed defect (fixed)
fix/improve conversions to QQbar and AA
Reported by:  mmezzarobba  Owned by:  

Priority:  blocker  Milestone:  sage9.3 
Component:  coercion  Keywords:  
Cc:  Merged in:  
Authors:  Marc Mezzarobba, Vincent Delecroix  Reviewers:  Vincent Delecroix, Marc Mezzarobba 
Report Upstream:  N/A  Work issues:  
Branch:  ed19558 (Commits, GitHub, GitLab)  Commit:  ed195584c70c28629ea7ab83557d6fe2877c1f3d 
Dependencies:  Stopgaps: 
Description
 fix conversion from ℚ[i] to
QQbar
(honor complex embeddings)  add implicit coercions from python ints and from number fields with compatible embeddings
Change History (15)
comment:1 Changed 16 months ago by
 Branch set to u/mmezzarobba/31628toqqbar
 Commit set to cf414b6a4e9bd6b56d9a017b5de5af21f0aea561
 Status changed from new to needs_review
comment:2 Changed 16 months ago by
Not sure about that kind of humour:
sage: NF.<sqrt3> = QuadraticField(2) sage: AA(sqrt3) 1.414213562373095?
comment:3 Changed 16 months ago by
 Commit changed from cf414b6a4e9bd6b56d9a017b5de5af21f0aea561 to cf5228bf29d5f3e5bd913c23feec854cdb09abd1
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
cf5228b  new implicit coercions to QQbar and AA

comment:4 Changed 16 months ago by
fixed, thanks
comment:5 Changed 16 months ago by
Conversions always existed I think. Could you doctest more directly what changed, namely
sage: QQbar.has_coerce_map_from(QuadraticField(1))
and
sage: K = NumberField(x^3  2, 'a', embedding=2.**(1/3)) sage: AA.has_coerce_map_from(K)
I will adapt #30518.
comment:6 Changed 16 months ago by
 Commit changed from cf5228bf29d5f3e5bd913c23feec854cdb09abd1 to 6430356bdd45a63ebc847ca1284aac7abaf441d7
Branch pushed to git repo; I updated commit sha1. New commits:
6430356  #31628 one more test

comment:7 Changed 16 months ago by
The first case is already tested by
sage: i + QQbar(2) I + 2 sage: K.<ii> = QuadraticField(1, embedding=ComplexField(13)(0,1)) sage: ii + QQbar(2) I + 2
(better IMO, since it checks that the embedding is respected).
I added the second one so that we have an example or degree >2.
New commits:
6430356  #31628 one more test

comment:8 Changed 16 months ago by
 Reviewers set to Vincent Delecroix
 Status changed from needs_review to positive_review
Parfait. Merci.
comment:9 Changed 16 months ago by
 Priority changed from major to blocker
comment:10 Changed 16 months ago by
 Branch changed from u/mmezzarobba/31628toqqbar to 6430356bdd45a63ebc847ca1284aac7abaf441d7
 Resolution set to fixed
 Status changed from positive_review to closed
comment:11 Changed 16 months ago by
 Commit 6430356bdd45a63ebc847ca1284aac7abaf441d7 deleted
 Resolution fixed deleted
 Status changed from closed to new
sage t long warnlong 45.5 randomseed=0 src/sage/symbolic/expression.pyx # 1 doctest failed sage t long warnlong 45.5 randomseed=0 src/sage/modular/dirichlet.py # 1 doctest failed
comment:12 Changed 16 months ago by
Indeed
File "symbolic/expression.pyx", line 3155, in sage.symbolic.expression.Expression.__nonzero__ Failed example: bool(SR(QQbar(I)) == I) Expected: Traceback (most recent call last): ... TypeError: unsupported operand parent(s)... Got: True
and
sage t long warnlong 45.5 randomseed=0 modular/dirichlet.py ********************************************************************** File "modular/dirichlet.py", line 1593, in sage.modular.dirichlet.DirichletCharacter.kloosterman_sum Failed example: e.kloosterman_sum(5,11) Expected: Traceback (most recent call last): ... NotImplementedError: Kloosterman sums not implemented over this ring Got: 0
comment:13 Changed 16 months ago by
 Branch changed from 6430356bdd45a63ebc847ca1284aac7abaf441d7 to public/31628
 Commit set to ed195584c70c28629ea7ab83557d6fe2877c1f3d
 Status changed from new to needs_review
comment:14 Changed 16 months ago by
 Reviewers changed from Vincent Delecroix to Vincent Delecroix, Marc Mezzarobba
 Status changed from needs_review to positive_review
Thank you Volker and Vincent!
comment:15 Changed 16 months ago by
 Branch changed from public/31628 to ed195584c70c28629ea7ab83557d6fe2877c1f3d
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
New commits:
fix conversion from QQ[i] to QQbar
new implicit coercions to QQbar and AA