Whitcomb L. Notes on Kronecker Products.

定义

Stack Operator

对于任意的矩阵\(A \in \mathbb{R}^{m \times n}\),

\[vec(A) := [A_{00}, A_{10}, \ldots, A_{m-1,n-1}]^T \in \mathbb{R}^{mn},
\]

即按列展开.

Kronecker Product

对于任意的矩阵\(A \in \mathbb{R}^{m\times n }, B \in \mathbb{R}^{p \times q}\),

\[A \otimes B :=
\left [
\begin{array}{ccc}
A_{00} \cdot B & \cdots & A_{0n-1} \cdot B \\
\vdots & \ddots & \vdots \\
A_{m-1,0} \cdot B & \cdots & A_{m-1,n-1} \cdot B
\end{array} \right ] \in \mathbb{R}^{mp \times nq}
\]

性质

Stack Operator

\[\mathrm{Tr}(A^TB) = vec(A)^T vec(B).
\]

Kronecker Product

易知,

\[[A \otimes B]_{ip+s,jq+t} = A_{i,j} \cdot B_{s,t}, \quad i\in [m], s\in[p], j \in [n], t \in [q],
\]

这里\([m] = \{0, 1, \ldots, m-1\}\).

\(a \otimes b = vec(b a^T)\)

  • \(a \in \mathbb{R}^m, b \in \mathbb{R}^n\), 则
    \[a \otimes b = vec(b a^T)
    \]

\((A \otimes B)^T = (A^T \otimes B^T)\)

\((A \otimes B)^T = (A^T \otimes B^T)\)是显然的.

\[[A \otimes B]_{*, jq+t} = A_{*,j} \otimes B_{*, t} = vec(B_{*, t} A_{*,j}^T) \\
[A \otimes B]_{ip+s, *}^T = A_{i,*}^T \otimes B_{s,*}^T = vec(B^T_{s,*} A_{i,*}).
\]

半线性

  • \(A \otimes \alpha B = \alpha A \otimes B = \alpha (A \otimes B).\)

  • \[(A+B) \otimes C = A \otimes C +B \otimes C \\
    A \otimes (B+C) = A\otimes B + A \otimes C.
    \]
  • \((A \otimes B) \otimes C=A \otimes (B\otimes C)\):

    \[\begin{array}{ll}
    (A \otimes B) \otimes C &= [A_{i,j} \cdot B_{s,t} \cdot C ]\\
    &= A \otimes (B \otimes C).
    \end{array}
    \]
  • 通常 \((A \otimes B) \not= (B \otimes A)\).

\((A \otimes B) (C\otimes D) = (AC \otimes BD)\)

\[\begin{array}{ll}
[(A \otimes B) (C\otimes D)]_{ip+s, jq+t}
&= [A \otimes B]_{ip+s, *} [C\otimes D]_{*,jq+t} \\
&= vec(B_{s, *}^TA_{i,*})^T vec(D_{*,t} C_{*,j}^T) \\
&= \mathrm{Tr}(A_{i,*}^TB_{s,*}D_{*,t} C_{*,j}^T) \\
&= \mathrm{Tr}(C_{*,j}^TA_{i,*}^TB_{s,*}D_{*,t}) \\
&= A_{i, *}C_{*,j} \cdot B_{s, *} D_{*,t} \\
&= [AC]_{ij} \cdot [BD]_{st} \\
&= [AC \otimes BD]_{ip+s,jq+t}.
\end{array}
\]

\((A \otimes B)^{-1} = (A^{-1} \otimes B^{-1})\)

条件自然是A, B为满秩方阵:

\[(A \otimes B) (A^{-1} \otimes B^{-1}) = (AA^{-1} \otimes BB^{-1}) = I
\]

\(\mathrm{det}(A_{n\times n} \otimes B_{m \times m}) = \mathrm{det}(A)^m \cdot \mathrm{det}(B)^n\)

就像用普通的高斯消去法将矩阵化为对角型一样, 在对\(A_{n\times n } \otimes B_{m\times m}\)消去的过程中可以发现, \(B\)不会产生丝毫的影响, 结果便是显而易见的了.

\(\mathrm{Tr}(A \otimes B) = \mathrm{Tr}(A) \cdot \mathrm{Tr}(B)\)

\[\mathrm{Tr}(A \otimes B) = \sum_{i=1}^m \sum_{j=1}^n A_iB_j = \mathrm{Tr}(A) \cdot \mathrm{Tr}(B).
\]

\(vec(ABC) = (C^T \otimes A) vec(B)\)

设\(A \in \mathbb{R}^{m\times n}, B \in \mathbb{R}^{n \times p}, C \in \mathbb{R}^{p \times q}\),

\[[vec(ABC)]_{jm+i} = [ABC]_{i,j} = \mathrm{Tr}(A_{i,*}BC_{*,j}) = \mathrm{Tr}(C_{*,j}A_{i,*}B)=vec(A_{i,*}^TC_{*j}^T)^T vec(B) = [C^T \otimes A]_{jm+i,*} vec(B)
\]

特例:

\[Ax = IAx = vec(IAx) = (x^T \otimes I)vec(A)
\]

这个在处理梯度的时候会比较有用:

\[y = Ax
\]

\[\mathrm{d}y = (\mathrm{d}A)x + A\mathrm{d}x = (x^T \otimes I) vec(\mathrm{d}A) + A \mathrm{d}x.
\]

Kronecker Products and Stack Operator的更多相关文章

  1. C++数据结构之Linked Stack(链式栈)

    上一节用连续的方式实现栈,这种方法用一个确定大小的数组存储栈元素,因为当存储达到数组上限时会遇到麻烦. 连续实现的栈与链式实现的栈的最大不同在于,前者使用一个确定大小的数组存储每一个栈元素,后者使用带 ...

  2. STL学习系列四:Stack容器

    Stack简介 stack是堆栈容器,是一种“先进后出”的容器. stack是简单地装饰deque容器而成为另外的一种容器. #include <stack> 1.stack对象的默认构造 ...

  3. C++STL学习笔记_(3)stack

    10.2.4stack容器 Stack简介 ²  stack是堆栈容器,是一种"先进后出"的容器. ²  stack是简单地装饰deque容器而成为另外的一种容器. ²  #inc ...

  4. STL - stack(栈)

    Stack简介 stack是堆栈容器,是一种"先进后出"的容器. stack是简单地装饰deque容器而成为另外的一种容器. #include <stack> stac ...

  5. 04--STL序列容器(Stack和Queue)

    总括: stack和queue不支持迭代 一:栈Stack (一)栈的简介 stack是堆栈容器,是一种“先进后出”的容器. stack是简单地装饰deque容器而成为另外的一种容器. (二)栈的默认 ...

  6. STL之stack容器

    1.stack容器 1) stack是堆栈容器,是一种“先进后出”的容器. 2)stack是简单地装饰deque容器而成为另外的一种容器. 3)头文件.#include <stack> 2 ...

  7. STL stack 容器

    STL stack 容器 Stack简介 stack是堆栈容器,是一种“先进后出”的容器.      stack是简单地装饰deque容器而成为另外的一种容器.      #include <s ...

  8. C++ STL 之 stack

    stack 是一种先进后出(first in last out,FILO)的数据结构,它只有一个出口,stack 只允许在栈顶新增元素,移除元素,获得顶端元素,但是除了顶端之外,其他地方不允许存取 元 ...

  9. C++ Templates (2.1 类模板Stack的实现 Implementation of Class Template Stack)

    返回完整目录 目录 2.1 类模板Stack的实现 Implementation of Class Template Stack 2.1.1 声明类模板 Declaration of Class Te ...

随机推荐

  1. Tomcat简单介绍

    1.目录结构 在conf文件夹中修改了配置之后一定要重启Tomcat

  2. Charles 手机抓包

    Charles 手机抓包 请求抓包对于程序员调试代码必不可少,Charles是一个用与抓包的好工具(也可以使用Fiddler),Charles抓包是通过中间人代理实现,在客户端和服务端通信时,Char ...

  3. Jsp/Servlet文件的上传和下载

    文件上传的入门 文件上传的步骤:       总结实现思路: 1.创建核心上传类ServletFileUpload,这个时候需要一个工厂类 2.创建磁盘工厂类对象DiskFileItemFactory ...

  4. Python循环控制

    一.比较符 和算术操作符一样,布尔操作符也有操作顺序.在所有算术和比较操作符求值后,Python 先求值 not 操作符,然后是 and 操作符,然后是 or 操作符. 二.if控制 if name ...

  5. Redis版本历史

    目录 Redis4.0 Redis3.2 Redis3.0 Redis2.8 Redis2.6 Redis4.0 可能出乎很多人的意料,Redis3.2之后的版本是4.0,而不是3.4.3.6.3.8 ...

  6. DevOps到底是什么意思?

    目录 一.方法论 二.DevOps的起源 三.DevOps到底是什么 四.DevOps的发展现状 五.DevOps与虚拟化.容器.微服务 一.方法论 提到DevOps这个词,我相信很多人一定不会陌生. ...

  7. Gitlab Flow到容器

    一.简介 长话短说,本文全景呈现我司项目组gitlab flow && devops Git Flow定义了一个项目发布的分支模型,为管理具有预定发布周期的大型项目提供了一个健壮的框架 ...

  8. 开源企业平台Odoo 15社区版之项目管理应用模块功能简介

    项目管理无论是各类证书的认证,如PMP.软考高级的信息系统项目管理师.中级的系统集成项目管理工程师等,还是企业实践都有着广泛的实际应用中,至今还是处于热门的行业,合格的或优化的项目经理还是偏少,对于I ...

  9. Docker从入门到精通(七)——容器数据共享

    什么是容器数据共享?简单来说就是容器与容器之间数据共享,容器与宿主机数据共享. 1.为什么需要数据共享? ①.数据持久化 比如我们有一个MySQL集群,通过容器启动,那么项目运行过程中的数据是保存在容 ...

  10. USACO 2021 Contest 1 Bronze 题解

    蒟蒻第一次打 USACO,只打了 Bronze 就跑路了.不得不说也有很有意思的题目.接下来就看看题目吧. 由于现在还看不到题目,只给出加工后的题目大意. T1 Lonely Photo Conten ...