New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sympy-conversion of complex numbers #28903
Labels
Milestone
Comments
Dependencies: #28891 |
Branch: u/gh-mwageringel/28903 |
Author: Markus Wageringel |
Commit: |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:3
I added another test case:
|
comment:4
LGTM. |
Reviewer: Travis Scrimshaw |
comment:5
9.0 is out |
Changed branch from u/gh-mwageringel/28903 to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This ticket implements conversions to Sympy of elements of
ComplexField
,CDF
andQuadraticNumberField(-1)
. This solves some inconsistencies with the unicode art of symbolic expressions involving complex numbers.Most symbolic expressions use the Sympy symbol
ⅈ
for the unicode art of the imaginary unit, but some do not:The underlying problem is that these complex numbers cannot be converted to Sympy, currently, which is what the
unicode_art
method of symbolic expressions would need. In that case, the fallback is the usual string representation, which does not use the symbolⅈ
. Hence, this is solved by implementing the conversions above.Additionally, this ticket improves the conversion to Sympy of elements of
RealField
by taking into account theprecision
of the field.Note that other implementations of complex numbers (
QQbar
,CIF
,CBF
), that cannot meaningfully by converted to Sympy in general, are not affected by this ticket. For example, the following symbolic expressions still render the same:Depends on #28891
Component: symbolics
Keywords: sympy, unicode_art
Author: Markus Wageringel
Branch/Commit:
a6ed554
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/28903
The text was updated successfully, but these errors were encountered: