指標的上與下
在指標記號中,向量的分量帶上指標 v^i,而餘向量(線性泛函)的分量帶下指標 a_i。(p,q) 型張量有 p 個上指標和 q 個下指標,例如 T^{ij}_k。這個型也稱為價,它說明張量有多少個向量槽和多少個餘向量槽。線性映射的矩陣是 (1,1) 型:一上一下,記作 A^i_j。
縮併推廣了跡
縮併把同一張量的一個上指標與一個下指標配對並對其求和,把型從 (p,q) 降為 (p-1,q-1)。把 A^i_j 僅有的兩個指標縮併,即令 j = i 並求和:A^i_i = ∑_i A^i_i,這正是跡。縮併是幾乎每個張量公式背後的無座標引擎。
Matrix multiplication is a tensor contraction:
(A B)^i_k = A^i_j B^j_k (sum over the dummy j)
Trace is a self-contraction:
tr(A) = A^i_i = sum_i A^i_i
Bilinear form acting on two vectors:
f(u,v) = B_{ij} u^i v^j (contract both lower indices)
Applying a (1,1) tensor and then taking trace (contracting twice):
start from T^i_j v^j -> w^i, then contract: w^i with a_i -> a_i T^i_j v^j
Rule of thumb: count free indices to know the OUTPUT type.
A^i_j B^j_k has free i (up), k (down) => result is type (1,1), a matrix.堆疊空間:克羅內克積
當你用座標寫出兩個算子的張量積時,得到的是克羅內克積 A⊗B:把 A 的每個元素 a_{ij} 替換為分塊 a_{ij}B。它是映射 A⊗B 作用在 V⊗W 上的具體矩陣,並滿足 (A⊗B)(C⊗D) = (AC)⊗(BD)——抽象張量恆等式的算術化身。
A = [a b; c d] (2x2), B = [p q; r s] (2x2)
A (x) B = [ a*B b*B ] = [ a p a q b p b q ]
[ c*B d*B ] [ a r a s b r b s ]
[ c p c q d p d q ]
[ c r c s d r d s ] (4x4)
Size: (m1 x n1) (x) (m2 x n2) -> (m1 m2) x (n1 n2)
Useful facts: (A (x) B)^T = A^T (x) B^T, tr(A (x) B) = tr(A) tr(B).