Opened 6 years ago
Closed 21 months ago
#15298 closed defect (fixed)
Two versions of QQ(sqrt{1}) upon startup
Reported by:  nbruin  Owned by:  

Priority:  trivial  Milestone:  sage8.1 
Component:  interfaces  Keywords:  
Cc:  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  Ralf Stephan 
Report Upstream:  N/A  Work issues:  
Branch:  5aa64be (Commits)  Commit:  5aa64be9661c799b4fbdcde287d6f18959486719 
Dependencies:  Stopgaps: 
Description
We have two copies upon startup:
sage: import gc sage: Ks=[K for K in gc.get_objects() if ....: isinstance(K,sage.rings.number_field.number_field.NumberField_quadratic)] sage: [latex(k.0) for k in Ks] [i, \sqrt{1}]
I suspect they are coming from
symbolic/pynac.pyx:2046 (in init_pynac_I)
K = QuadraticField(1, 'I', embedding=CC.gen(), latex_name='i')
and from rings/qqbar.py:7699 (in _init_qqbar)
QQbar_I_nf = QuadraticField(1, 'I', embedding=CC.gen())
Should we perhaps both give them the same latex name so that these can be the same field?
Change History (13)
comment:1 Changed 6 years ago by
comment:2 Changed 5 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:3 Changed 5 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:4 Changed 5 years ago by
 Milestone changed from sage6.3 to sage6.4
comment:5 Changed 21 months ago by
 Component changed from misc to interfaces
 Milestone changed from sage6.4 to sage8.1
comment:6 Changed 21 months ago by
 Branch set to u/chapoton/15298
 Commit set to 8aee254fc9fc7f3fc7992ff3e2b223d3d91aa7b4
 Status changed from new to needs_review
comment:7 Changed 21 months ago by
 Commit changed from 8aee254fc9fc7f3fc7992ff3e2b223d3d91aa7b4 to cf4d4f8640ba0abee20775c0d386b0ab29e8cfab
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
cf4d4f8  trac 15298 only one field for I

comment:8 Changed 21 months ago by
 Reviewers set to Ralf Stephan
Doctest fails in qqbar.py which are logical. You can set to positive after adaptation.
comment:9 Changed 21 months ago by
 Commit changed from cf4d4f8640ba0abee20775c0d386b0ab29e8cfab to 5aa64be9661c799b4fbdcde287d6f18959486719
Branch pushed to git repo; I updated commit sha1. New commits:
5aa64be  trac 15928 fixing doctests

comment:10 followup: ↓ 11 Changed 21 months ago by
Thanks. This introduces a nonuniform behaviour for the latex of QQbar elements. Sometimes "i" will still be displayed as sqrt{1}. I propose to keep that issue for another ticket. Objection ?
comment:11 in reply to: ↑ 10 Changed 21 months ago by
comment:12 Changed 21 months ago by
 Status changed from needs_review to positive_review
then let it be positive
comment:13 Changed 21 months ago by
 Branch changed from u/chapoton/15298 to 5aa64be9661c799b4fbdcde287d6f18959486719
 Resolution set to fixed
 Status changed from positive_review to closed
A preliminary test shows that changing rings/qqbar.py:7699 to
works fine and ensures that there's only one field created upon startup. Note that:
so it looks like the latex printing will not be affected by this change either.