Opened 7 years ago
Closed 6 years ago
#15571 closed defect (fixed)
Doctest: Incorrect zero test of complex symbolic expressions
Reported by:  mmezzarobba  Owned by:  

Priority:  major  Milestone:  sage6.5 
Component:  symbolics  Keywords:  
Cc:  Merged in:  
Authors:  Ralf Stephan  Reviewers:  KarlDieter Crisman 
Report Upstream:  N/A  Work issues:  
Branch:  9974eef (Commits)  Commit:  9974eef85cab383846b82d39a39c7b5d50da1608 
Dependencies:  Stopgaps: 
Description (last modified by )
This is fixed but needs a doctest:
Yet another example where symbolic expressions are abusively considered equivalent, even though simplify()
has become a bit more careful.
sage: var('a,x') (a, x) sage: assume(a, 'complex') sage: assume(x, 'complex') sage: expr = a^(4*x)  (a^4)^x sage: expr.is_zero() True sage: expr(a=I, x=1/2) 2
Change History (9)
comment:1 Changed 7 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:2 Changed 7 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:3 Changed 6 years ago by
 Milestone changed from sage6.3 to sage6.4
comment:4 Changed 6 years ago by
 Milestone changed from sage6.4 to sageduplicate/invalid/wontfix
 Status changed from new to needs_review
comment:5 Changed 6 years ago by
 Description modified (diff)
 Milestone changed from sageduplicate/invalid/wontfix to sage6.5
 Status changed from needs_review to needs_work
 Summary changed from Incorrect zero test of complex symbolic expressions to Doctest: Incorrect zero test of complex symbolic expressions
comment:6 Changed 6 years ago by
 Branch set to u/rws/doctest__incorrect_zero_test_of_complex_symbolic_expressions
comment:7 Changed 6 years ago by
 Commit set to 9974eef85cab383846b82d39a39c7b5d50da1608
 Status changed from needs_work to needs_review
New commits:
9974eef  15571: add doctest

comment:8 Changed 6 years ago by
 Reviewers set to KarlDieter Crisman
 Status changed from needs_review to positive_review
Indeed, one doesn't have to do any assumption at all to get the 'false' now.
sage: sage: var('a,x') (a, x) sage: (a, x) (a, x) sage: sage: expr = a^(4*x)  (a^4)^x sage: sage: expr.is_zero() False
If you want to remove the second
+ sage: assume(a, 'complex') + sage: assume(x, 'complex')
and then the forget()
which I think is all superfluous, that would be great, but it's fine this way too.
comment:9 Changed 6 years ago by
 Branch changed from u/rws/doctest__incorrect_zero_test_of_complex_symbolic_expressions to 9974eef85cab383846b82d39a39c7b5d50da1608
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Appears to having been fixed and also already included in Sage.