矩阵的普通乘积、Hadamard 积、Kronecker 积及其性质

1 普通乘积(matmul product)

        若 A \pmb{A} AAA m × n m \times n m×n 矩阵, B \pmb{B} BBB n × p n \times p n×p 矩阵, B \pmb{B} BBB 的列是 b 1 , ⋯   , b p \pmb{b_1}, \cdots, \pmb{b_p} b1b1b1,,bpbpbp,则乘积 A B \pmb{AB} ABABAB m × p m \times p m×p 矩阵,它的各列是 A b 1 , ⋯   , A b p \pmb{Ab_1}, \cdots, \pmb{Ab_p} Ab1Ab1Ab1,,AbpAbpAbp,即
A B = A [ b 1 b 2 ⋯ b p ] = [ A b 1 A b 2 ⋯ A b p ] \pmb{AB} = \pmb{A}[\pmb{b_1} \quad \pmb{b_2} \quad \cdots \quad \pmb{b_p}] = [\pmb{Ab_1} \quad \pmb{Ab_2} \quad \cdots \quad \pmb{Ab_p}] ABABAB=AAA[b1b1b1b2b2b2bpbpbp]=[Ab1Ab1Ab1Ab2Ab2Ab2AbpAbpAbp]
        提示: 线性变换可以用矩阵来表示,而矩阵乘法对应线性变换的复合。
计算 A B \pmb{AB} ABABAB 的行列法则
        若乘积 A B \pmb{AB} ABABAB 有定义, A B \pmb{AB} ABABAB 的第 i i i 行第 j j j 列的元素是 A \pmb{A} AAA 的第 i i i行与 B \pmb{B} BBB 的第 j j j 列对应元素乘积之和。若 ( A B ) i j (\pmb{AB})_{ij} (ABABAB)ij 表示 A B \pmb{AB} ABABAB ( i , j ) (i ,j) (i,j) 元素, A \pmb{A} AAA m × n m \times n m×n 矩阵,则
( A B ) i j = ∑ k = 1 n a i k b k j = a i 1 b 1 j + a i 2 b 2 j + ⋯ + a i n b n j (\pmb{AB})_{ij} = \sum_{k=1}^{n}a_{ik}b_{kj}= a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj} (ABABAB)ij=k=1naikbkj=ai1b1j+ai2b2j++ainbnj

        下面用图片做演示:
矩阵的普通乘积、Hadamard 积、Kronecker 积及其性质_第1张图片

矩阵的普通乘积、Hadamard 积、Kronecker 积及其性质_第2张图片


1. 基本性质

  • 乘法结合律: ( A B ) C = A ( B C ) (\pmb{AB})\pmb{C}=\pmb{A}(\pmb{BC}) (ABABAB)CCC=AAA(BCBCBC)
  • 乘法左分配律: ( A + B ) C = A C + B C (\pmb{A}+\pmb{B})\pmb{C}=\pmb{AC}+\pmb{BC} (AAA+BBB)CCC=ACACAC+BCBCBC
  • 乘法右分配律: C ( A + B ) = C A + C B \pmb{C}(\pmb{A}+\pmb{B})=\pmb{CA}+\pmb{CB} CCC(AAA+BBB)=CACACA+CBCBCB
  • 对数乘的结合性: k ( A B ) = ( k A ) B = A ( k B ) k(\pmb{AB})=(k\pmb{A})\pmb{B}=\pmb{A}(k\pmb{B}) k(ABABAB=(kAAA)BBB=AAA(kBBB)
  • 转置: ( A B ) T = B T A T (\pmb{AB})^T=\pmb{B}^T\pmb{A}^T (ABABAB)T=BBBTAAAT

        矩阵乘法一般不满足交换律(除了有些特殊的方阵之间的乘法)。

        满足乘法交换律的方阵称为可交换矩阵,即矩阵 A , B \pmb{A},\pmb{B} AAABBB 满足: A B = B A \pmb{AB}=\pmb{BA} ABABAB=BABABA。有以下几种情况:

                (1) 设 A , B \pmb{A},\pmb{B} AAABBB 至少有一个为零矩阵,则 A , B \pmb{A},\pmb{B} AAABBB 可交换;

                (2) 设 A , B \pmb{A},\pmb{B} AAABBB 至少有一个为单位矩阵,则 A , B \pmb{A},\pmb{B} AAABBB 可交换;

                (3) 设 A , B \pmb{A},\pmb{B} AAABBB 至少有一个为数量矩阵,则 A , B \pmb{A},\pmb{B} AAABBB 可交换;

                (4) 设 A , B \pmb{A},\pmb{B} AAABBB 均为对角矩阵,则 A , B \pmb{A},\pmb{B} AAABBB 可交换;

                (5) 设 A , B \pmb{A},\pmb{B} AAABBB 均为准对角矩阵(准对角矩阵是分块矩阵概念下的一种矩阵。即除去主对角线上分块矩阵不为零矩阵外,其余分块矩阵均为零矩阵),且对角线上的子块均可交换,则 A , B \pmb{A},\pmb{B} AAABBB 可交换;


2 哈达玛积(Hadamard product)

        Hadamard乘积 是矩阵的一类运算,对形状相同的矩阵进行运算,并产生相同维度的第三个矩阵。在数学中,Hadamard乘积(也称为 Schur乘积或逐元素乘积)是一种二元运算,它用两个具有相同维数的矩阵产生另一个具有相同维数的矩阵,其中每个元素 ( i , j ) (i, j) (i,j) 是原始两个矩阵的元素 ( i , j ) (i, j) (i,j) 的乘积。它是由法国数学家雅克·哈达玛(Jacques Hadamard)或德国数学家Issai Schur命名的。

        两个同阶的 m × n m \times n m×n 矩阵 A = [ a i j ] \pmb{A} = [a_{ij}] AAA=[aij] 与矩阵 B = [ b i j ] \pmb{B} = [b_{ij}] BBB=[bij]Hadamard积,记为 A ⊙ B \pmb{A} \odot \pmb{B} AAABBB。新矩阵元素定义为矩阵 A 、 B \pmb{A}、\pmb{B} AAABBB 对应元素的乘积,即
( A ⊙ B ) i j = a i j ∗ b i j (\pmb{A} \odot \pmb{B})_{ij} = {a_{ij}}*{b_{ij}} (AAABBB)ij=aijbij

矩阵的普通乘积、Hadamard 积、Kronecker 积及其性质_第3张图片 矩阵的普通乘积、Hadamard 积、Kronecker 积及其性质_第4张图片

1. 与正定性有关的性质

(1)正定性的传递性
        如果 m × m m \times m m×m 维矩阵 A , B \boldsymbol{A},\boldsymbol{B} A,B 是正定的(半正定)的,则他们的Hadamard积也是正定(半正定的)。
(2)正定性的反推(Fejer定理)
        我们可反推 m × m m \times m m×m 矩阵 A \boldsymbol{A} A 是半正定矩阵,当且仅当
∑ i = 1 m ∑ j = 1 m a i j b i j ⩾ 0 \sum_{i=1}^{m} \sum_{j=1}^{m} a_{i j} b_{i j} \geqslant 0 i=1mj=1maijbij0
        对所有 m × m m \times m m×m 半正定矩阵 B \boldsymbol{B} B 成立。

2. 与矩阵迹有关的性质
定理一
        令 A , B , C \boldsymbol{A}, \boldsymbol{B}, \boldsymbol{C} A,B,C m × n m \times n m×n 矩阵,并且 1 = [ 1 , 1 , ⋯   , 1 ] T \boldsymbol{1}=[1, 1, \cdots, 1]^\mathrm{T} 1=[1,1,,1]T n × 1 n \times 1 n×1 求和向量, D = d i a g ( d 1 , d 2 , ⋯   , d m ) \boldsymbol{D}=\mathrm{diag}(d_1, d_2, \cdots, d_m) D=diag(d1,d2,,dm),其中, d i = ∑ j = 1 n a i j d_{i}=\sum_{j=1}^{n} a_{i j} di=j=1naij,则
tr ⁡ ( A T ( B ⊙ C ) ) = tr ⁡ ( ( A T ⊙ B T ) C ) 1 T A T ( B ⊙ C ) 1 = tr ⁡ ( B T D C ) \operatorname{tr}\left(\boldsymbol{A}^{\mathrm{T}}(\boldsymbol{B} \odot \boldsymbol{C})\right)=\operatorname{tr}\left(\left(\boldsymbol{A}^{\mathrm{T}} \odot \boldsymbol{B}^{\mathbf{T}}\right) \boldsymbol{C}\right) \\ \quad \\ \mathbf{1}^{\mathbf{T}} \boldsymbol{A}^{\mathrm{T}}(\boldsymbol{B} \odot \boldsymbol{C}) \mathbf{1}=\operatorname{tr}\left(\boldsymbol{B}^{\mathrm{T}} \boldsymbol{D} \boldsymbol{C}\right) tr(AT(BC))=tr((ATBT)C)1TAT(BC)1=tr(BTDC)

证明:
[ A T ( B ⊙ C ) ] i i = ∑ h a h i b h i c h i = [ ( A T ⊙ B T ) C ] i i 1 T A T ( B ⊙ C ) 1 = ∑ i , j , k a k i b k j c k j = ∑ j , k d k b k j c k j = tr ⁡ ( B T D C ) \left[\boldsymbol{A}^{\mathrm{T}}(\boldsymbol{B} \odot \boldsymbol{C})\right]_{ii}=\sum_ha_{hi}b_{hi}c_{hi}=\left[\left(\boldsymbol{A}^{\mathrm{T}} \odot \boldsymbol{B}^{\mathbf{T}}\right) \boldsymbol{C}\right]_{ii} \\ \mathbf{1}^{\mathbf{T}} \boldsymbol{A}^{\mathrm{T}}(\boldsymbol{B} \odot \boldsymbol{C}) \mathbf{1}=\sum_{i,j,k}a_{ki}b_{kj}c_{kj}=\sum_{j,k}d_kb_{kj}c_{kj}=\operatorname{tr}\left(\boldsymbol{B}^{\mathrm{T}} \boldsymbol{D} \boldsymbol{C}\right) [AT(BC)]ii=hahibhichi=[(ATBT)C]ii1TAT(BC)1=i,j,kakibkjckj=j,kdkbkjckj=tr(BTDC)

定理二
        令 A , B \boldsymbol{A}, \boldsymbol{B} A,B n × n n \times n n×n 方阵,并且 1 = [ 1 , 1 , ⋯   , 1 ] T \boldsymbol{1}=[1, 1, \cdots, 1]^\mathrm{T} 1=[1,1,,1]T n × 1 n \times 1 n×1 求和向量。假定 M \boldsymbol{M} M 是一个 n × n n\times n n×n 对角矩阵 M = d i a g ( μ 1 , μ 2 , ⋯   , μ m ) \boldsymbol{M}=\mathrm{diag}(\mu_1, \mu_2, \cdots, \mu_m) M=diag(μ1,μ2,,μm) m = M 1 \boldsymbol{m}=\boldsymbol{M1} m=M1 n × 1 n \times 1 n×1 向量,则有:
tr ⁡ ( A M B T M ) = m T ( A ⊙ B ) m tr ⁡ ( A B T ) = 1 T ( A ⊙ B ) 1 M A ⊙ B T M = M ( A ⊙ B T ) M \begin{aligned} \operatorname{tr}\left(\boldsymbol{A} \boldsymbol{M} \boldsymbol{B}^{\mathrm{T}} \boldsymbol{M}\right) &=\boldsymbol{m}^{\mathrm{T}}(\boldsymbol{A} \odot \boldsymbol{B}) \boldsymbol{m} \\ \operatorname{tr}\left(\boldsymbol{A} \boldsymbol{B}^{\mathrm{T}}\right) &=\mathbf{1}^{\mathrm{T}}(\boldsymbol{A} \odot \boldsymbol{B}) \mathbf{1} \\ \boldsymbol{M} \boldsymbol{A} \odot \boldsymbol{B}^{\mathrm{T}} \boldsymbol{M} &=\boldsymbol{M}\left(\boldsymbol{A} \odot \boldsymbol{B}^{\mathrm{T}}\right) \boldsymbol{M} \end{aligned} tr(AMBTM)tr(ABT)MABTM=mT(AB)m=1T(AB)1=M(ABT)M

3. 一般性质
(1)若 A , B \pmb{A}, \pmb{B} AAA,BBB 均为 m × n m \times n m×n 矩阵,则
A ⊙ B = B ⊙ A ( A ⊙ B ) T = A T ⊙ B T ( A ⊙ B ) H = A H ⊙ B H ( A ⊙ B ) ∗ = A ∗ ⊙ B ∗ \begin{aligned} \boldsymbol{A} \odot \boldsymbol{B} &=\boldsymbol{B} \odot \boldsymbol{A} \\ (\boldsymbol{A} \odot \boldsymbol{B})^{\mathrm{T}} &=\boldsymbol{A}^{\mathrm{T}} \odot \boldsymbol{B}^{\mathrm{T}} \\ (\boldsymbol{A} \odot \boldsymbol{B})^{\mathrm{H}} &=\boldsymbol{A}^{\mathrm{H}} \odot \boldsymbol{B}^{\mathrm{H}} \\ (\boldsymbol{A} \odot \boldsymbol{B})^{*} &=\boldsymbol{A}^{*} \odot \boldsymbol{B}^{*} \end{aligned} AB(AB)T(AB)H(AB)=BA=ATBT=AHBH=AB
(2)任意矩阵与零矩阵的Hadamard积: A ⊙ O m × n = O m × n ⊙ A = O m × n \boldsymbol{A} \odot \boldsymbol{O}_{m \times n}=\boldsymbol{O}_{m \times n} \odot \boldsymbol{A}=\boldsymbol{O}_{m \times n} AOm×n=Om×nA=Om×n
​(3)若 c c c 为常数,则 c ( A ⊙ B ) = ( c A ) ⊙ B = A ⊙ ( c B ) c(\boldsymbol{A} \odot \boldsymbol{B})=(c \boldsymbol{A}) \odot \boldsymbol{B}=\boldsymbol{A} \odot(\boldsymbol{c} \boldsymbol{B}) c(AB)=(cA)B=A(cB)
(4)正定(或半正定)矩阵 A , B \boldsymbol{A},\boldsymbol{B} A,BHadamard A ⊙ B \boldsymbol{A} \odot \boldsymbol{B} AB 也是正定(或半正定的)。
(5)矩阵 A m × m = [ a i j ] \boldsymbol{A}_{m \times m}=\left[a_{i j}\right] Am×m=[aij] 与单位矩阵 I m \boldsymbol{I}_m ImHadamard积为 m × m m \times m m×m 对角矩阵,即:
A ⊙ I m = I m ⊙ A = diag ⁡ ( A ) = diag ⁡ ( a 11 , a 22 , ⋯   , a m m ) \boldsymbol{A} \odot \boldsymbol{I}_{m}=\boldsymbol{I}_{m} \odot \boldsymbol{A}=\operatorname{diag}(\boldsymbol{A})=\operatorname{diag}\left(a_{11}, a_{22}, \cdots, a_{m m}\right) AIm=ImA=diag(A)=diag(a11,a22,,amm)
(6)若 A , B , C , D \boldsymbol{A},\boldsymbol{B},\boldsymbol{C},\boldsymbol{D} A,B,C,D 均为 m × n m \times n m×n 矩阵,则
A ⊙ ( B ⊙ C ) = ( A ⊙ B ) ⊙ C = A ⊙ B ⊙ C ( A ± B ) ⊙ C = A ⊙ C ± B ⊙ C ( A + B ) ⊙ ( C + D ) = A ⊙ C + A ⊙ D + B ⊙ C + B ⊙ D \begin{aligned} \boldsymbol{A} \odot(\boldsymbol{B} \odot \boldsymbol{C}) &=(\boldsymbol{A} \odot \boldsymbol{B}) \odot \boldsymbol{C}=\boldsymbol{A} \odot \boldsymbol{B} \odot \boldsymbol{C} \\ (\boldsymbol{A} \pm \boldsymbol{B}) \odot \boldsymbol{C} &=\boldsymbol{A} \odot \boldsymbol{C} \pm \boldsymbol{B} \odot \boldsymbol{C} \\ (\boldsymbol{A}+\boldsymbol{B}) \odot(\boldsymbol{C}+\boldsymbol{D}) &=\boldsymbol{A} \odot \boldsymbol{C}+\boldsymbol{A} \odot \boldsymbol{D}+\boldsymbol{B} \odot \boldsymbol{C}+\boldsymbol{B} \odot \boldsymbol{D} \end{aligned} A(BC)(A±B)C(A+B)(C+D)=(AB)C=ABC=AC±BC=AC+AD+BC+BD
(7)若 A , B , D \boldsymbol{A},\boldsymbol{B},\boldsymbol{D} A,B,D m × m m \times m m×m 矩阵,且 D \boldsymbol{D} D 为对角矩阵,则
( D A ) ⊙ ( B D ) = D ( A ⊙ B ) D (\boldsymbol{D}\boldsymbol{A})\odot(\boldsymbol{B}\boldsymbol{D})=\boldsymbol{D}(\boldsymbol{A}\odot\boldsymbol{B})\boldsymbol{D} (DA)(BD)=D(AB)D
(8)若 A , C \boldsymbol{A},\boldsymbol{C} A,C m × m m \times m m×m 矩阵,且 B , D \boldsymbol{B},\boldsymbol{D} B,D n × n n \times n n×n 矩阵。则
( A ⊕ B ) ⊙ ( C ⊕ D ) = ( A ⊙ C ) ⊕ ( B ⊙ D ) (\boldsymbol{A} \oplus \boldsymbol{B}) \odot(\boldsymbol{C} \oplus \boldsymbol{D})=(\boldsymbol{A} \odot \boldsymbol{C}) \oplus(\boldsymbol{B} \odot \boldsymbol{D}) (AB)(CD)=(AC)(BD)
(9)若 A , B , C \boldsymbol{A},\boldsymbol{B},\boldsymbol{C} A,B,C m × n m \times n m×n 矩阵,则
tr ⁡ ( A T ( B ⊙ C ) ) = tr ⁡ ( ( A T ⊙ B T ) C ) \operatorname{tr}\left(\boldsymbol{A}^{\mathrm{T}}(\boldsymbol{B} \odot \boldsymbol{C})\right)=\operatorname{tr}\left(\left(\boldsymbol{A}^{\mathrm{T}} \odot \boldsymbol{B}^{\mathrm{T}}\right) \boldsymbol{C}\right) tr(AT(BC))=tr((ATBT)C)

4. Hadamard积满足的不等式
(1)Oppenheim不等式:令 A \boldsymbol{A} A B \boldsymbol{B} B n × n n \times n n×n 半正定矩阵,则
∣ A ⊙ B ∣ ⩾ a 11 ⋯ a n n ∣ B ∣ |\boldsymbol{A} \odot \boldsymbol{B}| \geqslant a_{11} \cdots a_{n n}|\boldsymbol{B}| ABa11annB
        若 B = I n \boldsymbol{B}=\boldsymbol{I}_n B=In,且 A \boldsymbol{A} A n × n n \times n n×n 半正定矩阵,则有Hadamard不等式:
∣ A ∣ ≤ a 11 ⋯ a n n |\boldsymbol{A}|\leq a_{11}\cdots a_{nn} Aa11ann
        这是因为 ∣ A ∣ = b 11 ⋯ b n n ∣ A ∣ ⩽ ∣ I n ⊙ A ∣ |\boldsymbol{A}|=b_{11} \cdots b_{n n}|\boldsymbol{A}| \leqslant\left|\boldsymbol{I}_{n} \odot \boldsymbol{A}\right| A=b11bnnAInA I n ⊙ A = diag ⁡ ( a 11 , ⋯   , a n n ) \boldsymbol{I}_{n} \odot \boldsymbol{A}=\operatorname{diag}\left(a_{11}, \cdots, a_{n n}\right) InA=diag(a11,,ann),故而有 ∣ A ∣ ≤ a 11 ⋯ a n n |\boldsymbol{A}|\leq a_{11}\cdots a_{nn} Aa11ann

(2)令 A \boldsymbol{A} A B \boldsymbol{B} B n × n n \times n n×n 半正定矩阵,则 ∣ A ⊙ B ∣ ⩾ ∣ A B ∣ |\boldsymbol{A} \odot \boldsymbol{B}| \geqslant|\boldsymbol{A} \boldsymbol{B}| ABAB
∣ A ⊙ B ∣ ⩾ ∣ A B ∣ |\boldsymbol{A} \odot \boldsymbol{B}| \geqslant|\boldsymbol{A} \boldsymbol{B}| ABAB
(3)特征值不等式:令 A \boldsymbol{A} A B \boldsymbol{B} B n × n n \times n n×n 半正定矩阵, λ 1 , ⋯   , λ n \lambda_{1}, \cdots, \lambda_{n} λ1,,λn 是Hadamard积 A ⊙ B \boldsymbol{A} \odot \boldsymbol{B} AB 的特征值,而 λ ^ 1 , ⋯   , λ ^ n \hat{\lambda}_{1}, \cdots, \hat{\lambda}_{n} λ^1,,λ^n 是矩阵乘积 A B \boldsymbol{A}\boldsymbol{B} AB 的特征值,则
∏ i = k n λ i ⩾ ∏ i = k n λ ^ i , k = 1 , ⋯   , n \prod_{i=k}^{n} \lambda_{i} \geqslant \prod_{i=k}^{n} \hat{\lambda}_{i}, \quad k=1, \cdots, n i=knλii=knλ^i,k=1,,n

(4)Hadamard积的秩不等式:令 A \boldsymbol{A} A B \boldsymbol{B} B n × n n \times n n×n 矩阵,则
rank ⁡ ( A ⊙ B ) ⩽ rank ⁡ ( A ) rank ⁡ ( B ) \operatorname{rank}(\boldsymbol{A} \odot \boldsymbol{B}) \leqslant \operatorname{rank}(\boldsymbol{A}) \operatorname{rank}(\boldsymbol{B}) rank(AB)rank(A)rank(B)


3 克罗内克积(Kronecker Product)

        Kronecker 积 是两个任意大小矩阵间的运算,表示为 A ⊗ B \pmb{A} \otimes \pmb{B} AAABBB。如果 A \pmb{A} AAA 是一个 m × n m \times n m×n 的矩阵,而 B \pmb{B} BBB 是一个 p × q p \times q p×q 的矩阵,克罗内克积则是一个 m p × n q mp \times nq mp×nq 的分块矩阵。克罗内克积也称为直积或张量积,以德国数学家利奥波德·克罗内克命名。计算过程如下:
A ⊗ B = [ a i j B ] i = 1 , j = 1 m , n = [ a 11 B ⋯ a 1 n B ⋮ ⋱ ⋮ a m 1 B ⋯ a m n B ] \pmb{A}\otimes \pmb{B}= [a_{ij}\pmb{B}]_{i=1,j=1}^{m,n} = \begin{bmatrix}a_{11}\pmb{B}&\cdots&a_{1n}\pmb{B}\\\vdots&\ddots&\vdots\\a_{m1}\pmb{B}&\cdots&a_{mn}\pmb{B}\end{bmatrix} AAABBB=[aijBBB]i=1,j=1m,n=a11BBBam1BBBa1nBBBamnBBB
        更具体地可表示为:
A ⊗ B = [ a 11 b 11 a 11 b 12 ⋯ a 11 b 1 q ⋯ ⋯ a 1 n b 11 a 1 n b 12 ⋯ a 1 n b 1 q a 11 b 21 a 11 b 22 ⋯ a 11 b 2 q ⋯ ⋯ a 1 n b 21 a 1 n b 22 ⋯ a 1 n b 2 q ⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮ a 11 b p 1 a 11 b p 2 ⋯ a 11 b p q ⋯ ⋯ a 1 n b p 1 a 1 n b p 2 ⋯ a 1 n b p q ⋮ ⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ ⋮ ⋮ ⋮ a m 1 b 11 a m 1 b 12 ⋯ a m 1 b 1 q ⋯ ⋯ a m n b 11 a m n b 12 ⋯ a m n b 1 q a m 1 b 21 a m 1 b 22 ⋯ a m 1 b 2 q ⋯ ⋯ a m n b 21 a m n b 22 ⋯ a m n b 2 q ⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮ a m 1 b p 1 a m 1 b p 2 ⋯ a m 1 b p q ⋯ ⋯ a m n b p 1 a m n b p 2 ⋯ a m n b p q ] \pmb{A}\otimes \pmb{B}=\begin{bmatrix} a_{11}b_{11}&a_{11}b_{12}&\cdots&a_{11}b_{1q}& \cdots&\cdots&a_{1n}b_{11}&a_{1n}b_{12}&\cdots&a_{1n}b_{1q}\\ a_{11}b_{21}&a_{11}b_{22}&\cdots&a_{11}b_{2q}& \cdots&\cdots&a_{1n}b_{21}&a_{1n}b_{22}&\cdots&a_{1n}b_{2q}\\ \vdots&\vdots&\ddots&\vdots&&&\vdots&\vdots&\ddots&\vdots\\ a_{11}b_{p1}&a_{11}b_{p2}&\cdots&a_{11}b_{pq}& \cdots&\cdots&a_{1n}b_{p1}&a_{1n}b_{p2}&\cdots&a_{1n}b_{pq}\\ \vdots&\vdots&&\vdots&\ddots&&\vdots&\vdots&&\vdots\\ \vdots&\vdots&&\vdots&&\ddots&\vdots&\vdots&&\vdots\\ a_{m1}b_{11}&a_{m1}b_{12}&\cdots&a_{m1}b_{1q}& \cdots&\cdots&a_{mn}b_{11}&a_{mn}b_{12}&\cdots&a_{mn}b_{1q}\\ a_{m1}b_{21}&a_{m1}b_{22}&\cdots&a_{m1}b_{2q}& \cdots&\cdots&a_{mn}b_{21}&a_{mn}b_{22}&\cdots&a_{mn}b_{2q}\\ \vdots&\vdots&\ddots&\vdots&&&\vdots&\vdots&\ddots&\vdots\\ a_{m1}b_{p1}&a_{m1}b_{p2}&\cdots&a_{m1}b_{pq}& \cdots&\cdots&a_{mn}b_{p1}&a_{mn}b_{p2}&\cdots&a_{mn}b_{pq} \end{bmatrix} AAABBB=a11b11a11b21a11bp1am1b11am1b21am1bp1a11b12a11b22a11bp2am1b12am1b22am1bp2a11b1qa11b2qa11bpqam1b1qam1b2qam1bpqa1nb11a1nb21a1nbp1amnb11amnb21amnbp1a1nb12a1nb22a1nbp2amnb12amnb22amnbp2a1nb1qa1nb2qa1nbpqamnb1qamnb2qamnbpq

        提示: 一个列向量乘以一个行向量称作向量的外积,外积是一种特殊的克罗内克积,结果是一个矩阵。

Kronecker积的性质:
                (1)对于矩阵 A m × n \pmb{A}^{m \times n} AAAm×n B p × q \pmb{B}^{p \times q} BBBp×q,一般有 A ⊗ B ≠ B ⊗ A \pmb{A}\otimes \pmb{B}\not=\pmb{B}\otimes \pmb{A} AAABBB=BBBAAA
                (2)任意矩阵与零矩阵的Kronecker积等于零矩阵,即 A ⊗ O = O ⊗ A = O \pmb{A}\otimes \pmb{O}=\pmb{O}\otimes \pmb{A} =\pmb{O} AAAOOO=OOOAAA=OOO
                (3)若 α \alpha α β \beta β 为常数,则 α A ⊗ β B = α β ( A ⊗ B ) \alpha\pmb{A}\otimes \beta\pmb{B} =\alpha\beta(\pmb{A}\otimes \pmb{B}) αAAAβBBB=αβ(AAABBB)
                (4) m m m 维与 n n n 维两个单位矩阵的Kronecker积为 m n mn mn 维单位矩阵,即 I m ⊗ I n = I m n \pmb{I}_m\otimes \pmb{I}_n = \pmb{I}_{mn} IIImIIIn=IIImn

        以上性质部分借鉴自——张贤达《矩阵分析与应用》第二版中的Hadamard积和Kronecker积部分。


4 Python 实现

from numpy import array, array_equal, kron

A = array([[3, 1], [1, 3]])

B = array([[5, -1], [-1, 5]])

H = array([[15, -1], [-1, 15]])

AB = array([[14, 2], [2, 14]])

K = array([[15, -3, 5, -1], [-3, 15, -1, 5], [5, -1, 15, -3], [-1, 5, -3, 15]])

# Hadamard product
assert (array_equal(A * B, H))

# Ordinary matrix product
assert (array_equal(A @ B, AB))

# Kronecker Product
assert (array_equal(kron(A, B), K))

参考

  • Hadamard Product:https://www.maixj.net/misc/hadamard-product-19256
  • Hadamard product:https://www.johndcook.com/blog/2018/10/10/hadamard-product/
  • Kronecker Products:https://archive.siam.org/books/textbooks/OT91sample.pdf
  • On the Kronecker Product:https://www.math.uwaterloo.ca/~hwolkowi/henry/reports/kronthesisschaecke04.pdf
  • 矩阵乘法的定义:https://baijiahao.baidu.com/s?id=1676409898205090544&wfr=spider&for=pc

你可能感兴趣的:(数学基础,矩阵,线性代数,哈达玛积,克罗内克积)