Opened 3 years ago

Closed 3 years ago

#25210 closed enhancement (fixed)

Add option to make QQbar / AA print using radicals

Reported by: gh-BrentBaccala Owned by:
Priority: minor Milestone: sage-8.3
Component: algebra Keywords: AlgebraicField, QQbar, AA
Cc: Merged in:
Authors: Brent Baccala Reviewers: Sébastien Labbé
Report Upstream: N/A Work issues:
Branch: 4279b0a (Commits, GitHub, GitLab) Commit: 4279b0a51703146f18b871a74c0eb6c893fb78d3
Dependencies: Stopgaps:

Status badges

Description

Add an option to make elements in QQbar / AA print using radical format:

sage: AA(19).sqrt()
4.358898943540674?
sage: QQbar.zeta(6)
0.500000000000000? + 0.866025403784439?*I

sage: AA.options.display_format = 'radical'

sage: AA(19).sqrt()
sqrt(19)
sage: QQbar.zeta(6)
1/2*I*sqrt(3) + 1/2

Change History (12)

comment:1 Changed 3 years ago by gh-BrentBaccala

  • Authors set to Brent Baccala
  • Branch set to u/gh-BrentBaccala/25210
  • Commit set to 3dcc7e07823e58f9e108c4d7819304bae6bf1050

The patch adds a GlobalOption to the AlgebraicField class allowing the display format to be toggled in the manner shown.


New commits:

a8c8fdaTrac #25210: add AlgebraicField option to print using radicals
3dcc7e0Trac #25210: switch back to 'decimal' format to pass test suite

comment:2 Changed 3 years ago by git

  • Commit changed from 3dcc7e07823e58f9e108c4d7819304bae6bf1050 to bf16d261f23c0c14d06bf1564808b6618746a244

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

bf16d26Merge branch 'u/gh-BrentBaccala/25210' into 8.2.rc3

comment:3 Changed 3 years ago by git

  • Commit changed from bf16d261f23c0c14d06bf1564808b6618746a244 to 09f350f30945049aa43b23ddb0769626aa6c63c5

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

09f350fTrac #25210: avoid infinite recursion

comment:4 Changed 3 years ago by slelievre

Related tickets:

comment:5 Changed 3 years ago by gh-BrentBaccala

  • Status changed from new to needs_review

comment:6 Changed 3 years ago by slabbe

I think you do not need this line anymore:

 from sage.symbolic.ring import SR # Lazy to avoid cyclic dependency

comment:7 Changed 3 years ago by slabbe

  • Reviewers set to Sébastien Labbé
  • Status changed from needs_review to needs_work

Other than that, I get All tests passed on my machine on top of rc3. Thanks for this contribution. I will put AA.options.display_format = 'radical' in my init.sage.

comment:8 Changed 3 years ago by git

  • Commit changed from 09f350f30945049aa43b23ddb0769626aa6c63c5 to 4279b0a51703146f18b871a74c0eb6c893fb78d3

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

4279b0aTrac #25210: remove unnecessary import

comment:9 Changed 3 years ago by gh-BrentBaccala

  • Status changed from needs_work to needs_review

comment:10 Changed 3 years ago by slabbe

  • Status changed from needs_review to positive_review

comment:11 Changed 3 years ago by davidloeffler

  • Milestone changed from sage-8.2 to sage-8.3

comment:12 Changed 3 years ago by vbraun

  • Branch changed from u/gh-BrentBaccala/25210 to 4279b0a51703146f18b871a74c0eb6c893fb78d3
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.