6 minute read

参考:

1. 预备知识:covectorPermalink

假定 V is a vector space over a field K。以下四个名字:

  • linear functional
  • linear form
  • one-form
  • covector

指的是同一个对象:a function f:VK which satisfies linearity:

  • f(v+w)=f(v)+f(w),v,wV
  • f(av)=af(v),vV,aK

一般这个 field K 就是 R,所以 covector 就是一个函数,它接收一个 (column) vector 作为参数,返回一个实数。

但本质上,我们也可以把 covector 理解为一个 (row) vector,因为我们可以定义 f(v)=wTv=aR。进一步,我们集齐所有这样的函数 f,得到集合 HomK(V,K)={f:VKf is linear},这个集合可以构成一个 vector space over K with operations of addition and scalar multiplication。我们称这个 vector space 为 V,它是 vector space V 的 (algebraic) dual space。

注:

  • Hom 的意思是 “homomorphism”, a transformation of one set, say A, into another, say A, that the relations between elements of A are preserved in A.
  • 换个角度考虑,vector 可以看做一个 g:KV,但是研究这个似乎没有意义

2. 预备知识:Einstein summation conventionPermalink

其实就是个简写。比如把 y=i=13cixi=c1x1+c2x2+c3x3 简写成 y=cixi。注意这里 xi 不是表示 “i 次方” 而是 “第 i 维”。

应用到 vector 的场合,假设有 vRn,我们一般展开是:

v=i=1nviei

其中 vi 是分量,ei 是 basis (基),即:

  • e1=[1000]TRn
  • e2=[0100]TRn
  • en=[0001]TRn

用 Einstein summation convention 就可以简写成:

v=viei

为了以示区别,covector wT 我们一般写成:

wT=wiei

其中:

  • e1=[1000]
  • e2=[0100]
  • en=[0001]

3. 预备知识:Banach space / Vector space from continuous n-linear mapsPermalink

Wikipedia: Banach space

… a Banach space (pronounced [ˈbanax]) is a complete normed vector space. Thus, a Banach space is a vector space with a metric that allows the computation of vector length and distance between vectors and is complete in the sense that a Cauchy sequence of vectors always converges to a well defined limit that is within the space.

Let V,K, denote Banach spaces. We define Ln(V1,,Vn;K) denotes the vector space of continuous n-linear maps of V1××VnK.

注意:

  • 这里 Vi×Vj× 是 cartesian product,也就是说:f:V1××VnK 是一个函数,它接收一个 n-tuple of vectors,返回一个 K 的元素
    • f(v1,,vn)=k 其中 viVi,kK
  • f:V1××VnR 可以理解成一个 n-tuple of covectors,比如 (w1T,,wnT),因为我们可以定义 f(v1,,vn)=i=1nwiTvi=aR
  • 这么一来,Ln(V1,,Vn;R) 其实是一个 “元素为 n-tuple of covectors” 的 space。但是你结合 Digest of Essence of Linear Algebra 最后的部分,”n-tuple of covectors” 满足 vector addition and scaling 的 8 条 axioms,所以可以看做一个 generalized 的 vector;换言之,Ln(V1,,Vn;R) 也就是一个 generalized 的 vector space

4. Tensor Space / RankPermalink

For a vector space V, we define:

Tsr(V)=Lr+s(V,,Vr,V,,Vs;R)

Elements of Tsr(V) are called tensors on V, contravariant of order r and covariant of order s; or simply, of type (r,s).

Special cases:

  • T00(V)=R
  • T01(V)=L(V;R)=V
  • T02(V)=L(V,V;R)=L(V;V)
  • T10(V)=L(V;R)=V
  • T20(V)=L(V,V;R)=L(V;V)
  • T11(V)=L(V,V;R)=L(V;V)=L(V;V)

注意:s+r 的值称作 tensor 的 rank;从 special case 来看:

  • 0 阶 tensor 是 scalar
  • 1 阶 tensor 是 vector/covector
  • 2 阶 tensor 中只有 T11(V) 是 matrix
    • 即你只能说 matrix 是 2 阶 tensor;不能说 2 阶 tensor 都是 matrix
    • 仔细考虑一下,其实所有 2n 阶的 Tnn(V) 都是 matrix,见 6.2 的讨论
      • 当然这里说的都是 2-D 的实数 matrix

5. TensorPermalink

从 tensor space 来看,一个 tensor 就是个 f:V××Vr×V××VsR

  • 从函数的角度来看,VV 的顺序其实是可以打乱的,也可以是交错的;但为了研究起来方便,tensor 的定义强制要求了这个 “连续 V 再连续 V” 的顺序

这个 f 可以看做一个 (r+s)-tuple of vectors/covectors (p1,,pr,q1T,,qsT),因为我们可以定义:

f(w1T,,wrT,v1,,vs)=i=1rwiTpi×i=1sqiTvi=aR

6. Tensor Product OperatorPermalink

为了表示起来方便,我们引入 tensor product operator 。它其实有两种应用场合:

  1. 两个 tensor space over vector space V, Θ1Θ2 的 tensor product Θ1Θ2 仍然是一个 tensor over vector space V
    • 考虑特殊情况:假设 VW 都是 vector space (i.e. T01(V)) over field K,那么 VKW 仍然是一个 vector space over field K
  2. 两个 tensor, t1t2 的 tensor product t1t2 仍然是一个 tensor
    • 考虑特殊情况:vector/covector/matrix 之间也可以有 操作

如果 t1Θ1,t2Θ2,那么 t1t2Θ1Θ2

我觉得暂时不要关注计算细节,先掌握大的计算原则比较重要。

6.1 用 表示 LPermalink

这个逻辑其实要绕一下:

  • 假定有 f:V××Vr×V××VsR,则 fTsr(V)=Lr+s(V,,Vr,V,,Vs;R)
  • 又:f 可以看做一个 (r+s)-tuple of vectors/covectors (p1,,pr,q1T,,qsT)
  • 我们可以写 Tsr(V)=VVr×VVs
    • 注意这里 VV 的顺序和 L 里是反的、和 (r+s)-tuple 是一致的

6.2 Rank of Tensor ProductPermalink

基本原则 (参考 StackExchange: Understanding the definition of tensors as multilinear maps, by celtschk):

Tsr(V)Tsr(V)Ts+sr+r(V) (f1f2)(κ,,λ,μ,,νr+r,u,,v,w,,zs+s)=f1(κ,,λr,u,,vs)f2(μ,,νr,w,,zs)

Tnn(V) 我们还可以进一步讨论一下:

  • Wikipedia: Tensor product of linear maps 的例子,matrix 对应 tensor,matrix 的 Kronecker Product 对应 tensor product。两个 2×2 matrix (看作 T11(V)) 的 Kronecker Product 是一个 4×4 matrix,按道理它应该是一个 T22(V)。按照这个逻辑展开,所有的 Tnn(V) 都是 matrix
  • 至于这个 matrix 本身的维度,要从 V 的维度说起:
    • 如果 VRm,那么你的 T11(V) 应该是一个 m×m matrix (的集合)
      • 不可能不是 square matrix,因为 dimV=dimV=m
    • 按照 Kronecker Product 的算法,你的 T22(V) 应该是一个 m2×m2 matrix (的集合)
[a1,1a1,2a2,1a2,2][b1,1b1,2b2,1b2,2]=[a1,1[b1,1b1,2b2,1b2,2]a1,2[b1,1b1,2b2,1b2,2]a2,1[b1,1b1,2b2,1b2,2]a2,2[b1,1b1,2b2,1b2,2]]=[a1,1b1,1a1,1b1,2a1,2b1,1a1,2b1,2a1,1b2,1a1,1b2,2a1,2b2,1a1,2b2,2a2,1b1,1a2,1b1,2a2,2b1,1a2,2b1,2a2,1b2,1a2,1b2,2a2,2b2,1a2,2b2,2]

这引出一个很重要的思想:tensor 其实是 matrix of matrices;或者更宽泛一点来讲:tensor 是一个 meta-matrix,是一个 matrix of something,这个 something 是你可以自己定义的。接着用上面那个例子:

  • tT11(V) 是一个 1×1 meta-matrix,它只有一个元素,但是这个元素是一个 m×m matrix,所以它整体上是一个 m×m matrix
    • 你也可以看成是 m×msT00(V)
  • tT22(V) 是一个 m×m meta-matrix,它的每个元素都是一个 sT11(V),所以它整体上是一个 m2×m2 matrix
    • 你也可以看成是 m2×m2sT00(V)
  • 依此类推:
    • tTnn(V) 是一个 mn1×mn1 meta-matrix,它的每个元素都是一个 sT11(V),所以它整体上是一个 mn×mn matrix
      • 你也可以看成是 mn×mnsT00(V)
    • 或者我们写成 Tnn(V)=(T11(V))n,其中 “n 次方” 定义为:VnVVn
      • 明显 Tnn(V)T00(V)=Tnn(V)
  • 考虑不规则的情况:
    • p>q,则 tTqp(V) 是一个 mq×mq meta-matrix,它的每个元素都是一个 sT0pq(V)
    • p<q,则 tTqp(V) 是一个 mp×mp meta-matrix,它的每个元素都是一个 sTqp0(V)

6.3 T00(V)=R 的特殊性Permalink

严格来说,如果 f1:VX,f2:WY,那么:

f1f2:VWXY

从函数的角度来看:

(f1f2)(vw)=f1(v)f2(w)

但是因为我们一般处理 R,而 R 又是 T00(V),所以 RR=T0+00+0(V)=R

所以我们一般的 VW 的元素仍然是一个 f:VWR

6.4 只有在把 tensor/tensor product 当作函数来做运算时你才会用到 Einstein summation conventionPermalink

这里我就不展开了,可以参考:

最后说明一点:在工程应用中经常忽略掉运算结果里 basis 的 tensor product,只保留 tensor product 的分量。这和你写 vector 时只关注分量而忽略约定俗成的 basis i,j,k, 道理是一样的。

Categories:

Updated:

Comments