Opened 5 years ago

Closed 17 months ago

#15298 closed defect (fixed)

Two versions of QQ(sqrt{-1}) upon startup

Reported by: nbruin Owned by:
Priority: trivial Milestone: sage-8.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 5 years ago by nbruin

A preliminary test shows that changing rings/qqbar.py:7699 to

QQbar_I_nf = QuadraticField(-1, 'I', embedding=CC.gen(), latex_name='i')

works fine and ensures that there's only one field created upon startup. Note that:

sage: latex(QQbar.0)
\text{\texttt{1*I}}

so it looks like the latex printing will not be affected by this change either.

comment:2 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:3 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:4 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:5 Changed 18 months ago by rws

  • Component changed from misc to interfaces
  • Milestone changed from sage-6.4 to sage-8.1

comment:6 Changed 18 months ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to u/chapoton/15298
  • Commit set to 8aee254fc9fc7f3fc7992ff3e2b223d3d91aa7b4
  • Status changed from new to needs_review

done


New commits:

8aee254trac 15298 only one field for I

comment:7 Changed 18 months ago by git

  • Commit changed from 8aee254fc9fc7f3fc7992ff3e2b223d3d91aa7b4 to cf4d4f8640ba0abee20775c0d386b0ab29e8cfab

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

cf4d4f8trac 15298 only one field for I

comment:8 Changed 18 months ago by rws

  • Reviewers set to Ralf Stephan

Doctest fails in qqbar.py which are logical. You can set to positive after adaptation.

comment:9 Changed 18 months ago by git

  • Commit changed from cf4d4f8640ba0abee20775c0d386b0ab29e8cfab to 5aa64be9661c799b4fbdcde287d6f18959486719

Branch pushed to git repo; I updated commit sha1. New commits:

5aa64betrac 15928 fixing doctests

comment:10 follow-up: Changed 18 months ago by chapoton

Thanks. This introduces a non-uniform 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 18 months ago by rws

Replying to chapoton:

Objection ?

None. Please go ahead.

comment:12 Changed 18 months ago by chapoton

  • Status changed from needs_review to positive_review

then let it be positive

comment:13 Changed 17 months ago by vbraun

  • Branch changed from u/chapoton/15298 to 5aa64be9661c799b4fbdcde287d6f18959486719
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.