Reputation: 2788
I have this matrix obtain from MyMat.eigenvals().keys()
from sympy
(this are eigenvalues from 4D jacobian matrix):
egV = [5728761814608399/400000000000000 + sqrt(116481370240190604554434649577057/100000000000000000000000000000 - 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3) - 542870217167939624258689632311630767295785372177/(20000000000000000000000000000000000000000000*sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))) - 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)))/2 - sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))/2, 5728761814608399/400000000000000 + sqrt(116481370240190604554434649577057/100000000000000000000000000000 - 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3) + 542870217167939624258689632311630767295785372177/(20000000000000000000000000000000000000000000*sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))) - 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)))/2 + sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))/2, 5728761814608399/400000000000000 - sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))/2 - sqrt(116481370240190604554434649577057/100000000000000000000000000000 - 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3) - 542870217167939624258689632311630767295785372177/(20000000000000000000000000000000000000000000*sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))) - 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)))/2, 5728761814608399/400000000000000 - sqrt(116481370240190604554434649577057/100000000000000000000000000000 - 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3) + 542870217167939624258689632311630767295785372177/(20000000000000000000000000000000000000000000*sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))) - 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)))/2 + sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))/2]
I would like to take only the real part so I try to use re()
:
outMat = [re(eg) for eg in egV]
but it return this error :
TypeError: cannot determine truth value of Relational
Upvotes: 1
Views: 1727
Reputation:
The docstring of re
function says
Returns real part of expression. This function performs only elementary analysis and so it will fail to decompose properly more complicated expressions. If completely simplified result is needed then use
Basic.as_real_imag()
or perform complex expansion on instance of this function.
In SymPy 1.3, egV.as_real_imag()
returns a tuple of matrices: real parts and imaginary parts. The imaginary parts are all zeros, which tells us that the eigenvalues are real. Apparently, the presence of I
comes from casus irreducibilis of a cubic equation (the equation has three real roots, but an algebraic formula for them necessarily involves complex numbers).
Upvotes: 1