Band gap: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>Materialscientist
m Reverted edits by SimeonBF (talk) to last version by Materialscientist
en>YiFeiBot
m Bot: Migrating interwiki links, now provided by Wikidata on d:q806352
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
In [[mathematics]], '''matrix multiplication''' is a [[binary operation]] that takes a pair of [[matrix (mathematics)|matrices]], and produces another matrix. [[Number]]s such as the [[real number|real]] or [[complex number]]s can be [[multiplication|multiplied]] according to [[elementary arithmetic]]. On the other hand, matrices are ''arrays of numbers'', so there is no unique way to define "the" multiplication of matrices. As such, in general the term "matrix multiplication" refers to a number of different ways to multiply matrices. The key features of any matrix multiplication include: the number of rows and columns the original matrices have (called the [[Matrix (mathematics)#Size|"size", "order" or "dimension"]]), and specifying how the entries of the matrices generate the new matrix.
Hi, everybody! <br>I'm Chinese female :). <br>I really like NCIS!<br><br>my weblog - [http://kazhunt.kz/index.php/gostevaya-kniga how to get Free fifa 15 Coins]
 
Like [[Vector (mathematics and physics)|vectors]], matrices of any size can be multiplied by [[scalar (mathematics)|scalar]]s, which amounts to multiplying every entry of the matrix by the same number. Similar to the entrywise definition of [[matrix addition|adding or subtracting matrices]], multiplication of two matrices of the same size can be defined by multiplying the corresponding entries, and this is known as the [[Hadamard product (matrices)|Hadamard product]]. Another definition is the [[Kronecker product]] of two matrices, to obtain a [[block matrix]].
 
One can form many other definitions. However, the most useful definition can be motivated by [[Linear equation#Matrix form|linear equation]]s and [[linear transformation]]s on vectors, which have numerous applications in [[applied mathematics]], [[physics]], and [[engineering]]. This definition is often called ''the'' '''matrix product'''.<ref name="Physics 1991">Encyclopaedia of Physics (2nd Edition), R.G. Lerner, G.L. Trigg, VHC publishers, 1991, ISBN (Verlagsgesellschaft) 3-527-26954-1, ISBN (VHC Inc.) 0-89573-752-3</ref><ref>McGraw Hill Encyclopaedia of Physics (2nd Edition), C.B. Parker, 1994, ISBN 0-07-051400-3</ref> In words, if {{math|'''A'''}} is an {{math|''n'' × ''m''}} matrix and {{math|'''B'''}} is a {{math|''m'' × ''p''}} matrix, their matrix product {{math|'''AB'''}} is an {{math|''n'' × ''p''}} matrix, in which the {{math|''m''}} entries across the rows of {{math|'''A'''}} are multiplied with the {{math|''m''}} entries down the columns of {{math|'''B'''}} (the [[#General definition of the matrix product|precise definition is below]]).
 
This definition is not [[commutative]], although it still retains the [[associative property]] and is [[Distributive property|distributive]] over entrywise addition of matrices. The [[identity element]] of the matrix product is the [[identity matrix]] (analogous to multiplying numbers by 1), and a square matrix may have an [[inverse matrix]] (analogous to the [[multiplicative inverse]] of a number). A consequence of the matrix product is [[Determinant#Multiplicativity and matrix groups|determinant multiplicativity]]. The matrix product is an important operation in [[linear transformations]], [[matrix group]]s, and the theory of [[group representation]]s and [[irrep]]s. For large matrices and/or products of more than two matrices, this matrix product can be very time consuming to calculate, so more efficient algorithms to compute the matrix product than the mathematical definition have been developed.
 
This article will use the following notational conventions: matrices are represented by capital letters in bold, e.g. {{math|'''A'''}}, [[Euclidean vector|vectors]] in lowercase bold, e.g. {{math|'''a'''}}, and entries of vectors and matrices are italic (since they are [[scalar (mathematics)|scalars]]), e.g. {{math|''A''}} and {{math|''a''}}. [[Index notation]] is often the clearest way to express definitions, and will be used as standard in the literature. The {{math|''i, j''}} entry of matrix {{math|'''A'''}} is indicated by {{math|('''A''')<sub>''ij''</sub>}} or {{math|''A''<sub>''ij''</sub>}}, whereas a numerical label (not matrix entries) on a collection of matrices is subscripted only, e.g. {{math|'''A'''<sub>1</sub>, '''A'''<sub>2</sub>}}, etc.
 
== Scalar multiplication ==
 
{{main|Scalar multiplication}}
 
The simplest form of multiplication associated with matrices is scalar multiplication.
 
The '''left scalar multiplication''' of a matrix {{math|'''A'''}} with a scalar {{math|''λ''}} gives another matrix {{math|''λ'''''A'''}} of the same size as {{math|'''A'''}}. The entries of {{math|''λ'''''A'''}} are defined by
 
:<math> (\lambda \mathbf{A})_{ij} = \lambda\left(\mathbf{A}\right)_{ij}\,,</math>
 
explicitly:
 
:<math> \lambda \mathbf{A} = \lambda \begin{pmatrix}
A_{11} & A_{12} & \cdots & A_{1m} \\
A_{21} & A_{22} & \cdots & A_{2m} \\
\vdots & \vdots & \ddots & \vdots \\
A_{n1} & A_{n2} & \cdots & A_{nm} \\
\end{pmatrix} = \begin{pmatrix}
\lambda A_{11} & \lambda  A_{12} & \cdots & \lambda A_{1m} \\
\lambda A_{21} & \lambda A_{22} & \cdots & \lambda A_{2m} \\
\vdots & \vdots & \ddots & \vdots \\
\lambda A_{n1} & \lambda A_{n2} & \cdots & \lambda A_{nm} \\
\end{pmatrix}\,.</math>
 
Similarly, the '''right scalar multiplication''' of a matrix {{math|'''A'''}} with a scalar {{math|''λ''}} is defined to be
 
:<math> (\mathbf{A}\lambda)_{ij} = \left(\mathbf{A}\right)_{ij} \lambda\,, </math>
 
explicitly:
 
:<math> \mathbf{A}\lambda = \begin{pmatrix}
A_{11} & A_{12} & \cdots & A_{1m} \\
A_{21} & A_{22} & \cdots & A_{2m} \\
\vdots & \vdots & \ddots & \vdots \\
A_{n1} & A_{n2} & \cdots & A_{nm} \\
\end{pmatrix}\lambda = \begin{pmatrix}
A_{11} \lambda & A_{12} \lambda & \cdots & A_{1m} \lambda  \\
A_{21} \lambda & A_{22} \lambda & \cdots & A_{2m} \lambda \\
\vdots & \vdots & \ddots & \vdots \\
A_{n1} \lambda & A_{n2} \lambda & \cdots & A_{nm} \lambda \\
\end{pmatrix}\,.</math>
 
When the underlying [[ring (mathematics)|ring]] is [[commutative]], for example, the [[real numbers|real]] or [[complex number]] [[Field (mathematics)|field]], these two multiplications are the same, and are simply called ''scalar multiplication''. However, for matrices over a more general [[ring (mathematics)|ring]] that are ''not'' commutative, such as the [[quaternion]]s, they may not be equal.
 
For a real scalar and matrix:
 
:<math> \lambda = 2, \quad \mathbf{A} =\begin{pmatrix}
a & b \\
c & d \\
\end{pmatrix} </math>
 
:<math> 2 \mathbf{A} = 2 \begin{pmatrix}
a & b \\
c & d \\
\end{pmatrix} = \begin{pmatrix}
2 \!\cdot\! a & 2 \!\cdot\! b \\
2 \!\cdot\! c & 2 \!\cdot\! d \\
\end{pmatrix} = \begin{pmatrix}
a \!\cdot\! 2 & b \!\cdot\! 2 \\
c \!\cdot\! 2 & d \!\cdot\! 2 \\
\end{pmatrix} = \begin{pmatrix}
a & b \\
c & d \\
\end{pmatrix}2= \mathbf{A}2.</math>
 
For quaternion scalars and matrices:
 
:<math> \lambda = i, \quad \mathbf{A} = \begin{pmatrix}
    i & 0 \\
    0 & j \\
  \end{pmatrix} </math>
 
:<math>
  i\begin{pmatrix}
    i & 0 \\
    0 & j \\
  \end{pmatrix}
= \begin{pmatrix}
    i^2 & 0 \\
    0 & ij \\
  \end{pmatrix}
= \begin{pmatrix}
    -1 & 0 \\
    0 & k \\
  \end{pmatrix}
\ne \begin{pmatrix}
    -1 & 0 \\
    0 & -k \\
  \end{pmatrix}
= \begin{pmatrix}
    i^2 & 0 \\
    0 & ji \\
  \end{pmatrix}
= \begin{pmatrix}
    i & 0 \\
    0 & j \\
  \end{pmatrix}i\,,
</math>
 
where {{math|''i'', ''j'', ''k''}} are the quaternion units. The non-commutativity of quaternion multiplication prevents the transition of changing {{math|''ij'' {{=}} +''k''}} to {{math|''ji'' {{=}} −''k''}}.
 
== Matrix product (two matrices)==
 
Assume two matrices are to be multiplied (the generalization to any number is discussed below). 
 
===General definition of the matrix product===
 
[[File:Matrix multiplication row column correspondance.svg|right|300px|"300px"|thumb|Arithmetic process of multiplying numbers (solid lines) in <span style="color:blue;">row {{math|''i''}} in matrix {{math|'''A'''}}</span> and <span style="color:#FF7E00;">column {{math|''j''}} in matrix {{math|'''B'''}}</span>, ''then'' adding the terms (dashed lines) to obtain entry {{math|''ij''}} in the final matrix.]]
 
If {{math|'''A'''}} is an {{math|''n'' × ''m''}} matrix and {{math|'''B'''}} is an {{math|''m'' × ''p''}} matrix,
 
:<math>\mathbf{A}=\begin{pmatrix}
A_{11} & A_{12} & \cdots & A_{1m} \\
A_{21} & A_{22} & \cdots & A_{2m} \\
\vdots & \vdots & \ddots & \vdots \\
A_{n1} & A_{n2} & \cdots & A_{nm} \\
\end{pmatrix},\quad\mathbf{B}=\begin{pmatrix}
B_{11} & B_{12} & \cdots & B_{1p} \\
B_{21} & B_{22} & \cdots & B_{2p} \\
\vdots & \vdots & \ddots & \vdots \\
B_{m1} & B_{m2} & \cdots & B_{mp} \\
\end{pmatrix}</math>
 
the '''matrix product''' {{math|'''AB'''}} (denoted without multiplication signs or dots) is defined to be the {{math|''n'' × ''p''}} matrix<ref>''Linear Algebra'' (4th Edition), S. Lipcshutz, M. Lipson, Schaum's Outlines, McGraw Hill (USA), 2009, ISBN 978-0-07-154352-1</ref><ref>''Mathematical methods for physics and engineering'', K.F. Riley, M.P. Hobson, S.J. Bence, Cambridge University Press, 2010, ISBN 978-0-521-86153-3</ref>
 
:<math>\mathbf{A}\mathbf{B} =\begin{pmatrix}
\left(\mathbf{AB}\right)_{11} & \left(\mathbf{AB}\right)_{12} & \cdots & \left(\mathbf{AB}\right)_{1p} \\
\left(\mathbf{AB}\right)_{21} & \left(\mathbf{AB}\right)_{22} & \cdots & \left(\mathbf{AB}\right)_{2p} \\
\vdots & \vdots & \ddots & \vdots \\
\left(\mathbf{AB}\right)_{n1} & \left(\mathbf{AB}\right)_{n2} & \cdots & \left(\mathbf{AB}\right)_{np} \\
\end{pmatrix}</math>
 
where each {{math|''i, j''}} entry is given by multiplying the entries {{math|''A<sub>ik</sub>''}} (across row {{math|''i''}} of {{math|'''A'''}}) by the entries {{math|''B<sub>kj</sub>''}} (down column {{math|''j''}} of {{math|'''B'''}}), for {{math|''k'' {{=}} 1, 2, ..., ''m''}}, and summing the results over {{math|''k''}}:
 
:<math> (\mathbf{A}\mathbf{B})_{ij} = \sum_{k=1}^m A_{ik}B_{kj}\,. </math>
 
Thus the product {{math|'''AB'''}} is defined only if the number of columns in {{math|'''A'''}} is equal to the number of rows in {{math|'''B'''}}, in this case {{math|''m''}}. Each entry may be computed one at a time. Sometimes, the [[summation convention]] is used as it is understood to sum over the repeated index {{math|''k''}}. To prevent any ambiguity, this convention will not be used in the article.
 
Usually the entries are numbers or [[Expression (mathematics)|expression]]s, but can even be matrices themselves (see [[block matrix]]). The matrix product can still be calculated exactly the same way. See [[#The inner and outer products|below]] for details on how the matrix product can be calculated in terms of blocks taking the forms of rows and columns.
 
=== Illustration ===
[[File:Matrix multiplication diagram 2.svg|right]]
 
The figure to the right illustrates diagrammatically the product of two matrices {{math|'''A'''}} and {{math|'''B'''}}, showing how each intersection in the product matrix corresponds to a row of {{math|'''A'''}} and a column of {{math|'''B'''}}.
 
:<math>
\overset{4\times 2 \text{ matrix}}{\begin{bmatrix}
\color{BrickRed} a_{11} & \color{BrickRed} a_{12} \\
\cdot & \cdot \\
\color{BurntOrange} a_{31} & \color{BurntOrange} a_{32} \\
\cdot & \cdot \\
\end{bmatrix}}
 
\overset{2\times 3\text{ matrix}}{\begin{bmatrix}
\cdot & \color{RedViolet}b_{12} & \color{Violet}b_{13} \\
\cdot & \color{RedViolet}b_{22} & \color{Violet}b_{23} \\
\end{bmatrix}}
 
= \overset{4\times 3\text{ matrix}}{\begin{bmatrix}
\cdot & x_{12} & \cdot \\
\cdot & \cdot & \cdot \\
\cdot & \cdot & x_{33} \\
\cdot & \cdot & \cdot \\
\end{bmatrix}}
</math>
 
The values at the intersections marked with circles are:
 
:<math>\begin{align}
x_{12} & = {\color{BrickRed}a_{11}}{\color{RedViolet}b_{12}} + {\color{BrickRed}a_{12}}{\color{RedViolet}b_{22}} \\
x_{33} & = {\color{BurntOrange}a_{31}}{\color{Violet}b_{13}} + {\color{BurntOrange}a_{32}}{\color{Violet}b_{23}}
\end{align}</math>
 
=== Examples of matrix products ===
 
;[[Row vector]] and [[column vector]]
 
If
 
:<math>\mathbf{A} = \begin{pmatrix}
a & b
\end{pmatrix}\,, \quad \mathbf{B} = \begin{pmatrix}
x \\
y
\end{pmatrix}\,,</math>
 
their matrix products are:
 
:<math>\mathbf{AB} = \begin{pmatrix}
a & b
\end{pmatrix} \begin{pmatrix}
x \\
y \\
\end{pmatrix} = ax + by \,,
</math>
 
and
 
:<math>\mathbf{BA} = \begin{pmatrix}
x \\
y \\
\end{pmatrix}\begin{pmatrix}
a & b
\end{pmatrix} = \begin{pmatrix}
xa & xb \\
ya & yb
\end{pmatrix} \,.
</math>
 
Note {{math|'''AB'''}} and {{math|'''BA'''}} are two very different matrices: the first is a {{math|1 × 1}} matrix while the second is a {{math|2 × 2}} matrix. Such expressions occur for real-valued [[Euclidean vector]]s in [[Cartesian coordinate]]s, displayed as row and column matrices, in which case {{math|'''AB'''}} is the matrix form of their [[inner product]], while {{math|'''BA'''}} the matrix form of their [[dyadic tensor|dyadic]] or tensor product.
 
;[[Square matrix]] and column vector
 
If
 
:<math>\mathbf{A} = \begin{pmatrix}
a & b \\
c & d \\
\end{pmatrix}, \quad \mathbf{B} = \begin{pmatrix}
x \\
y \\
\end{pmatrix}\,,</math>
 
their matrix product is:
 
:<math>\mathbf{AB} = \begin{pmatrix}
a & b \\
c & d \\
\end{pmatrix} \begin{pmatrix}
x \\
y \\
\end{pmatrix} =\begin{pmatrix}
ax + by \\
cx + dy \\
\end{pmatrix}\,,
</math>
 
however {{math|'''BA'''}} is not defined.
 
The product of a square matrix multiplied by a column matrix arises naturally in [[linear algebra]]; for solving [[linear equation]]s and representing [[linear transformations]]. By choosing {{math|''a, b, c, d''}} in {{math|'''A'''}} appropriately, {{math|'''A'''}} can represent a variety of transformations such as [[Rotation matrix|rotations]], [[Scaling matrix|scaling]] and [[Reflection (mathematics)|reflections]], [[shear mapping|shears]],  of a geometric shape in space.
 
;Square matrices
 
If
 
:<math>\mathbf{A} = \begin{pmatrix}
a & b \\
c & d \\
\end{pmatrix}, \quad \mathbf{B} = \begin{pmatrix}
\alpha & \beta \\
\gamma & \delta \\
\end{pmatrix}\,,</math>
 
their matrix products are:
 
:<math>\mathbf{AB} = \begin{pmatrix}
a & b \\
c & d \\
\end{pmatrix} \begin{pmatrix}
\alpha & \beta \\
\gamma & \delta \\
\end{pmatrix} =\begin{pmatrix}
a \alpha + b \gamma & a \beta + b \delta \\
c \alpha + d \gamma & c \beta + d \delta \\
\end{pmatrix}\,,
</math>
 
and
 
:<math>\mathbf{BA} = \begin{pmatrix}
\alpha & \beta \\
\gamma & \delta \\
\end{pmatrix} \begin{pmatrix}
a & b \\
c & d \\
\end{pmatrix} =\begin{pmatrix}
\alpha a + \beta c & \alpha b + \beta d \\
\gamma a + \delta c & \gamma b + \delta d \\
\end{pmatrix}\,.
</math>
 
In this case, both products {{math|'''AB'''}} and {{math|'''BA'''}} are defined, and the entries show that {{math|'''AB'''}} and {{math|'''BA'''}} are not equal in general.
Multiplying square matrices which represent linear transformations corresponds to the composite transformation (see below for details).
 
;Row vector, square matrix, and column vector
 
If
 
:<math>\mathbf{A} = \begin{pmatrix}
a & b
\end{pmatrix}\,, \quad \mathbf{B} = \begin{pmatrix}
p & q \\
r & s
\end{pmatrix}\,, \quad \mathbf{C} = \begin{pmatrix}
x \\
y \\
\end{pmatrix}\,,</math>
 
their matrix product is:
 
:<math>\begin{align}
\mathbf{ABC} & = \begin{pmatrix}
a & b
\end{pmatrix} \left[\begin{pmatrix}
p & q \\
r & s
\end{pmatrix} \begin{pmatrix}
x \\
y \\
\end{pmatrix} \right] = \left[ \begin{pmatrix}
a & b
\end{pmatrix} \begin{pmatrix}
p & q \\
r & s
\end{pmatrix} \right] \begin{pmatrix}
x \\
y \\
\end{pmatrix} \\
& = \begin{pmatrix}
a & b
\end{pmatrix}\begin{pmatrix}
px + qy \\
rx + sy
\end{pmatrix} = \begin{pmatrix}
ap + br & aq + bs
\end{pmatrix} \begin{pmatrix}
x \\
y \\
\end{pmatrix}\\
& = apx + aqy + brx + bsy \,,\end{align}
</math>
 
however {{math|'''CBA'''}} is not defined. Note that {{math|'''A'''('''BC''') {{=}} ('''AB''')'''C'''}}, this is one of many general properties listed below. Expressions of the form {{math|'''ABC'''}} occur when calculating the inner product of two vectors displayed as row and column vectors in an arbitrary [[coordinate system]], and the [[metric tensor]] in these coordinates written as the square matrix.
 
=== Properties of the matrix product (two matrices) ===
 
Analogous to [[number]]s (elements of a [[Field (mathematics)|field]]), matrices satisfy the following [[Field (mathematics)#Definition and illustration|general properties]], although there is one subtlety, due to the nature of matrix multiplication.
 
====All matrices====
 
<ol>
<li>'''Not [[commutative]]:'''
 
<br>In general:
 
:<math>\mathbf{A}\mathbf{B} \neq \mathbf{B}\mathbf{A}</math>
 
because {{math|'''AB'''}} and {{math|'''BA'''}} may not be simultaneously defined, and even if they are they may still not be equal. This is contrary to ordinary [[multiplication]] of numbers. To specify the ordering of matrix multiplication in words; "pre-multiply (or left multiply) {{math|'''A'''}} by {{math|'''B'''}}" means {{math|'''BA'''}}, while "post-multiply (or right multiply) {{math|'''A'''}} by {{math|'''C'''}}" means {{math|'''AC'''}}. As long as the entries of the matrix come from a ring that has an identity, and {{math|''n'' > 1}} there is a pair of {{math|''n'' × ''n''}} noncommuting matrices over the ring. A notable exception is that the [[identity matrix]] (or any scalar multiple of it) commutes with every square matrix.<br>
 
In index notation:
 
:<math>\sum_k A_{ik}B_{kj} \neq \sum_k B_{ik}A_{kj} </math>
</li>
 
<li>'''[[Distributive property|Distributive]] over matrix addition:'''
 
<br>Left distributivity:
 
:<math>\mathbf{A}(\mathbf{B} + \mathbf{C}) = \mathbf{AB} + \mathbf{AC}</math>
 
Right distributivity:
 
:<math>(\mathbf{A} + \mathbf{B} )\mathbf{C} = \mathbf{AC} + \mathbf{BC}</math><br>
 
In index notation, these are respectively:
 
:<math>\sum_k A_{ik}(B_{kj} + C_{kj}) = \sum_k A_{ik}B_{kj} + \sum_k A_{ik}C_{kj} </math>
:<math>\sum_k (A_{ik} + B_{ik}) C_{kj} = \sum_k A_{ik}C_{kj} + \sum_k B_{ik}C_{kj}  </math>
</li>
 
<li>'''[[Scalar multiplication]] is compatible with matrix multiplication:'''
:<math> \lambda(\mathbf{AB}) = (\lambda \mathbf{A})\mathbf{B}</math> and <math> (\mathbf{A} \mathbf{B})\lambda=\mathbf{A}(\mathbf{B}\lambda )</math>
where {{math|''λ''}} is a scalar. If the entries of the matrix are real or complex numbers (or from any other [[commutative ring]]), then all four quantities are equal. More generally, all four are equal if {{math|''λ''}} belongs to the [[center (algebra)|center]] of the ring of entries of the matrix, because in this case {{math|''λ'''''X''' {{=}} '''X'''''λ''}} for all matrices {{math|'''X'''}}. <br>
 
In index notation, these are respectively:
 
:<math>\lambda \sum_k (A_{ik}B_{kj}) = \sum_k ( \lambda A_{ik} ) B_{kj}  = \sum_k  A_{ik} ( \lambda B_{kj} ) </math>
:<math>\sum_k (A_{ik}B_{kj}) \lambda = \sum_k ( A_{ik} \lambda ) B_{kj}  = \sum_k  A_{ik} ( B_{kj} \lambda ) </math>
 
</li>
 
<li>'''[[Transpose]]:'''
 
:<math> (\mathbf{AB})^\mathrm{T} = \mathbf{B}^\mathrm{T}\mathbf{A}^\mathrm{T} </math>
 
where {{math|T}} denotes the transpose, the interchange of row {{math|''i''}} with column {{math|''i''}} in a matrix. This identity holds for any matrices over a commutative ring, but not for all rings in general.  Note that {{math|'''A''}} and {{math|'''B'''}} are reversed.<br>
 
In index notation:
 
:<math> \left[(\mathbf{AB})^\mathrm{T}\right]_{ij} = \left(\mathbf{AB}\right)_{ji} = \sum_k \left(\mathbf{A}\right)_{jk}\left(\mathbf{B}\right)_{ki} = \sum_k \left(\mathbf{A}^\mathrm{T}\right)_{kj}\left(\mathbf{B}^\mathrm{T}\right)_{ik} = \sum_k \left(\mathbf{B}^\mathrm{T}\right)_{ik}\left(\mathbf{A}^\mathrm{T}\right)_{kj} = \left[\left(\mathbf{A}^\mathrm{T}\right) \left(\mathbf{B}^\mathrm{T}\right)\right]_{ij} </math>
 
</li>
 
<li>'''[[Complex conjugate]]:'''
 
If {{math|'''A'''}} and {{math|'''B'''}} have complex entries, then
 
:<math> (\mathbf{AB})^\star = \mathbf{A}^\star\mathbf{B}^\star </math>
 
where {{math|*}} denotes the [[complex conjugate]] of a matrix. <br>
 
In index notation:
 
:<math> \left[(\mathbf{AB})^\star\right]_{ij} = \left[\sum_k \left(\mathbf{A}\right)_{ik}\left(\mathbf{B}\right)_{kj}\right]^\star = \sum_k \left(\mathbf{A}\right)^\star_{ik}\left(\mathbf{B}\right)^\star_{kj} = \sum_k \left(\mathbf{A}^\star\right)_{ik}\left(\mathbf{B}^\star\right)_{kj} = \left(\mathbf{A}^\star \mathbf{B}^\star\right)_{ij} </math>
</li>
 
<li>'''[[Conjugate transpose]]:'''
 
If {{math|'''A'''}} and {{math|'''B'''}} have complex entries, then
 
:<math> (\mathbf{AB})^\dagger = \mathbf{B}^\dagger\mathbf{A}^\dagger </math>
 
where {{math|†}} denotes the Conjugate transpose of a matrix (complex conjugate and transposed). <br>
 
In index notation:
 
:<math> \left[(\mathbf{AB})^\dagger\right]_{ij} = \left[\left(\mathbf{AB}\right)^\star\right]_{ji} = \sum_k \left(\mathbf{A}^\star\right)_{jk}\left(\mathbf{B}^\star\right)_{ki} = \sum_k \left(\mathbf{A}^\dagger\right)_{kj}\left(\mathbf{B}^\dagger\right)_{ik} = \sum_k \left(\mathbf{B}^\dagger\right)_{ik}\left(\mathbf{A}^\dagger\right)_{kj} = \left[\left(\mathbf{A}^\dagger\right) \left(\mathbf{B}^\dagger\right)\right]_{ij} </math>
</li>
 
<li>'''[[Trace (linear algebra)|Trace]]s:'''
 
The trace of a product {{math|'''AB'''}} is independent of the order of {{math|'''A'''}} and {{math|'''B'''}}:
 
:<math> \mathrm{tr}(\mathbf{AB}) = \mathrm{tr}(\mathbf{BA}) </math><br>
 
In index notation:
 
:<math> \mathrm{tr}(\mathbf{AB}) = \sum_i \sum_k A_{ik}B_{ki} = \sum_k \sum_i B_{ki} A_{ik} =  \mathrm{tr}(\mathbf{BA}) </math>
 
</li>
 
</ol>
 
{{for|extensive details on [[differential of a function|differential]]s and [[derivative]]s of products of [[matrix function]]s|matrix calculus}}
 
====Square matrices only====
 
{{main|square matrix}}
 
<ol>
<li>'''[[Identity element]]:'''
 
If {{math|'''A'''}} is a square matrix, then
 
:<math> \mathbf{AI} = \mathbf{IA} = \mathbf{A} </math>
 
where {{math|'''I'''}} is the identity matrix of the same order.</li>
 
<li>'''[[Inverse matrix]]:'''
 
If {{math|'''A'''}} is a square matrix, there ''may'' be an inverse matrix {{math|'''A'''<sup>−1</sup>}} of {{math|'''A'''}} such that
 
:<math> \mathbf{A}\mathbf{A}^{-1} = \mathbf{A}^{-1}\mathbf{A} = \mathbf{I} </math>
 
If this property holds then {{math|'''A'''}} is an [[invertible matrix]], if not {{math|'''A'''}} is a [[singular matrix]]. Moreover,
:<math> (\mathbf{AB})^\mathrm{-1} = \mathbf{B}^\mathrm{-1}\mathbf{A}^\mathrm{-1} </math></li>
 
<li>'''[[Determinant]]s:'''
 
The determinant of a product {{math|'''AB'''}} is the product of the determinants of square matrices {{math|'''A'''}} and {{math|'''B'''}} (not defined when the underlying ring is not commutative):
 
:<math> \det(\mathbf{AB}) = \det(\mathbf{A})\det(\mathbf{B}) </math>
 
Since {{math|det('''A''')}} and {{math|det('''B''')}} are just numbers and so commute, {{math|det('''AB''') {{=}} det('''A''')det('''B''') {{=}} det('''B''')det('''A''') {{=}} det('''BA''')}}, even when {{math|'''AB''' ≠ '''BA'''}}.</li>
</ol>
 
== Matrix product (any number) ==
 
{{Main|Matrix chain multiplication}}
 
Matrix multiplication can be extended to the case of more than two matrices, provided that for each sequential pair, their dimensions match.
 
The product of {{math|''n''}} matrices {{math|'''A'''<sub>1</sub>, '''A'''<sub>2</sub>, ..., '''A'''<sub>''n''</sub>}} with sizes {{math|''s''<sub>0</sub> × ''s''<sub>1</sub>, ''s''<sub>1</sub> × ''s''<sub>2</sub>, ..., ''s''<sub>''n'' − 1</sub> × ''s''<sub>''n''</sub>}} (where {{math|''s''<sub>0</sub>, ''s''<sub>1</sub>, ''s''<sub>2</sub>, ..., ''s''<sub>''n''</sub>}} are all simply positive integers and the subscripts are labels corresponding to the matrices, nothing more), is the {{math|''s''<sub>0</sub> × ''s''<sub>''n''</sub>}} matrix:
 
:<math> \prod_{i=1}^n \mathbf{A}_i = \mathbf{A}_1\mathbf{A}_2\cdots\mathbf{A}_n \, . </math>
 
In index notation:
 
:<math> \left(\mathbf{A}_1\mathbf{A}_2\cdots\mathbf{A}_n\right)_{i_0 i_n} = \sum_{i_1=1}^{s_1}\sum_{i_2=1}^{s_2}\cdots\sum_{i_{n-1}=1}^{s_{n-1}} \left(\mathbf{A}_1\right)_{i_0 i_1}\left(\mathbf{A}_2\right)_{i_1 i_2}\left(\mathbf{A}_3\right)_{i_2 i_3} \cdots \left(\mathbf{A}_{n-1}\right)_{i_{n-2}i_{n-1}}\left(\mathbf{A}_n\right)_{i_{n-1}i_n} </math>
 
=== Properties of the matrix product (any number) ===
 
The same properties will hold, as long as the ordering of matrices is not changed. Some of the previous properties for more than two matrices generalize as follows.
 
<ol>
<li>'''[[Associative property|Associative]]:'''
 
<br />The matrix product is associative. If three matrices {{math|'''A''', '''B'''}}, and {{math|'''C'''}} are respectively {{math|''m'' × ''p''}}, {{math|''p'' × ''q''}}, and {{math|''q'' × ''r''}} matrices, then there are two ways of grouping them without changing their order, and
 
:<math>\mathbf{ABC} = \mathbf{A}(\mathbf{BC}) = (\mathbf{AB})\mathbf{C} </math>
 
is an {{math|''m'' × ''r''}} matrix.
 
<br />If four matrices {{math|'''A''', '''B''', '''C'''}}, and {{math|'''D'''}} are respectively {{math|''m'' × ''p''}}, {{math|''p'' × ''q''}}, {{math|''q'' × ''r''}}, and {{math|''r'' × ''s''}} matrices, then there are five ways of grouping them without changing their order, and
 
:<math> \mathbf{ABCD} = ((\mathbf{AB})\mathbf{C})\mathbf{D}=(\mathbf{A}(\mathbf{BC}))\mathbf{D}=\mathbf{A}((\mathbf{BC})\mathbf{D})=\mathbf{A}(\mathbf{B}(\mathbf{CD}))=(\mathbf{AB})(\mathbf{CD}) </math>
 
is an {{math|''m'' × ''s''}} matrix.
 
<br />In general, the number of possible ways of grouping {{math|''n'' }} matrices for multiplication is equal to the {{math|(''n'' − 1)}}th [[Catalan number]]</li>
 
<li>'''Trace:'''
 
The trace of a product of {{math|''n''}} matrices {{math|'''A'''<sub>1</sub>, '''A'''<sub>2</sub>, ..., '''A'''<sub>''n''</sub>}} is invariant under [[cyclic permutation]]s of the matrices in the product:
 
:<math> \mathrm{tr}(\mathbf{A}_1\mathbf{A}_2\mathbf{A}_3\ldots\mathbf{A}_{n-2}\mathbf{A}_{n-1}\mathbf{A}_n) = \mathrm{tr}(\mathbf{A}_2\mathbf{A}_3\mathbf{A}_4\ldots\mathbf{A}_{n-1}\mathbf{A}_n\mathbf{A}_1) = \mathrm{tr}(\mathbf{A}_3\mathbf{A}_4\mathbf{A}_5\ldots\mathbf{A}_n\mathbf{A}_1\mathbf{A}_2) = \ldots </math></li>
 
<li>'''Determinant:'''
 
For square matrices only, the determinant of a product is the product of determinants:
 
:<math> \det\left(\prod_{i=1}^n \mathbf{A}_i \right) = \prod_{i=1}^n \det\left(\mathbf{A}_i\right)</math>
</li></ol>
 
===Examples of chain multiplication ===
 
Similarity transformations involving [[matrix similarity|similar matrices]] are matrix products of the three square matrices,  in the form:
 
:<math>\mathbf{B} = \mathbf{P}^{-1} \mathbf{A} \mathbf{P}</math>
 
where {{math|'''P'''}} is the similarity matrix and {{math|'''A'''}} and {{math|'''B'''}} are said to be similar if this relation holds. This product appears frequently in linear algebra and applications, such as [[Diagonalizable matrix|diagonalizing square matrices]] and the equivalence between different [[Transformation matrix|matrix representations]] of the same [[linear operator]].
 
==Operations derived from the matrix product==
 
More operations on square matrices can be defined using the matrix product, such as [[Exponentiation|power]]s and [[nth root]]s by repeated matrix products, the [[matrix exponential]] can be defined by a [[power series]], the [[matrix logarithm]] is the inverse of [[matrix exponentiation]], and so on.
 
=== Powers of matrices ===
 
Square matrices can be multiplied by themselves repeatedly in the same way as ordinary numbers, because they always have the same number of rows and columns. This repeated multiplication can be described as a '''power of the matrix''', a special case of the ordinary matrix product. On the contrary, ''rectangular'' matrices do not have the same number of rows and columns so they can ''never'' be raised to a power. An {{math|''n'' × ''n''}} matrix {{math|'''A'''}} raised to a positive integer {{math|''k''}} is defined as
 
:<math>\mathbf{A}^k = \underset{k \mathrm{\, times}}{\mathbf{A}\mathbf{A}\cdots\mathbf{A}}</math>
 
and the following identities hold, where {{math|''λ''}} is a scalar:
 
<ol>
<li>'''Zero power:'''
 
:<math>\mathbf{A}^0 = \mathbf{I}</math>
 
where '''I''' is the [[identity matrix]]. This is parallel to the [[Exponentiation#Arbitrary integer exponents|zeroth power]] of any number which equals unity.</li>
 
<li>'''Scalar multiplication:'''
 
:<math> ( \lambda \mathbf{A} )^k = \lambda^k\mathbf{A}^k</math></li>
 
<li>'''Determinant:'''
 
:<math> \det(\mathbf{A}^k) = \det(\mathbf{A})^k </math></li>
</ol>
 
The naive computation of matrix powers is to multiply {{math|''k''}} times the matrix {{math|'''A'''}} to the result, starting with the identity matrix just like the scalar case. This can be improved using [[exponentiation by squaring]], a method commonly used for scalars. For [[diagonalizable matrices]], an even better method is to use the [[Eigendecomposition of a matrix|eigenvalue decomposition]] of {{math|'''A'''}}. Another method based on the [[Cayley–Hamilton theorem]] finds an identity using the matrices' [[characteristic polynomial]], producing a more effective equation for {{math|'''A'''<sup>''k''</sup>}} in which a ''scalar'' is raised to the required power, rather than an entire ''matrix''.
 
A special case is the power of a [[diagonal matrix]]. Since the product of diagonal matrices amounts to simply multiplying corresponding diagonal elements together, the power {{math|''k''}} of a diagonal matrix {{math|'''A'''}} will have entries raised to the power. Explicitly;
:<math>
  \mathbf{A}^k = \begin{pmatrix}
    A_{11} & 0 & \cdots & 0 \\
    0 & A_{22} & \cdots & 0 \\
    \vdots & \vdots & \ddots & \vdots \\
    0 & 0 & \cdots & A_{nn}
  \end{pmatrix}^k =
\begin{pmatrix}
    A_{11}^k & 0 & \cdots & 0 \\
    0 & A_{22}^k &  \cdots & 0 \\
    \vdots & \vdots & \ddots & \vdots \\
    0 & 0 & \cdots & A_{nn}^k
  \end{pmatrix}
</math>
 
meaning it is easy to raise a diagonal matrix to a power. When raising an arbitrary matrix (not necessarily a diagonal matrix) to a power, it is often helpful to exploit this property by [[Diagonalizable matrix|diagonalizing]] the matrix first.
 
==Applications of the matrix product==
 
===Linear transformations===
 
{{main|Linear transformations}}
 
Matrices offer a concise way of representing [[linear transformation]]s between [[vector space]]s, and matrix multiplication corresponds to the [[Function composition|composition]] of linear transformations. The matrix product of two matrices can be defined when their entries belong to the same [[ring (mathematics)|ring]], and hence can be added and multiplied.
 
Let {{math|''U'', ''V''}}, and {{math|''W''}} be [[vector spaces]] over the same [[Field (mathematics)|field]] with given [[basis (linear algebra)|bases]], {{math|''S'': ''V'' → ''W''}} and {{math|''T'': ''U'' → ''V''}} be [[linear transformation]]s and {{math|''ST'': ''U'' → ''W''}} be their composition.
 
Suppose that {{math|'''A''', '''B'''}}, and {{math|'''C'''}} are the matrices representing the transformations {{math|''S'', ''T''}}, and {{math|''ST''}} with respect to the given bases.
 
Then {{math|'''AB''' {{=}} '''C'''}}, that is, the matrix of the composition (or the product) of linear transformations is the product of their matrices with respect to the given bases.
 
===Linear systems of equations===
 
A [[system of linear equations]] can be solved by collecting the coefficients of the equations into a square matrix, then inverting the matrix equation.
 
A similar procedure can be used to solve a system of [[linear differential equation]]s, see also [[phase plane]].
 
=== Group theory and representation theory ===
 
{{main|Group theory|Group representation|Irrep}}
<!---to fill in...--->
 
== The inner and outer products ==
 
<!-- Please leave these definitions here, don't just link them - they help to visually illustrate how the rows/columns combine into scalars or matrices -->
 
Given two ''[[column vector]]s'' {{math|'''a'''}} and {{math|'''b'''}}, the Euclidean [[inner product]] and [[outer product]] are the simplest special cases of the matrix product, by [[matrix transpose|transposing]] the column vectors into [[row vector]]s.<ref>Mathematical methods for physics and engineering, K.F. Riley, M.P. Hobson, S.J. Bence, Cambridge University Press, 2010, ISBN 978-0-521-86153-3</ref>
 
=== Inner product ===
 
The '''[[inner product]]''' of two vectors in matrix form is equivalent to a column vector multiplied on the left by a row vector:
 
:<math>\mathbf{a}\cdot \mathbf{b} = \mathbf{a}^\mathrm{T}\mathbf{b} =
\begin{pmatrix}a_1 & a_2 & \cdots & a_n\end{pmatrix}
\begin{pmatrix}b_1 \\ b_2 \\ \vdots \\ b_n\end{pmatrix}
= a_1b_1+a_2b_2+\cdots+a_nb_n = \sum_{i=1}^n a_ib_i
</math>
 
The matrix product itself can be expressed in terms of inner product. Suppose that the first {{math|''n'' × ''m''}} matrix '''A''' is decomposed into its [[row vector]]s {{math|'''a'''<sub>''i''</sub>}}, and the second {{math|''m'' × ''p''}} matrix {{math|'''B'''}} into its [[column vector]]s {{math|'''b'''<sub>''i''</sub>}}:<ref name="Physics 1991"/>
 
:<math>\mathbf{A} =
\begin{pmatrix}
A_{1 1} & A_{1 2} & \cdots & A_{1 m} \\
A_{2 1} & A_{2 2} & \cdots & A_{2 m} \\
\vdots & \vdots & \ddots & \vdots \\
A_{n 1} & A_{n 2} & \cdots & A_{n m}
\end{pmatrix} =  \begin{pmatrix}
\mathbf{a}_1 \\ \mathbf{a}_2 \\ \vdots \\ \mathbf{a}_n
\end{pmatrix},\quad \mathbf{B} = \begin{pmatrix}
B_{1 1} & B_{1 2} & \cdots & B_{1 p} \\
B_{2 1} & B_{2 2} & \cdots & B_{2 p} \\
\vdots & \vdots & \ddots & \vdots \\
B_{m 1} & B_{m 2} & \cdots & B_{m p}
\end{pmatrix}
=
\begin{pmatrix}
\mathbf{b}_1 & \mathbf{b}_2 & \cdots & \mathbf{b}_p
\end{pmatrix}
</math>
 
where
 
:<math>\mathbf{a}_i = \begin{pmatrix}A_{i1} & A_{i2} & \cdots & A_{im} \end{pmatrix}\,,\quad \mathbf{b}_i = \begin{pmatrix}B_{1i} \\ B_{2i} \\ \vdots \\ B_{mi}\end{pmatrix} </math>
 
Then:
 
:<math>
\mathbf{AB} =
\begin{pmatrix}
\mathbf{a}_1 \\
\mathbf{a}_2 \\
\vdots \\
\mathbf{a}_n
\end{pmatrix} \begin{pmatrix} \mathbf{b}_1 & \mathbf{b}_2 & \dots & \mathbf{b}_p
\end{pmatrix} = \begin{pmatrix}
(\mathbf{a}_1 \cdot \mathbf{b}_1) & (\mathbf{a}_1 \cdot \mathbf{b}_2) & \dots & (\mathbf{a}_1 \cdot \mathbf{b}_p) \\
(\mathbf{a}_2 \cdot \mathbf{b}_1) & (\mathbf{a}_2 \cdot \mathbf{b}_2) & \dots & (\mathbf{a}_2 \cdot \mathbf{b}_p) \\
\vdots & \vdots & \ddots & \vdots \\
(\mathbf{a}_n \cdot \mathbf{b}_1) & (\mathbf{a}_n \cdot \mathbf{b}_2) & \dots & (\mathbf{a}_n \cdot \mathbf{b}_p)
\end{pmatrix}
</math>
 
It is also possible to express a matrix product in terms of concatenations of products of matrices and row or column vectors:
 
:<math>
\mathbf{AB} = \begin{pmatrix}
\mathbf{A}\mathbf{b}_1 & \mathbf{A}\mathbf{b}_2 & \dots & \mathbf{A}\mathbf{b}_p
\end{pmatrix} = \begin{pmatrix}
\mathbf{a}_1\mathbf{B} \\
\mathbf{a}_2\mathbf{B}\\
\vdots\\
\mathbf{a}_n\mathbf{B}
\end{pmatrix}
</math>
 
These decompositions are particularly useful for matrices that are envisioned as [[concatenation (mathematics)|concatenation]]s of particular types of [[row vector]]s or [[column vector]]s, e.g. [[orthogonal matrices]] (whose rows and columns are unit vectors orthogonal to each other) and [[Markov matrices]] (whose rows or columns sum to 1).
 
=== Outer product ===
 
The '''[[outer product]]''' (also known as the '''[[dyadic product]]''' or '''[[tensor product]]''') of two vectors in matrix form is equivalent to a row vector multiplied on the left by a column vector:
 
:<math>\mathbf{a}\otimes \mathbf{b} = \mathbf{a}\mathbf{b}^\mathrm{T} = \begin{pmatrix}a_1 \\ a_2 \\ \vdots \\ a_n\end{pmatrix}
\begin{pmatrix}b_1 & b_2 & \cdots & b_n\end{pmatrix}
= \begin{pmatrix}
a_1 b_1 & a_1 b_2 & \cdots & a_1 b_n \\
a_2 b_1 & a_2 b_2 & \cdots & a_2 b_n \\
\vdots & \vdots & \ddots & \vdots \\
a_n b_1 & a_n b_2 & \cdots & a_n b_n \\
\end{pmatrix}.
</math>
 
An alternative method is to express the matrix product in terms of the outer product. The decomposition is done the other way around, the first matrix {{math|'''A'''}} is decomposed into column vectors {{math|{{overline|'''a'''}}<sub>''i''</sub>}} and the second matrix {{math|'''B'''}} into row vectors {{math|{{overline|'''b'''}}<sub>''i''</sub>}}:
 
:<math>
\mathbf{AB} =
\begin{pmatrix} \mathbf{\bar a}_1 & \mathbf{\bar a}_2 & \cdots & \mathbf{\bar a}_m \end{pmatrix}
\begin{pmatrix} \mathbf{\bar b}_1 \\ \mathbf{\bar b}_2 \\ \vdots \\ \mathbf{\bar b}_m \end{pmatrix}
= \mathbf{\bar a}_1 \otimes \mathbf{\bar b}_1 + \mathbf{\bar a}_2 \otimes \mathbf{\bar b}_2 + \cdots + \mathbf{\bar a}_m \otimes \mathbf{\bar b}_m = \sum_{i=1}^m \mathbf{\bar a}_i \otimes \mathbf{\bar b}_i
</math>
 
where this time
 
:<math>\mathbf{\bar a}_i = \begin{pmatrix}A_{1i} \\ A_{2i} \\ \vdots \\ A_{ni} \end{pmatrix}\,,\quad \mathbf{\bar b}_i = \begin{pmatrix}B_{i1} & B_{i2} & \cdots & B_{ip}\end{pmatrix}\,.</math>
 
This method emphasizes the effect of individual column/row pairs on the result, which is a useful point of view with e.g. [[Covariance matrix|covariance matrices]], where each such pair corresponds to the effect of a single sample point.
 
:<math>
\begin{pmatrix}
{\color{BrickRed}1} & {\color{BurntOrange}2} &
 
{\color{Violet}3} \\
{\color{BrickRed}4} & {\color{BurntOrange}5} &
 
{\color{Violet}6} \\
{\color{BrickRed}7} & {\color{BurntOrange}8} &
 
{\color{Violet}9} \\
\end{pmatrix}
\begin{pmatrix}
{\color{BrickRed}a} & {\color{BrickRed}d} \\
{\color{BurntOrange}b} & {\color{BurntOrange}e} \\
{\color{Violet}c} & {\color{Violet}f} \\
\end{pmatrix}
=
\begin{pmatrix}
{\color{BrickRed}1} \\
{\color{BrickRed}4} \\
{\color{BrickRed}7}  \\
\end{pmatrix}
\begin{pmatrix}
{\color{BrickRed}{a}} & {\color{BrickRed}{d}} \\
\end{pmatrix}
+
\begin{pmatrix}
{\color{BurntOrange}2} \\
{\color{BurntOrange}5} \\
{\color{BurntOrange}8 }\\
\end{pmatrix}
\begin{pmatrix}
{\color{BurntOrange}{b}} & {\color{BurntOrange}
 
{e}} \\
\end{pmatrix}+
\begin{pmatrix}
{\color{Violet}3} \\
{\color{Violet}6} \\
{\color{Violet}9}  \\
\end{pmatrix}
\begin{pmatrix}
{\color{Violet}c}  & {\color{Violet}f}  \\
\end{pmatrix}
=
\begin{pmatrix}
{\color{BrickRed}1a} & {\color{BrickRed}1d} \\
{\color{BrickRed}4a} & {\color{BrickRed}4d} \\
{\color{BrickRed}7a} & {\color{BrickRed}7d} \\
\end{pmatrix}+
\begin{pmatrix}
{\color{BurntOrange}2b} & {\color{BurntOrange}2e}
 
\\
{\color{BurntOrange}5b} & {\color{BurntOrange}5e}
 
\\
{\color{BurntOrange}8b} & {\color{BurntOrange}8e}
 
\\
\end{pmatrix}+
\begin{pmatrix}
{\color{Violet}3c} & {\color{Violet}3f} \\
{\color{Violet}6c} & {\color{Violet}6f} \\
{\color{Violet}9c} & {\color{Violet}9f} \\
\end{pmatrix}.
 
</math>
 
== Algorithms for efficient matrix multiplication ==
 
{{unsolved|computer science|What is the fastest algorithm for matrix multiplication?}}
 
[[File:Bound on matrix multiplication omega over time.svg|thumb|400px|right|The bound on {{math|ω}} over time.]]
 
The [[Analysis of algorithms|running time]] of square matrix multiplication, if carried out naïvely, is {{math|''O''(''n''<sup>3</sup>)}}. The running time for multiplying rectangular matrices (one {{math|''m'' × ''p''}}-matrix with one {{math|''p'' × ''n''}}-matrix) is {{math|''O''(''mnp'')}}, however, more efficient algorithms exist, such as [[Strassen algorithm|Strassen's algorithm]], devised by [[Volker Strassen]] in 1969 and often referred to as "fast matrix multiplication". It is based on a way of multiplying two {{math|2 × 2}}-matrices which requires only 7 multiplications (instead of the usual 8), at the expense of several additional addition and subtraction operations. Applying this recursively gives an algorithm with a multiplicative cost of <math>O( n^{\log_{2}7}) \approx O(n^{2.807})</math>. Strassen's algorithm is more complex, and the [[numerical stability]] is reduced compared to the naïve algorithm.<ref>{{Citation | last1=Miller | first1=Webb | title=Computational complexity and numerical stability | url=http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.148.9947&rep=rep1&type=pdf | year=1975 | journal=SIAM News | volume=4 | pages=97–107}}</ref> Nevertheless, it appears in several libraries, such as [[BLAS]], where it is significantly more efficient for matrices with dimensions ''n'' > 100,<ref>Press 2007, p.&nbsp;108.</ref> and is very useful for large matrices over exact domains such as finite fields, where numerical stability is not an issue.
 
The current {{math|''O''(''n''<sup>''k''</sup>)}} algorithm with the lowest known exponent {{math|''k''}} is a generalization of the [[Coppersmith–Winograd algorithm]] that has an asymptotic complexity of {{math|''O''(''n''<sup>2.3729</sup>)}} thanks to Vassilevska Williams.<ref>{{cite web |url=http://www.cs.stanford.edu/~virgi/matrixmult-f.pdf |title=Multiplying matrices faster than Coppersmith-Winograd
|author=Virginia Vassilevska Williams}} The original algorithm was presented by [[Don Coppersmith]] and [[Shmuel Winograd]] in 1990, has an asymptotic complexity of {{math|''O''(''n''<sup>2.376</sup>)}}.</ref>  This algorithm, and the Coppersmith-Winograd algorithm on which it is based, are similar to Strassen's algorithm: a way is devised for multiplying two {{math|''k'' × ''k''}}-matrices with fewer than {{math|''k''<sup>3</sup>}} multiplications, and this technique is applied recursively. However, the constant coefficient hidden by the [[Big O notation]] is so large that these algorithms are only worthwhile for matrices that are too large to handle on present-day computers.<ref>{{Citation | last1=Robinson | first1=Sara | title=Toward an Optimal Algorithm for Matrix Multiplication | url=http://www.siam.org/pdf/news/174.pdf | year=2005 | journal=SIAM News | volume=38 | issue=9}}</ref>
 
Since any algorithm for multiplying two {{math|''n'' × ''n''}}-matrices has to process all {{math|2 × ''n''<sup>2</sup>}}-entries, there is an asymptotic lower bound of {{math|Ω(''n''<sup>2</sup>)}} operations. Raz (2002) proves a lower bound of {{math|Ω(''n''<sup>2</sup> log(''n''))}} for bounded coefficient arithmetic circuits over the real or complex numbers.
 
Cohn ''et al.'' (2003, 2005) put methods such as the Strassen and Coppersmith–Winograd algorithms in an entirely different [[group theory|group-theoretic]] context, by utilising triples of subsets of finite groups which satisfy a disjointness property called the [[Triple product property|triple product property (TPP)]]. They show that if families of [[wreath product]]s of [[Abelian group]]s with symmetric groups realise families of subset triples with a simultaneous version of the TPP, then there are matrix multiplication algorithms with essentially quadratic complexity. Most researchers believe that this is indeed the case.<ref>Robinson, 2005.</ref> However, Alon, Shpilka and Umans have recently shown that some of these conjectures implying fast matrix multiplication are incompatible with another plausible conjecture, the [[sunflower conjecture]].<ref>[[Noga Alon|Alon]], Shpilka, Umans, [http://eccc.hpi-web.de/report/2011/067/ On Sunflowers and Matrix Multiplication]</ref>
 
Because of the nature of matrix operations and the layout of matrices in memory, it is typically possible to gain substantial performance gains through use of [[parallelization]] and [[Vectorization (parallel computing)|vectorization]]. It should therefore be noted that some lower time-complexity algorithms on paper may have indirect time complexity costs on real machines.
 
[[Freivalds' algorithm]] is a simple Monte Carlo algorithm that given matrices {{math|'''A''', '''B''', '''C'''}} verifies in {{math|Θ(''n''<sup>2</sup>)}} time if {{math|'''AB''' {{=}} '''C'''}}.
 
[[File:Block matrix multiplication.svg|thumb|Block matrix multiplication. In the 2D algorithm, each processor is responsible for one submatrix of {{math|'''C'''}}. In the 3D algorithm, every pair of submatrices from {{math|'''A'''}} and {{math|'''B'''}} that is multiplied is assigned to one processor.]]
 
=== Communication-avoiding and distributed algorithms ===
 
On modern architectures with hierarchical memory, the cost of loading and storing input matrix elements tends to dominate the cost of arithmetic. On a single machine this is the amount of data transferred between RAM and cache, while on a distributed memory multi-node machine it is the amount transferred between nodes; in either case it is called the ''communication bandwidth''. The naïve algorithm using three nested loops uses {{math|Ω(''n''<sup>3</sup>)}} communication bandwidth.
 
[[Cannon's algorithm]], also known as the ''2D algorithm'', partitions each input matrix into a [[block matrix]] whose elements are submatrices of size {{math|{{sqrt|''M''/3}}}} by {{math|{{sqrt|''M''/3}}}}, where {{math|''M''}} is the size of fast memory.<ref>Lynn Elliot Cannon, ''[http://portal.acm.org/citation.cfm?coll=GUIDE&dl=GUIDE&id=905686 A cellular computer to implement the Kalman Filter Algorithm]'', Technical report, Ph.D. Thesis, Montana State University, 14 July 1969.</ref> The naïve algorithm is then used over the block matrices, computing products of submatrices entirely in fast memory. This reduces communication bandwidth to {{math|''O''(''n''<sup>3</sup>/{{sqrt|''M''}})}}, which is asymptotically optimal (for algorithms performing {{math|Ω(''n''<sup>3</sup>)}} computation).<ref>{{cite journal|last=Hong|first=J.W.|coauthors=H.T. Kung|title=I/O complexity: The red-blue pebble game|journal=STOC ’81: Proceedings of the thirteenth annual ACM symposium on Theory of computing|year=1981|pages=326–333}}</ref><ref name=irony>{{cite journal|last=Irony|first=Dror|coauthors=Sivan Toledo, Alexander Tiskin|title=Communication lower bounds for distributed-memory matrix multiplication|journal=J. Parallel Distrib. Comput.|date=September 2004|volume=64|issue=9|pages=1017–1026|doi=10.1016/j.jpdc.2004.03.021}}</ref>
 
In a distributed setting with {{math|''p''}} processors arranged in a {{math|{{sqrt|''p''}}}} by {{math|{{sqrt|''p''}}}} 2D mesh, one submatrix of the result can be assigned to each processor, and the product can be computed with each processor transmitting {{math|''O''(''n''<sup>2</sup>/{{sqrt|''p''}})}} words, which is asymptotically optimal assuming that each node stores the minimum {{math|''O''(''n''<sup>2</sup>/''p'')}} elements.<ref name=irony/> This can be improved by the ''3D algorithm,'' which arranges the processors in a 3D cube mesh, assigning every product of two input submatrices to a single processor. The result submatrices are then generated by performing a reduction over each row.<ref name="Agarwal">{{cite journal|last=Agarwal|first=R.C.|coauthors=S. M. Balle, F. G. Gustavson, M. Joshi, P. Palkar|title=A three-dimensional approach to parallel matrix multiplication|journal=IBM J. Res. Dev.|date=September 1995|volume=39|issue=5|pages=575–582|doi=10.1147/rd.395.0575}}</ref> This algorithm transmits {{math|''O''(''n''<sup>2</sup>/''p''<sup>2/3</sup>)}} words per processor, which is asymptotically optimal.<ref name=irony/> However, this requires replicating each input matrix element {{math|''p''<sup>1/3</sup>}} times, and so requires a factor of {{math|''p''<sup>1/3</sup>}} more memory than is needed to store the inputs. This algorithm can be combined with Strassen to further reduce runtime.<ref name="Agarwal"/> "2.5D" algorithms provide a continuous tradeoff between memory usage and communication bandwidth.<ref>{{cite journal|last=Solomonik|first=Edgar|coauthors=James Demmel|title=Communication-optimal parallel 2.5D matrix multiplication and LU factorization algorithms|journal=Proceedings of the 17th international conference on Parallel processing|year=2011|volume=Part II|pages=90–109}}</ref>
 
==Other forms of multiplication==
 
Some other ways to multiply two matrices are given below, in fact simpler than the definition above.
 
=== Hadamard product ===
{{Main|Hadamard product (matrices)}}
 
For two matrices of the same dimensions, there is the '''Hadamard product''', also known as the '''element-wise product''', '''pointwise product''', '''entrywise product''' and the '''Schur product'''.<ref>{{Harvard citations | last1=Horn | last2=Johnson|year=1985|loc=Ch. 5}}</ref> For two matrices {{math|'''A'''}} and {{math|'''B'''}} of the same dimensions, the Hadamard product {{math|'''A''' ○ '''B'''}} is a matrix of the same dimensions, the {{math|''i, j''}} element of {{math|'''A'''}} is multiplied with the {{math|''i, j''}} element of {{math|'''B'''}}, that is:
 
:<math> \left(\mathbf{A} \circ \mathbf{B}\right)_{ij} = A_{ij}B_{ij}\,,</math>
 
displayed fully:
 
:<math> \mathbf{A} \circ \mathbf{B} = \begin{pmatrix} A_{11} & A_{12} & \cdots & A_{1m} \\
A_{21} & A_{22} & \cdots & A_{2m} \\
\vdots & \vdots & \ddots & \vdots \\
A_{n1} & A_{n2} & \cdots & A_{nm} \\
\end{pmatrix}\circ\begin{pmatrix}
B_{11} & B_{12} & \cdots & B_{1m} \\
B_{21} & B_{22} & \cdots & B_{2m} \\
\vdots & \vdots & \ddots & \vdots \\
B_{n1} & B_{n2} & \cdots & B_{nm} \\
\end{pmatrix} =\begin{pmatrix}
A_{11}B_{11} & A_{12}B_{12} & \cdots & A_{1m}B_{1m} \\
A_{21}B_{21} & A_{22}B_{22} & \cdots & A_{2m}B_{2m} \\
\vdots & \vdots & \ddots & \vdots \\
A_{n1}B_{n1} & A_{n2}B_{n2} & \cdots & A_{nm}B_{nm} \\
\end{pmatrix}</math>
 
This operation is identical to many multiplying ordinary numbers ({{math|''mn''}} of them) all at once; thus the Hadamard product is [[commutative]], [[associative]] and [[distributive]] over entrywise addition. It is also a principal [[submatrix]] of the [[Kronecker product]]. It appears in [[lossy compression]] algorithms such as [[JPEG]].
 
===Frobenius product===
 
The '''Frobenius inner product''', sometimes denoted {{math|'''A''' : '''B'''}}, is the component-wise inner product of two matrices as though they are vectors. It is also the sum of the entries of the Hadamard product. Explicitly,
 
:<math>\mathbf{A}:\mathbf{B}=\sum_{i,j} A_{ij} B_{ij} = \mathrm{vec}(\mathbf{A})^\mathsf{T} \mathrm{vec}(\mathbf{B}) = \mathrm{tr}(\mathbf{A}^\mathsf{T} \mathbf{B}) = \mathrm{tr}(\mathbf{A} \mathbf{B}^\mathsf{T}),</math>
 
where "tr" denotes the [[Trace (linear algebra)|trace]] of a matrix and vec denotes [[Vectorization (mathematics)|vectorization]]. This inner product induces the [[Frobenius norm]].
 
===Kronecker product===
{{main|Kronecker product}}
 
For two matrices {{math|'''A'''}} and {{math|'''B'''}} of ''any'' different dimensions {{math|''m'' × ''n''}} and {{math|''p'' × ''q''}} respectively (no constraints on the dimensions of each matrix), the '''Kronecker product''' denoted {{math|'''A''' ⊗ '''B'''}} is a matrix with dimensions {{math|''mp'' × ''nq''}}, which has elements{{citation needed|date=October 2013}}
 
:<math> \left(\mathbf{A} \otimes \mathbf{B}\right)_{ij} = A_{1+\lfloor\frac{i-1}{p}\rfloor,\, 1+\lfloor\frac{j-1}{q}\rfloor}B_{1+\,(i-1)\, \text{mod}\, p,\, 1+\,(j-1)\, \text{mod}\, q} </math>,
 
where <math> \lfloor . \rfloor </math> represents the [[floor function]].
 
Explicitly:
 
:<math> \mathbf{A} \otimes \mathbf{B} = \begin{pmatrix}
A_{11}\mathbf{B} & A_{12}\mathbf{B} & \cdots & A_{1n}\mathbf{B} \\
A_{21}\mathbf{B} & A_{22}\mathbf{B} & \cdots & A_{2n}\mathbf{B} \\
\vdots & \vdots & \ddots & \vdots \\
A_{m1}\mathbf{B} & A_{m2}\mathbf{B} & \cdots & A_{mn}\mathbf{B} \\
\end{pmatrix}.</math>
 
This is the application of the more general [[tensor product]] applied to matrices.
 
== See also ==
 
{{Commons category|Matrix multiplication|matrix multiplication}}
<div style="-moz-column-count:3; column-count:3;">
* [[Basic Linear Algebra Subprograms]]
* [[Composition of relations]]
* [[Coppersmith–Winograd algorithm]]
* [[Cracovian]]
* [[Logical matrix]]
* [[Matrix analysis]]
* [[Matrix inversion]]
* [[Strassen algorithm]]
</div>
 
== Notes ==
{{Reflist}}
 
== References ==
* Henry Cohn, [[Robert Kleinberg]], Balazs Szegedy, and Chris Umans. Group-theoretic Algorithms for Matrix Multiplication. {{arxiv|math.GR/0511460}}. ''Proceedings of the 46th Annual Symposium on Foundations of Computer Science'', 23–25 October 2005, Pittsburgh, PA, IEEE Computer Society, pp.&nbsp;379–388.
* Henry Cohn, Chris Umans. A Group-theoretic Approach to Fast Matrix Multiplication. {{arxiv|math.GR/0307321}}. ''Proceedings of the 44th Annual IEEE Symposium on Foundations of Computer Science'', 11–14 October 2003, Cambridge, MA, IEEE Computer Society, pp.&nbsp;438–449.
* Coppersmith, D., Winograd S., ''Matrix multiplication via arithmetic progressions'', J. Symbolic Comput. 9, p.&nbsp;251-280, 1990.
* {{Citation | last1=Horn | first1=Roger A. | last2=Johnson | first2=Charles R. | title=Matrix Analysis | publisher=[[Cambridge University Press]] | isbn=978-0-521-38632-6 | year=1985}}
* {{Citation | last1=Horn | first1=Roger A. | last2=Johnson | first2=Charles R. | title=Topics in Matrix Analysis | publisher=[[Cambridge University Press]] | isbn=978-0-521-46713-1 | year=1991}}
* [[Donald Knuth|Knuth, D.E.]], ''[[The Art of Computer Programming]] Volume 2: Seminumerical Algorithms''. Addison-Wesley Professional; 3 edition (November 14, 1997). ISBN 978-0-201-89684-8. pp.&nbsp;501.
* {{Citation | last1=Press | first1=William H. | last2=Flannery | first2=Brian P. | last3=Teukolsky | first3=Saul A. | author3-link=Saul Teukolsky | last4=Vetterling | first4=William T. | title=[[Numerical Recipes|Numerical Recipes: The Art of Scientific Computing]] | publisher=[[Cambridge University Press]] | edition=3rd | isbn=978-0-521-88068-8 | year=2007}}.
* [[Ran Raz]]. On the complexity of matrix product. In Proceedings of the thirty-fourth annual ACM symposium on Theory of computing. ACM Press, 2002. {{doi|10.1145/509907.509932}}.
* Robinson, Sara, ''Toward an Optimal Algorithm for Matrix Multiplication,'' SIAM News 38(9), November 2005. [http://www.siam.org/pdf/news/174.pdf PDF]
* Strassen, Volker, ''Gaussian Elimination is not Optimal'', Numer. Math. 13, p.&nbsp;354-356, 1969.
* {{Citation | doi=10.1016/0024-3795(73)90023-2 | last=Styan | first=George P. H. | title=Hadamard Products and Multivariate Statistical Analysis | journal=Linear Algebra and its Applications | year=1973 | volume=6 | pages=217–240}}
* Vassilevska Williams, Virginia, ''Multiplying matrices faster than Coppersmith-Winograd'', Manuscript, May 2012. [http://www.cs.stanford.edu/~virgi/matrixmult-f.pdf PDF]
 
== External links ==
{{wikibooks|The Book of Mathematical Proofs|Proofs in Algebra/Proofs in Linear Algebra/Matrix Theory|Proofs of properties of matrices}}
{{wikibooks
|1= Linear Algebra
|2= Linear Algebra/Matrix Multiplication
|3= Matrix multiplication}}
{{wikibooks|Applicable Mathematics|Matrices#Multiplying Matrices|Multiplying Matrices}}
*[http://www.mathsisfun.com/algebra/matrix-multiplying.html How to Multiply Matrices]
* [[:arxiv:cs/0703145|The Simultaneous Triple Product Property and Group-theoretic Results for the Exponent of Matrix Multiplication]]
* [http://wims.unice.fr/~wims/en_tool~linear~matmult.html WIMS Online Matrix Multiplier]
* [http://ceee.rice.edu/Books/LA/mult/mult4.html#TOP Matrix Multiplication Problems]
* [http://www.gordon-taft.net/MatrixMultiplication.html Block Matrix Multiplication Problems]
*{{Citation | first1=Viraj B. | last1=Wijesuriya | title=Daniweb: Sample Code for Matrix Multiplication using MPI Parallel Programming Approach| url=http://www.daniweb.com/forums/post1428830.html#post1428830 | accessdate=2010-12-29}}
* [http://www.umat.feec.vutbr.cz/~novakm/algebra_matic/en Linear algebra: matrix operations] Multiply or add matrices of a type and with coefficients you choose and see how the result was computed.
* [http://www.wefoundland.com/project/Visual_Matrix_Multiplication Visual Matrix Multiplication] An interactive app for learning matrix multiplication.
* [http://www.ateji.com/px/whitepapers/Ateji%20PX%20MatMult%20Whitepaper%20v1.2.pdf?phpMyAdmin=95wsvAC1wsqrAq3j,M3duZU3UJ7 Matrix Multiplication in Java – Dr. P. Viry]
 
{{algebra-footer}}
 
{{DEFAULTSORT:Matrix Multiplication}}
[[Category:Matrix theory]]
[[Category:Bilinear operators]]
[[Category:Binary operations]]
[[Category:Multiplication]]
[[Category:Numerical linear algebra]]

Latest revision as of 15:30, 17 November 2014

Hi, everybody!
I'm Chinese female :).
I really like NCIS!

my weblog - how to get Free fifa 15 Coins