Ask Your Question
0

Equation in Matrix

asked 2015-08-25 02:24:56 +0100

nur_hamid gravatar image

I have problem in center of Terwilliger Algebra. But, I will explain simple problem for simplicity my problem.

For example, I have matrix

A=Matrix([[a1,a2],[a3,a4]]);

and also I have

B1=Matrix([[1,0],[0,0]]);B2=Matrix([[0,1],[0,0]]);B3=Matrix([[0,0],[1,0]]);B1=Matrix([[0,0],[0,1]]);

These matrix have condition

AB=BA

for any B=B1,B2,B3,B4 If I solve it by hand, it is easy to get a1,a2,a3,a4. But how to do it by sage? Can sage solve it? Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-08-25 03:23:03 +0100

calc314 gravatar image

Here is one approach for this small scale problem.

var('a1,a2,a3,a4')

A=Matrix([[a1,a2],[a3,a4]]);
B1=Matrix([[1,0],[0,0]]);B2=Matrix([[0,1],[0,0]]);B3=Matrix([[0,0],[1,0]]);B1=Matrix([[0,0],[0,1]]);

M=A*B1
N=B1*A

eqtns=[M[i,j]==N[i,j] for i in [0,1] for j in [0,1]]
print eqtns
solve(eqtns,[a1,a2,a3,a4])
edit flag offensive delete link more

Comments

Thanks for your help. It is so helpful. Why do it use [0,1] on for i in [0,1] for j in [0,1]]. Can we save the solution? For example, if we type a2, it will show 0. Thanks

nur_hamid gravatar imagenur_hamid ( 2015-08-25 15:01:32 +0100 )edit

The indices $i,j$ are the indices for your matrix. Sage begins these at 0. So, since these are 2 by 2 matrices, the indices of the entries are 0 and 1.

calc314 gravatar imagecalc314 ( 2015-08-25 16:29:19 +0100 )edit

For my example, the solution is [[a1 == r2, a2 == 0, a3 == 0, a4 == r1]]. So a2 and a3 must be 0 while a1 and a4 can be any real numbers. This is going to be tricky to substitute for a1,a2,a3,a4 since two of them are arbitrary.

calc314 gravatar imagecalc314 ( 2015-08-25 16:32:21 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-08-25 02:24:56 +0100

Seen: 602 times

Last updated: Aug 25 '15