#10053: Equality testing instead of comparisons in differential forms code
-----------------------------------+----------------------------------------
Reporter: jvkersch | Owner: burcin
Type: defect | Status: needs_review
Priority: major | Milestone:
Component: symbolics | Keywords: forms, comparison, equality
Author: Joris Vankerschaver | Upstream: N/A
Reviewer: Niles Johnson | Merged:
Work_issues: |
-----------------------------------+----------------------------------------
Comment(by jvkersch):
Replying to [comment:7 niles]:
> Does it really!? Thinking more about this last night, I started to
wonder if this is really a bug with comparison of symbolic expressions,
not with differential forms. Before we move on with this, would you mind
doing a little checking to see if converting to strings really is the best
way to compare symbolic expressions? (If it is, then I would say '`==`' is
broken for symbolic expressions.)
As far as I can tell, the comparison code in
`sage/symbolic/expression.pyx` just calls `_richcmp_` in
`sage/structure/element.pyx`, which seems fine. After reading the bug
reports here and in #10041, I thought the issue was that writing anything
like `x == 0` merely defined a symbolic equation (instead of evaluating
directly to something boolean). I could understand this (and I think it
is the intended behavior, no?), so I changed all symbolic comparisons to
comparisons of string expressions, or wrote something like `(lhs -
rhs).is_zero()`, although the latter seems to be slower.
I would love to get to the bottom of this. Specifically, I'm still
confused as to why my original code (comparing tuples of symbolic
variables) seemed to work fine on Mac but gave different answers on Linux.
It feels like it should fail consistently across all platforms :)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10053#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.