I have a problem when simplifying a symbolic expression in sympy when having a trigonometric function and a complex exponent, namely I just assumed a different definition of tan function, and I have a weird thing going on. So I do: Symbolic variable sym.simplify(test2) is equal to -tan(a) and normaly test1 variable should be equal to 0, however when I
Tag: complex-numbers
Solving linear equation of complex matrices
I have a linear equation of a form ax=b where b is a complex matrix, and a is a real matrix. I’m expecting solution x to be a complex vector. When trying the numpy.linalg.solve(a,b) function, I’m getting this warning: ComplexWarning: Casting complex values to real discards the imaginary part How do I solve this equation to preserve the complex numbers?
Python 3 – Gaussian divisors of a Gaussian integer
I’m trying to write a method to generate a sequence of Gaussian divisors of a Gaussian integer – a Gaussian integer is either a normal integer or a complex number g = a + bi where a and b are both integers, and a Gaussian divisor of a Gaussian integer g is a Gaussian integer d such that g /