Error in SageMath Code which crash my PC
Hi
W10 , SageMath 8.4, Web Browser Edge or Chrome I report this problem because even if it is a code error on my part(QQ,9,9, is misplaced) it is not normal that it systematically crash my PC.
this little simple program made freeze Chrome (same problem with Edge), and then crashed my PC.
forget()
var('pi_1 pi_2 pi_3 pi_4 pi_5 pi_6 pi_7 pi_8 pi_9')
assume(pi_7 > 0)
assume(pi_8 > 0)
# good
m = matrix(QQ,9,9,[ \
# when I uncomment the line below (and comment the line above), then the browser(Edge or Chrome begin to freeze,
# and after a while my W10 PC crash !!)
# BAD !! Line with ERROR !!!
#m = matrix([ QQ,9,9, \
[1/3 , 5/9 , 0 , 0 , 1/9 , 0 , 0 , 0 , 0 ], \
[ 0 , 1/3 , 0 , 0 , 0 , 0 , 0 , 0 , 2/3 ], \
[ 0 , 0 , 1/3 , 1/3 , 0 , 0 , 1/3 , 0 , 0 ], \
[ 0 , 0 , 1/2 , 1/4 , 0 , 0 , 0 , 1/4 , 0 ], \
[ 0 , 0 , 0 , 0 , 3/4 , 1/4 , 0 , 0 , 0 ], \
[ 0 , 0 , 0 , 0 , 2/3 , 1/3 , 0 , 0 , 0 ], \
[ 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 ], \
[ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 ], \
[ 0 , 0 , 2/3 , 0 , 0 , 0 , 0 , 0 , 1/3 ] \
])
v=vector([pi_1,pi_2,pi_3,pi_4,pi_5,pi_6,pi_7,pi_8,pi_9])
eqT=[]
for i in range(0,len(v)):
eqT.append(m[i]*v==v[i])
eqT.append(sum(v)==1)
#eqT.append(pi_7==1)
#eqT.append(pi_8==1)
show(eqT)
S=solve(eqT,pi_1,pi_2,pi_3,pi_4,pi_5,pi_6,pi_7,pi_8,pi_9)
show(S)
I also reported on a Microsoft forum: same post On Microsoft forum
besides I realized that I had privileged Chrome (at the time I had encountered a problem with the display of curves in 3D), but I realized that Edge is faster for the execution of Sagemath code. On the other hand with Edge we no longer have the little hourglass that indicated that the code was executing.
syntax error, the brackets are not right. You are trying to iterate over QQ...
Thank you Frederic . Joking aside, I crashed my PC 3 times in the evening, without seeing the fault of syntax ! . It's just the next morning ,re-reading the code, that I saw the syntax fault ;-)