HF1_SAGE

890 days ago by Gaebor

a1, a2, a3, a4, a5, a6, a7, a8, a9 = var('a1, a2, a3, a4, a5, a6, a7, a8, a9') b1, b2, b3, b4, b5, b6, b7, b8, b9 = var('b1, b2, b3, b4, b5, b6, b7, b8, b9') c1, c2, c3, c4, c5, c6, c7, c8, c9 = var('c1, c2, c3, c4, c5, c6, c7, c8, c9') def product(A, B): X = A*B X[0,2] = 0 X[2,0] = 0 return X A=matrix([[a1,a2, 0],[a4,a5, a6], [0,a8,a9]]) B=matrix([[b1,b2, 0],[b4,b5, b6], [0,b8,b9]]) C=matrix([[c1,c2, 0],[c4,c5, c6], [0,c8,c9]]) JOBB=product(product(A, B), C) BAL=product(A, product(B, C)) M=JOBB-BAL M.simplify_full() 
       
[        0 -a2*b6*c8         0]
[ a6*b8*c4         0  a4*b2*c6]
[        0 -a8*b4*c2         0]
[        0 -a2*b6*c8         0]
[ a6*b8*c4         0  a4*b2*c6]
[        0 -a8*b4*c2         0]