ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 05 Jul 2019 04:05:28 +0200Possible bug in CC needs confirmationhttps://ask.sagemath.org/question/47068/possible-bug-in-cc-needs-confirmation/Hello, Sage community. I just noticed what I believe is a bug in the implementation of `CC`, but I would like to receive confirmation.
When I try the following:
'hello' in RR
I get the natural answer: `False`. However, if I try the same with `CC`:
'hello' in CC
I get the following error message:
NameError: name 'hello' is not defined
Just in case, I am using SageMath v8.8, specifically, the binary version downloaded from the mirrors.
Can somebody confirm this is a bug? Thanks in advance!dsejasFri, 05 Jul 2019 04:05:28 +0200https://ask.sagemath.org/question/47068/Bug with absolute value of a complex variable?https://ask.sagemath.org/question/9838/bug-with-absolute-value-of-a-complex-variable/I perform some analytic calculations involving complex number, in particular complex electric field amplitude. I was quite shocked when I discovered how SAGE handles complex variables.
So, I define a new variable "A" and explicitly say that it is complex. Then I want to find the absolute value of this variable, which is $AA^* = |A|^2$.
sage: var("A", domain="complex")
sage: A*A.conjugate()
A*conjugate(A) # not bad
sage: _.simplify()
A^2 # THIS IS WRONG!
Furthermore we check, if $AA = |A|^2 = AA^*$, and it does!
sage: A*A.conjugate() - A*A # Substract squared A from absolute value of A
-A^2 + A*conjugate(A)
sage: _.simplify()
0 # So SAGE assumes that they are equal
But this is obviously WRONG, since if I assign some number to $A$, then the last test does not result in zero:
sage: A=3+4*i
sage: A*A.conjugate() - A*A
-24*I + 32 # It's not ZERO anymore!
Am I understanding/doing something wrong?ximegSat, 23 Feb 2013 15:38:37 +0100https://ask.sagemath.org/question/9838/