Opened 6 years ago

Last modified 3 years ago

#14602 new defect

Symbolic expression to number fields

Reported by: vdelecroix Owned by: davidloeffler
Priority: major Milestone: sage-6.4
Component: number fields Keywords:
Cc: vdelecroix, mkoeppe Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by vdelecroix)

The ticket stands to improve the AlgebraicConverter in sage.symbolic.expression_converters and make it works with number fields.

As mentioned on ask the following fails

sage: K = QuadraticField(3)
sage: K(sqrt(3))
Traceback (most recent call last):
...
TypeError: ...

The following gives an answer with a wrong parent

sage: x = K(3)**(1/2); x
sqrt(3)
sage: a.parent()
Symbolic Ring

while it is possible to do

sage: y = K(3).sqrt(); y
a
sage: y == K.gen()
True

Finally, we hopefully have

sage: K.gen() == sqrt(3)
sqrt(3) == sqrt(3)
sage: bool(K.gen() == sqrt(3))
True

Change History (6)

comment:1 Changed 6 years ago by vdelecroix

  • Description modified (diff)

comment:2 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:3 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:4 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:5 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:6 Changed 3 years ago by mkoeppe

  • Cc mkoeppe added
Note: See TracTickets for help on using tickets.