TensorProduct
TensorProduct[tensor1,tensor2,…]
表示 tensori 的张量积.
更多信息
- TensorProduct[a,b] 可以按 ab 输入. 字符 按
t*
或者 \[TensorProduct] 输入. - 矩形阵列 ai 的张量积 a1…an 等价于 Outer[Times, a1,…,an].
- 阵列和/或符号张量的张量积 t1…tn 被解释为秩为 TensorRank[t1]+…+TensorRank[tn] 的另一个张量.
- TensorProduct[] 返回 1. TensorProduct[x] 返回 x.
- TensorProduct 是可结合、不可交换的张量积.
范例
打开所有单元 关闭所有单元基本范例 (2)
范围 (4)
array1 = RandomInteger[10, {2, 5}]array2 = RandomInteger[10, {3, 4}]array1array2%//DimensionsA = SymmetrizedArray[{{a, b}, {b, c}}]TensorSymmetry[A]AATensorSymmetry[%]SymmetrizedArrayRules[%%]$Assumptions = {T∈Arrays[{4, 4, 3}, Reals, Antisymmetric[{1, 2}]]}TTTTTensorRank[%]A{a, b}{x, y}AA属性和关系 (11)
TensorProduct[{a, b}, {x, y}]TensorProduct[{x, y}, {a, b}]%% === Transpose[%]数组的张量乘积等价于使用 Outer:
array1 = RandomInteger[10, {2, 5}]array2 = RandomInteger[10, {3, 4}]array1array2array1 === Outer[Times, array1, array2, array1]向量的 KroneckerProduct 等价于它们的 TensorProduct:
vec1 = {x, y, z};
vec2 = {a, b};
KroneckerProduct[vec1, vec2] === TensorProduct[vec1, vec2]矩阵的 KroneckerProduct 等价于 TensorProduct 到另一个矩阵的展平:
mat1 = Array[a, {2, 3}];
mat2 = Array[b, {4, 5}];
KroneckerProduct[mat1, mat2] === ArrayFlatten[TensorProduct[mat1, mat2]]任意两个数组的 KroneckerProduct 等价于它们的 TensorProduct 的展平:
arr1 = Array[a, {2, 3, 4, 5}];
arr2 = Array[b, {4, 6}];
KroneckerProduct[arr1, arr2] === ArrayFlatten[TensorProduct[arr1, arr2], 3]TensorProduct[a, b, c]TensorRank[%]$Assumptions = A∈Arrays[{3, 3}];TensorProduct[A, A]//TensorSymmetryTensorProduct[x] 返回 x,与 x 是什么无关:
TensorProduct[I]TensorProduct[] 是 1:
TensorProduct[]TensorProduct[3, v, -2, w]Assuming[x∈Reals, vxw]TensorProduct 具有 Flat 属性:
TensorProduct[a, TensorProduct[b, c]]//FullFormTensorProduct[a, b, c, d] /. TensorProduct[b, c] -> eTensorProduct 与一起 TensorContract 一起使用,可用来实现 Dot:
v = Array[x, {3}];
a = Array[y, {3, 3, 3}];
m = Array[z, {3, 3}];v.a.m == TensorContract[vam, {{1, 2}, {4, 5}}]//SimplifyTensorProduct 的反对称性与 TensorWedge 成比例:
v = RandomInteger[10, 3]w = RandomInteger[10, 3]Symmetrize[vw, Antisymmetric[{1, 2}]]2% === vw参见
Outer TensorWedge KroneckerProduct Inner Dot
字符: \[TensorProduct]
Function Repository: QuantumTensorProduct ToTensor
相关指南
-
▪
- 符号张量 ▪
- 符号向量、矩阵和数组
文本
Wolfram Research (2012),TensorProduct,Wolfram 语言函数,https://reference.wolfram.com/language/ref/TensorProduct.html.
CMS
Wolfram 语言. 2012. "TensorProduct." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/TensorProduct.html.
APA
Wolfram 语言. (2012). TensorProduct. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/TensorProduct.html 年
BibTeX
@misc{reference.wolfram_2026_tensorproduct, author="Wolfram Research", title="{TensorProduct}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/TensorProduct.html}", note=[Accessed: 04-July-2026]}
BibLaTeX
@online{reference.wolfram_2026_tensorproduct, organization={Wolfram Research}, title={TensorProduct}, year={2012}, url={https://reference.wolfram.com/language/ref/TensorProduct.html}, note=[Accessed: 04-July-2026]}