Admittedly, the author of this thread did not consider the case in the
list of targets but when comparing 'conjugate' to 'imag_part' in Sage
I was surprized to see the following results.
sage: Q.<i,j,k> = QuaternionAlgebra(SR, -1, -1)
sage: q = x + a*i + b*j + c*k
x + (-a)*i + (-b)*j + (-c)*k
That's OK but
It seems to me that these are all incorrect. I am not sure exactly
what the coercion to SR is supposed to do in this case. It also does
not make sense to me that the last equality returns True.
On 20 September 2016 at 16:29, Emmanuel Charpentier
> Le mardi 20 septembre 2016 04:02:16 UTC+2, Bill Page a écrit :
>> In keeping with Richard's suggestion, in Sage I think a good
>> _algebraic_ definition of 'real' is
>> bool(x/2+conjugate(x)/2 == x)
> why not bool(SR(x).imag_part()==0) ?
>> sage: def RN(x):
>> ....: try:
>> ....: return bool(x/2+conjugate(x)/2 == x)
>> ....: except:
>> ....: return false
>> which also works whenever conjugate is defined, including
>> sage: assume(x,'real')
>> sage: assume(y,'real')
>> sage: RN(sqrt(x^2+y^2))
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.