Mathematica: Matrix product Modulus an integer

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
6 replies · 9K views
zplot
Messages
17
Reaction score
0
I need to multiply 2 matrix in Mathematica but modulus an Integer.

The "Modulus->n" option cannot be used with "Dot" function. You can use Modulus-> n with "Inverse" or even "Det" but not with "Dot". It is something strange.

How should I do it, then? Any idea?
Thank you.
 
Physics news on Phys.org
Sorry DaleSpam but I don't catch you. I need the product of A and B modulus->n.
 
Inverse[Inverse[A.B,Modulus->n],Modulus->n] would that work? If not then you can always use Inner which is a generalization of Dot where you are allowed to specify your multiplication operator.
 
Thank you DaleSpam but it would not work. I will see how could I use Inner.
Thanks a lot
 
You can use this code:

matrixa = {{4, 3}, {1, 2}};
matrixb = {18, 11};
modulo = 26;
som = matrixa.matrixb
Mod[som, modulo]
 
I am sorry but (a.b Mod m) is not iqual to (a Mod m).(b Mod m) being a and b matrix

thank you very much