Strassen Formulas
The usual number of scalar operations (i.e., the total number of additions and multiplications) required to perform n×n matrix multiplication is
| M(n)=2n^3-n^2 |
(1)
|
(i.e., n^3 multiplications and n^3-n^2 additions). However, Strassen (1969) discovered how to multiply two matrices in
| S(n)=7·7^(lgn)-6·4^(lgn) |
(2)
|
scalar operations, where lg is the logarithm to base 2, which is less than M(n) for n>654. For n a power of two (n=2^k), the two parts of (2) can be written
so (◇) becomes
| S(2^k)=7n^(lg7)-6n^2. |
(13)
|
The leading exponent for Strassen's algorithm for a power of 2 is therefore lg7 approx 2.808.
The folowing table summarizes the improvements of proven limits in the leading exponent omega for mth powers of the construction of Coppersmith and Winograd (1990) over time (cf. Le Gall 2014, Table I).
Using Strassen multipication, 2×2 matrices can be multiplied
| C=AB |
(14)
|
| [画像: [c_(11) c_(12); c_(21) c_(22)]=[a_(11) a_(12); a_(21) a_(22)][b_(11) b_(12); b_(21) b_(22)] ] |
(15)
|
with only
| S(2)=7·2^(lg7)-6·2^2=49-24=25 |
(16)
|
scalar operations (as it turns out, seven of them are multiplications and 18 are additions). Define the seven products (involving a total of 10 additions) as
Then the matrix product is given using the remaining eight additions as
(Strassen 1969, Press et al. 1989).
Matrix inversion of a 2×2 matrix A to yield C=A^(-1) can also be done in fewer operations than expected using the formulas
(Strassen 1969, Press et al. 1989).
Unfortunately, Strassen's algorithm is not numerically well-behaved. It is only weakly stable, i.e., the computed result C=AB satisfies the inequality
| ||C-AB||<=nu||A||||B||+O(u^2), |
(39)
|
where u is the unit roundoff error, while the corresponding strong stability inequality (obtained by replacing matrix norms with absolute values of the matrix elements) does not hold.
AlphaTensor, a reinforcement-learning system developed by DeepMind, found a method for multiplying 4×4 matrices over Z_2 using 47 scalar multiplications. This improves on the 49 multiplications obtained by applying Strassen's formulas twice (Fawzi et al. 2022).
See also
Complex Multiplication, Karatsuba Multiplication, Matrix MultiplicationExplore with Wolfram|Alpha
More things to try:
References
Coppersmith, D. and Winograd, S. "Matrix Multiplication via Arithmetic Programming." J. Symb. Comput. 9, 251-280, 1990.Davie, A. M.; and Strothers, A. J. "Improved Bound for Complexity of Matrix Multiplication." Proc. Royal Soc. Edinburgh 143A, 351-370, 2013.Douglas, C.; Heroux, M.; Slishman, G.; and Smith, R. "GEMMW: A Portable Level 3 BLAS Winograd Variant of Strassen's Matrix-Matrix Multiply Algorithm." J. Comput. Phys. 110, 1-10, 1994.Fawzi, A. et al. "Discovering Faster Matrix Multiplication Algorithms With Reinforcement Learning." Nature 610, 47-53, 2022. https://doi.org/10.1038/s41586-022-05172-4.Le Gall, F. "Powers of Tensors and Fast Matrix Multiplication." 30 Jan 2014. https://arxiv.org/abs/1401.7714.Pan, V. How to Multiply Matrices Faster. New York: Springer-Verlag, 1982.Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T. "Is Matrix Inversion an N^3 Process?" §2.11 in Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England: Cambridge University Press, pp. 95-98, 1989.Strassen, V. "Gaussian Elimination is Not Optimal." Numerische Mathematik 13, 354-356, 1969.Strothers, A. "On the Complexity of Matrix Multiplication." Ph.D. thesis. Edinburgh, Scotland: University of Edinburgh, 2010.Vassilevska Williams, V. "Multiplying Matrices Faster Than Coppersmith-Winograd." In STOC'12--Proceedings of the 2012 ACM Symposium on Theory of Computing. New York: ACM, pp. 887-898, 2012.Vassilevska Williams, V. "Multiplying Matrices in O(n^2.373)." Jul. 1, 2014. http://theory.stanford.edu/~virgi/matrixmult-f.pdf.Referenced on Wolfram|Alpha
Strassen FormulasCite this as:
Weisstein, Eric W. "Strassen Formulas." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/StrassenFormulas.html