Dec 4, 2017 - R. R. Aidagulov and M. V. Shamolin. UDC 512; 519.6. Abstract. A method for calculation of matrix product based on color algebras is proposed.
DOI 10.1007/s10958-017-3593-z Journal of Mathematical Sciences, Vol. 227, No. 4, December, 2017
FAST MATRIX MULTIPLICATION BY USING COLOR ALGEBRAS R. R. Aidagulov and M. V. Shamolin
UDC 512; 519.6
Abstract. A method for calculation of matrix product based on color algebras is proposed.
A matrix analog of the Karatsuba algorithm of fast multiplication of numbers was proposed by Strassen in 1969 (see [8]). Until now, there is no matrix analogs of the Cooley–Tukey algorithm of fast multiplication of numbers based on the fast Fourier transform. Methods of group algebra for matrix multiplication are similar to methods of fast matrix transformations (see [5]), but they did not give good results. The reasons for this can be understood from the below. Stronger results were obtained by using trilinear tensors (see [9]). However, there were no substantial success after the paper [4] (see [6]). In the present paper, we propose an algorithm for computation of matrix product, which is an analog of the method of multiplication of large numbers based on the fast Fourier transform. The method proposed below is based on color algebras (see [2]). More exactly, we use a quasicommutative algebra; we call it the bi-group algebra by analogy with group algebras and bi-characters. In foreign literature, this algebra has a different name, but, in the authors’ opinion, the name “bi-group algebra” is more natural. Let G be a finite Abelian group. A bi-group algebra is defined as the extension of the group algebra consisting of formal sums: aμg μg, aμg ∈ K, μ ∈ G∗ , g ∈ G, μ,g
where aμg ∈ K coefficients from some field K and μ ∈ G∗ are characters from the character group of the group G. The group algebra is a commutative subalgebra of the bi-group algebra; it consists of elements whose coefficients of nonidentity characters vanish. In the group algebra, as in a vector space, we choose a basis eg = g, g ∈ G. We define the bi-group algebra as the algebra of operators in the vector space (in the group algebra). The action of an element h ∈ G is defined according to the multiplication law in the group, and characters act as diagonal matrices: h(eg ) = ehg ,
μ(eg ) = μ(g)eg .
We define the action of the operators μg and gμ on vectors: μg(eh ) = μ(egh ) = μ(gh)egh = μ(g)μ(h)g(eh ) = μ(g)(gμ)(eh ). Thus, μg = μ(g)gμ, i.e., the bi-group algebra is a color algebra whose group of colors is the direct sum of two isomorphic groups: the group of characters and the group itself. In the sequel, we need the following well-known lemma. Translated from Sovremennaya Matematika i Ee Prilozheniya (Contemporary Mathematics and Its Applications), Vol. 100, Geometry and Mechanics, 2016.
402
c 2017 Springer Science+Business Media New York 1072–3374/17/2274–0402
Lemma 1. Let G be a finite commutative group of order n. Assume that there exists a primitive root of degree n in K ∗ . Then the following relations between characters and elements of the groups hold: |G|, g = e, |G|, μ = e, μ(g) = μ(g) = 0, g = e; 0, μ = e. μ∈G∗ g∈G Using Lemma 1, we prove the following theorem. Theorem 1. Let G be a commutative group of order n. Then the bi-group algebra is isomorphic to the algebra of (n × n)-matrices. Proof. The bi-group algebra has dimension n2 , as the algebra of matrices. Consider matrices of the form egl , all of whose elements are zero except for the element of the gth row and lth column, which is equal to 1, It suffices to prove that this matrix egl corresponds to some element of the bi-group algebra. For this, we prove that the polynomial 1 1 −1 g μl = μ(g−1 )μgl−1 a= |G| μ |G| μ corresponds to some matrix egl in the basis eg . We calculate the action of an element a on one of the vectors eh : 1 −1 a(eh ) = μ(l h)egl−1 h . |G| μ Due to Lemma 1, this sum vanishes for h = l, whereas for h = l we see that the image of the vector eh is eg . This means that the matrix egl corresponds to the element a of the bigroup algebra. To a matrix A= agl egl , g,l
we put in correspondence the following polynomial: 1 a ¯μg μg, a ¯μg = μ(g−1 l−1 )ag+l,l . |G| μ,g l
Multiplying this relation by μ(s) from the left and from the right and summing over all characters, we arrive at the inverse formula μ(s)¯ aμl . asl = μ
The theorem is proved. We choose generators in the cyclic decomposition into subgroups,
G = Z n1 ⊕ Z n2 . . . ⊕ Z nk , and assign them the variables y1 , . . . , yk . Similarly, to the decomposition in the group of characters, we assign the variables x1 , . . . , xk . All variables pairwise commute, except for dual (i.e., xi ↔ yi ) and their powers: xi y i = θ i y i xi , where θi is a primitive root of 1 of degree ni . Note that the variables xni i and yini commute with all polynomials of these variables; therefore, we can assume that they belong to a field: xni i = ai ,
yini = bi .
Thus, we obtain quasi-commutative polynomials corresponding to the bi-group algebra. We will use normed constants ai = bi = 1, although spinors are normed by the condition ai = −1 = bi . 403
If k > 1, then it is convenient to use multi-indices i = (i1 , i2 , . . . , ik ),
θ = (θ1 , . . . , θk ),
x = (x1 , x2 , . . . , xk ),
y = (y1 , . . . , yk ).
Operations over multi-index values are defined component-wise: i + j = (i1 + j1 , . . . , ik + jk ),
ij = (i1 j1 , . . . , ik jk ),
xi = xi11 xi22 . . . xikk .
Then polynomials can be considered as polynomials of two (multi-index) variables with the commutation relation xi y j = θ ij y j xi . This notation is also useful for tensor products of k objects. Using the multi-index notation, we can write elements of the bi-group algebra as follows: aij xi y j , bij xi y j . i,j
i,j
Their product has the form
cij xi y j .
i,j
The coefficients are calculated by the formula akl bi−k,j−l θ l(k−i) . cij = k,l
Now we define a decomposition of polynomials into parts that commute similarly. Let aij xi , ϕi = bij y j . fj (x) = i
j
Then the product of polynomial is expressed as follows: θ −ij xi fj (x)ϕi (y)y j . i,j
Pairs i, j such that θ ij yield the same value can be joined; this yields the multiplicative convolution of our objects. The product of polynomials can be calculated by its values by using the inverse Fourier transform of values for the group G ⊕ G of order n2 : 1 −iα−jβ gij xi y j , gij = 2 θ g¯αβ , g¯αβ = g(θ α , θ β ). g(x, y) = n i,j
α,β
Thus, values of polynomials completely define the polynomial itself. We calculate the values of the product of polynomials through its values: fαj = fj (θ α ),
ϕiβ = ϕi (θ β ).
To obtain these values, we need 2n Fourier images of length n. Thus, θ αi ϕiβ θ (β−i)j fαj . g¯αβ = i
j
The inner summation is nothing else than the Fourier transform; it can be easily calculated; we write this in the form f¯α,β−i . It remains to calculate θ αi ϕiβ f¯α,β−i . g¯αβ = i
Introduce the notation
404
Fαk = θ −kαf¯αk .
Then g¯αβ = θ αβ
ϕβ−i,β Fαi .
i
All calculations needed must be performed simultaneously for all sets with the same product αβ = γ. For this, we preliminary calculate the values corresponding to α = 0 and β = 0 and terms corresponding to i = 0, i.e., ϕββ Fα0 . This requires O(n2 ) operations. After this, it remains to calculate values simultaneously for all sets αβ = γ = 0 with nonzero product. This can be done by the reduction to the multiplicative convolution. Note that an Abelian group can be decomposed into the direct sum of Sylow subgroups; then the multiplication in the bi-group algebra corresponds to the multiplication in the tensor product of matrices whose orders are powers of prime numbers. Since the set of powers of prime numbers has zero density, we restrict ourselves to the case where the number n = p is prime. In this case, all nonzero indices are invertible (with respect to multiplication). Consider the polynomials Fga ,gi xi z a , Φ(x, z) = ϕgb −gb−j ,gb xj z b , F (x, z) = 0≤i,a