Opened 9 years ago
Closed 5 years ago
#15298 closed defect (fixed)
Two versions of QQ(sqrt{1}) upon startup
Reported by:  Nils Bruin  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, GitHub, GitLab)  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 9 years ago by
comment:2 Changed 9 years ago by
Milestone:  sage6.1 → sage6.2 

comment:3 Changed 8 years ago by
Milestone:  sage6.2 → sage6.3 

comment:4 Changed 8 years ago by
Milestone:  sage6.3 → sage6.4 

comment:5 Changed 5 years ago by
Component:  misc → interfaces 

Milestone:  sage6.4 → sage8.1 
comment:6 Changed 5 years ago by
Authors:  → Frédéric Chapoton 

Branch:  → u/chapoton/15298 
Commit:  → 8aee254fc9fc7f3fc7992ff3e2b223d3d91aa7b4 
Status:  new → needs_review 
comment:7 Changed 5 years ago by
Commit:  8aee254fc9fc7f3fc7992ff3e2b223d3d91aa7b4 → 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 5 years ago by
Reviewers:  → Ralf Stephan 

Doctest fails in qqbar.py which are logical. You can set to positive after adaptation.
comment:9 Changed 5 years ago by
Commit:  cf4d4f8640ba0abee20775c0d386b0ab29e8cfab → 5aa64be9661c799b4fbdcde287d6f18959486719 

Branch pushed to git repo; I updated commit sha1. New commits:
5aa64be  trac 15928 fixing doctests

comment:10 followup: 11 Changed 5 years 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:13 Changed 5 years ago by
Branch:  u/chapoton/15298 → 5aa64be9661c799b4fbdcde287d6f18959486719 

Resolution:  → fixed 
Status:  positive_review → 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.