I need to represent $M-\lambda\cdot\textrm{Identity}$ where $M$ is an operator on $V_1\oplus\cdots\oplus V_n$ made from $$ V_1\xrightarrow{M_1}V_2\xrightarrow{M_2}\cdots\xrightarrow{M_{n-1}}V_n\xrightarrow{M_n}V_1. $$ With, say, $n=3$, $\dim V_k=k+1$, I am trying
sa =
With[{dim = {2, 3, 4}},
With[{n = Length[dim]},
SparseArray[
{
Band[{1, 1}] -> Table[λ IdentityMatrix[dim[[k]]], {k, n}],
Band[{2, 1}] ->
Table[
Table[Indexed[M[k], {i, j}], {i, dim[[k + 1]]}, {j, dim[[k]]}],
{k, n - 1}
],
Band[{1, n}] -> Table[Indexed[M[n], {i, j}], {i, dim[[1]]}, {j, dim[[n]]}]
}
]
]
]
The result is very strange: both sa//TableForm
and ArrayFlatten[sa]//TableForm
give
The same happens with Band[{1, n}] -> {Table[...]}
.
What am I doing wrong here?
Band[{1, Quotient[n (n + 1), 2]}]
? $\endgroup$ – Henrik Schumacher Jun 5 '18 at 6:14Band[{1, n (n - 1)/2 + 1}]
. The second index of the band of the last matrix should the sum of the dimensions of the others+1
$\endgroup$ – Henrik Schumacher Jun 5 '18 at 6:24dim = {2, 3, 4}
it is all wrong again. As for your explanation: it should be an $n\times n$ array of matrices, should not it? $\endgroup$ – მამუკა ჯიბლაძე Jun 5 '18 at 6:27