I want to create a data framework using matrix tensor. The framework should have the following features:
- An
(n,n)
matrix,m[t;i,j]
, indexed byt=1,2,...,T
; - For each element
[t;i,j]
ofm
, createk
more matrices,m[t;i,j;k]
, each with the dimension(n,n)
. - Notations:
t
denotes time;[i,j]
, matrix cell, andk
, the number of sub-matrices coupled withm[t;i,j]
.
I should be able to retrieve pairs of the coupled matrices across time t and for each element [i,j]
. Suppose that I want to get the data for t=3
and t=7
for elements [2,1]
and [3,2]
and k=3
, which is a total of 12
matrices. Each one of these 12 matrices is of (n,n)
dimension.
This is quite complicated for me but creating a matrix tensor m[t; i,j; k]
would make my life easier (with your help of course). Note that the tensor should accept the list of elements such as {1,4,6,8..} for t, {(1,3), (2,1),...} for [i,j] and {1,2,...} for k
.
I hope someone can help me in building this data framework.
EDIT 1
Here is a visual matrix tensor for t=1
, n=2
and k=2
. This matrix has been constructed using Table
in a very primitive way, therefore I only give you the matrix I was imagining.
Original matrix mat
and individual matrices for each element of mat
are:
and the final data framework is:
Blue sub-matrix (consisting of 2 matrices k1
and k2
) in the first column corresponds to cell a[1,1]
of matrix mat
; green sub-matrix (consisting of k1
and k2
) in the first column corresponds to cella[2,1]
of mat
; similarly, pink sub-matrix in the 2nd
column of mat
is associated with a[1,2]
of 'mat
and so on. This final big matrix is only for t=1
.
t=1
,n=2
,k=2
,ij =Tuples[Range[3], 2]
? $\endgroup$ – kglr Oct 18 '18 at 22:13bigmat = KroneckerProduct[ConstantArray[1, {n, n}], Array[Subscript[a, #][##2] &, {k, n, n}]]
. How wouldt
enter the picture; that is, how wouldbigmat
change whent=5
? $\endgroup$ – kglr Oct 19 '18 at 4:08