Mathematica Question (Matrix Multiplication)

Click For Summary

Discussion Overview

The discussion revolves around the use of Mathematica for matrix multiplication, specifically addressing the challenge of computing a product of matrices in a way that avoids element-wise multiplication. Participants explore methods to achieve matrix multiplication using built-in commands and programming techniques.

Discussion Character

  • Technical explanation, Debate/contested, Homework-related

Main Points Raised

  • One participant describes a specific matrix product they are trying to compute and expresses frustration with Mathematica's interpretation of the product command as element-wise multiplication.
  • Another participant suggests using the dot operator (A.B) for matrix multiplication.
  • A later post mentions that the participant found a solution using a Do[] command, emphasizing the difficulty of using the product command for matrix multiplication without writing out each multiplication explicitly.
  • Another participant proposes the command MatrixPower[m,n] as a potential solution for the problem.

Areas of Agreement / Disagreement

Participants do not reach a consensus on a single method for achieving the desired matrix multiplication, as multiple approaches are suggested and the original poster finds a solution independently.

Contextual Notes

The discussion does not clarify the specific definitions or assumptions regarding the matrices involved, nor does it resolve the limitations of the product command in Mathematica.

Who May Find This Useful

Users of Mathematica who are working with matrix operations and seeking efficient methods for matrix multiplication may find this discussion relevant.

jeffreydk
Messages
133
Reaction score
0
I am trying to compute the following,

\prod_{j=0}^{N-1}\left[\hat{I}+\hat{M(j)}\left(\frac{T}{N}\right)\right]

where \hat{I}, \hat{M(j)} are matrices. My problem is that Mathematica interprets this product as element-wise with respect to the matrices, but I of course want it to use matrix multiplication. Is there any simple way to do this or do I need to write a code using some kind of do-loop?

Thanks for any help, I appreciate it.
 
Physics news on Phys.org
Use a . to multiply matrices: A.B
 
I figured it out now using a Do[] command, but my point was that if you want to multiply many matrices and not write out the long stretch of A1.A2.A3.A4...AN, then you cannot use the product command on Mathematica because that will just multiply the matrices element-wise. I wanted to know if there was any way of using the product command for a dot product.
 
The command MatrixPower[m,n] is what you're looking for!
 
Ahh, thank you very much.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K