ArrayDot
ArrayDot[a,b,k]
computes the product of arrays a and b obtained by summing up products of terms over the last k dimensions of a and the first k dimensions of b.
ArrayDot[a,b,{{s1,t1},{s2,t2},…}]
computes the product of arrays a and b obtained by summing up products of terms over the pairs {si,ti} of dimensions.
Details
- The arguments a and b in ArrayDot[a,b,k] should be arrays with dimensions, respectively, {m1,…,mp,d1,…,dk} and {d1,…,dk,n1,…,nq}. The result is an array c with dimensions {m1,…,mp,n1,…,nq} and ci1,…,ip,j1,…,jqai1,…,ip,α1,…,αkbα1,…,αk,j1,…,jq.
- In ArrayDot[a,b,{{s1,t1},…,{sk,tk}}], the arguments a and b should be arrays with dimensions, respectively, {m1,…,mp} and {n1,…,nq}, where all si are distinct, all ti are distinct and for all i, 1≤si≤p, 1≤ti≤q and msinti. The result is equal to TensorContract[ab,{{s1,p+t1},…,{sk,p+tk}}].
- ArrayDot can be used on SparseArray and structured array objects.
- ArrayDot is used in the array differentiation chain rule.
Examples
open allclose allBasic Examples (3)
Scope (9)
CenteredInterval arrays:
Find random representatives arep and brep of a and b:
Verify that ArrayDot[a,b,3] contains ArrayDot[arep,brep,3]:
ArrayDot of sparse arrays is another sparse array:
Applications (1)
Properties & Relations (9)
ArrayDot is linear in each argument:
Dot[a,b] is equal to ArrayDot[a,b,1]:
SymbolicIdentityArray objects are identity elements for ArrayDot:
For a real matrix a, Norm[a,"Frobenius"] is equal to the square root of ArrayDot[a,a,2]:
If c=ArrayDot[a,b, k], then ci1,…,ip,j1,…,jqai1,…,ip,α1,…,αkbα1,…,αk,j1,…,jq:
ArrayDepth[ArrayDot[a,b,k]] is equal to ArrayDepth[a]+ArrayDepth[b]-2k:
ArrayDot can be implemented as a combination of TensorProduct and TensorContract:
ArrayDot can be implemented as a combination of Flatten and Dot:
ArrayDot is used in the array differentiation chain rule:
Text
Wolfram Research (2024), ArrayDot, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayDot.html.
CMS
Wolfram Language. 2024. "ArrayDot." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ArrayDot.html.
APA
Wolfram Language. (2024). ArrayDot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArrayDot.html