tsundtjo

40 Reputation

2 Badges

17 years, 192 days

MaplePrimes Activity


These are answers submitted by tsundtjo

and such a stupid mistake, thank you :).
ok, I have two lists P and L of matrices in Zp. what I what to do is to take an matrix A from L and take D from P, and multiply D^t*A*D for all D. Then I want to take the matrices that you get from that operation, and put in a list, which I call K[1]. I manage to do this, in not so elegent code, but still, as long as it works I like it. Then, I want to go back to the list L, and pick the next A, and to the same again. The matrices I get from the new A is put i K[2], and so on. And this works fine, but the lists K[1], K[2], ... isn't so nice to access. Below are the code for what I am trying to do, minus the lists P and L, which are made up of 2*2 matrices. C := Matrix([[0, 0], [0, 0]]); B := [seq(Matrix([[0, 0], [0, 0]]), i = 1 .. nops(P))]; K := [seq([], i = 1 .. nops(P))]; for i to p^4 do for j to nops(P) do for j from 1 to nops(P) do Multiply(p, Transpose(p, P[j]), L[i], C); Multiply(p, C, P[j], B[j]); if not member(B[j], K[i]) then K[i] := [op(K[i]), B[j]] end if; end do; K[i] := (ListTools[MakeUnique])(K[i], 1, LinearAlgebra[Equal]) end do;
Got it working :)
ok, now I am feeling stupid, but I can't learn if I don't ask. I have tried to cut and paste all the three different methods into maple, but I can't see any lists? So, help? should I combine this new code with my old, or what is I missing?
Page 1 of 1