Description of fast matrix multiplication algorithm: ⟨4×5×7:109⟩

Algorithm type

X4Y3Z4+X3Y4Z4+X4Y3Z3+X3Y3Z3+2X2Y5Z2+X2Y5Z+XY5Z2+22X2Y2Z2+3X2YZ2+4XY3Z+XY2Z2+X2YZ+12XY2Z+58XYZX4Y3Z4X3Y4Z4X4Y3Z3X3Y3Z32X2Y5Z2X2Y5ZXY5Z222X2Y2Z23X2YZ24XY3ZXY2Z2X2YZ12XY2Z58XYZX^4*Y^3*Z^4+X^3*Y^4*Z^4+X^4*Y^3*Z^3+X^3*Y^3*Z^3+2*X^2*Y^5*Z^2+X^2*Y^5*Z+X*Y^5*Z^2+22*X^2*Y^2*Z^2+3*X^2*Y*Z^2+4*X*Y^3*Z+X*Y^2*Z^2+X^2*Y*Z+12*X*Y^2*Z+58*X*Y*Z

Algorithm definition

The algorithm ⟨4×5×7:109⟩ could be constructed using the following decomposition:

⟨4×5×7:109⟩ = ⟨2×3×4:20⟩ + ⟨2×3×3:15⟩ + ⟨2×2×4:14⟩ + ⟨2×3×4:20⟩ + ⟨2×2×4:14⟩ + ⟨2×3×3:15⟩ + ⟨2×2×3:11⟩.

This decomposition is defined by the following equality:

TraceMulA_1_1A_1_2A_1_3A_1_4A_1_5A_2_1A_2_2A_2_3A_2_4A_2_5A_3_1A_3_2A_3_3A_3_4A_3_5A_4_1A_4_2A_4_3A_4_4A_4_5B_1_1B_1_2B_1_3B_1_4B_1_5B_1_6B_1_7B_2_1B_2_2B_2_3B_2_4B_2_5B_2_6B_2_7B_3_1B_3_2B_3_3B_3_4B_3_5B_3_6B_3_7B_4_1B_4_2B_4_3B_4_4B_4_5B_4_6B_4_7B_5_1B_5_2B_5_3B_5_4B_5_5B_5_6B_5_7C_1_1C_1_2C_1_3C_1_4C_2_1C_2_2C_2_3C_2_4C_3_1C_3_2C_3_3C_3_4C_4_1C_4_2C_4_3C_4_4C_5_1C_5_2C_5_3C_5_4C_6_1C_6_2C_6_3C_6_4C_7_1C_7_2C_7_3C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,C_1_2+C_1_4],[C_4_1+C_4_3,C_4_2+C_4_4],[C_5_1+C_5_3,C_5_4+C_5_2]])))+Trace(Mul(Matrix(2, 2, [[A_3_2+A_3_4,A_3_3+A_3_5],[A_4_2+A_4_4,A_4_5+A_4_3]]),Matrix(2, 3, [[B_2_1,B_2_4,B_2_5],[B_3_1,B_3_4,B_3_5]]),Matrix(3, 2, [[C_1_3-C_3_3,C_1_4-C_3_4],[C_4_3-C_6_3,-C_6_4+C_4_4],[C_5_3-C_7_3,C_5_4-C_7_4]])))

N.B.: for any matrices A, B and C such that the expression Tr(Mul(A,B,C)) is defined, one can construct several trilinear homogeneous polynomials P(A,B,C) such that P(A,B,C)=Tr(Mul(A,B,C)) (P(A,B,C) variables are A,B and C's coefficients). Each trilinear P expression encodes a matrix multiplication algorithm: the coefficient in C_i_j of P(A,B,C) is the (i,j)-th entry of the matrix product Mul(A,B)=Transpose(C).

Algorithm description

These encodings are given in compressed text format using the maple computer algebra system. In each cases, the last line could be understood as a description of the encoding with respect to classical matrix multiplication algorithm. As these outputs are structured, one can construct easily a parser to its favorite format using the maple documentation without this software.


Back to main table