Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matrix dot product

  1. Aug 19, 2011 #1
    Hi, here's the problem:

    for m = {{a, b}, {c, d}},

    m \cdot m is suppose to = {{a^2 + b c, a b + b d}, {a c + c d, b c + d^2}}

    It's been ages since I took linear algebra and now can't figure out how this works.

    Thanks for your help!
  2. jcsd
  3. Aug 19, 2011 #2
    That is the product M*M=M^2. When you multiply two matrices, the product will have in its ith row and jth column the dot product of the ith row of the left matrix times the jth column of the right matrix. So to get the first entry (entry in the first row, first column), you perform the dot product of (a, b) -- the first row of the first matrix with (a,c)--the first column of the second matrix. That is a*a+b*c=a^2+bc.
  4. Aug 19, 2011 #3
    Is M \cdot M the same thing as M*M?
  5. Aug 19, 2011 #4
    It depends on how the 'dot' has been defined. In this case it is the product of M with itself so i suspect it just gave the formula for M^2. However, it is not a "dot product". Dot products -- more generally inner products -- give back a number.
  6. Aug 19, 2011 #5
    Hmm. I thought so.. that dot product works by summing the product of individual elements of vectors, which is why it's confusing when Mathematica uses the notation "." in the context of matrix multiplication. So, if I understand correctly, one can't really take the dot product of matrices and what I see is only the result of notational configuration by the computing language.
  7. Aug 19, 2011 #6
    I would have to agree with you. Though, you can define an inner product on m x n matrices by adding the products of the corresponding entries in the matrices. It ends up being the same as the standard dot product on vectors in R^mn.
  8. Aug 19, 2011 #7
    Thanks for the help, Davey.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook