Product of matrices over finite fields

조회 수: 70 (최근 30일)
Adrian
Adrian 2024년 11월 24일 18:26
댓글: Torsten 2024년 11월 26일 1:11
Hi all, can someone please help with the following?
Suppose we have two matrices A and B over the finite field F_2, such that:
A*B=the zero matrix
Suppose that both A and B are 2 by 2 matrices: A=(a&b\\c&d) and B=(e&f\\g&h).
How can I find all the possible combinations of a, b, c, d, e, f, g, and h over the finite field 2 that satisfy the above equation?

채택된 답변

John D'Errico
John D'Errico 2024년 11월 25일 13:55
편집: John D'Errico 2024년 11월 25일 13:55
Even in the simple case of F_2 matrices, I'm not sure it is easy to do better than brute force. But no, you don't need to write out each matrix product. This seems to work.
m = 3;
% all possible pairs of 2x2 matrices, as base m integers, doubles
[Adoub,Bdoub] = meshgrid(0:m^4-1);
% convert those "matrices" into pages of 2x2 matrices,
% with each matrix as a plane in a 3-d matrix
Am = reshape(dec2base(Adoub,m)' - '0',[2 2 m^8]);
Bm = reshape(dec2base(Bdoub,m)' - '0',[2 2 m^8]);
% just take the product of all combinations of matrices, in F_m
AB = mod(pagemtimes(Am,Bm),m);
% and test for all zeros
zeroind = all(reshape(AB,[4,m^8]) == 0,1);
table(dec2base(Adoub(zeroind),m),dec2base(Bdoub(zeroind),m))
ans = 417x2 table
Var1 Var2 ____ ____ 0000 0000 0000 0001 0000 0002 0000 0010 0000 0011 0000 0012 0000 0020 0000 0021 0000 0022 0000 0100 0000 0101 0000 0102 0000 0110 0000 0111 0000 0112 0000 0120
There are 58 sets of matrices identified for base 2, and 417 for base 3. If m is too large of course, expect things to get nasty in terms of computations, because you will have m^8 such combinations of matrices to deal with.
  댓글 수: 1
Adrian
Adrian 2024년 11월 25일 14:40
Thank you. This really helps

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Torsten
Torsten 2024년 11월 24일 18:30
이동: Torsten 2024년 11월 24일 18:30
Just test the 16 x16 = 256 possible products for A and B.
  댓글 수: 13
Walter Roberson
Walter Roberson 2024년 11월 25일 22:20
Integer:
isinteger(x) || all(x == floor(x),'all')
but even for integer data types, if abs(x) > sqrt(intmax(class(x))) then there is the potential for overflow if two such values get multiplied together. (Of course overflow in integer class only saturates, leaving the same datatype behind... but the point is the results would be inaccurate.)
Torsten
Torsten 2024년 11월 26일 1:11

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by