I want to write a function that can automatically analyze any square matrices with periodic band diagonals and give continuations of them. But I can't figure out an elegant way to do this.
Suppose we have written such a function called continuation
, and suppose we have an example square matrix mat
of order 8 as
$\small \mathtt{mat}=\begin{pmatrix} y+0.2 & 2 \text{t1} & 0.2 & \text{t1} & 0 & 0 & 0 & 0 \\ 2 \text{t1} & 0.2\, -y & 0 & 0.2 & 0 & 0 & 0 & 0 \\ 0.2 & 0 & y+0.2 & 2 \text{t1} & 0.2 & \text{t1} & 0 & 0 \\ \text{t1} & 0.2 & 2 \text{t1} & 0.2\, -y & 0 & 0.2 & 0 & 0 \\ 0 & 0 & 0.2 & 0 & y+0.2 & 2 \text{t1} & 0.2 & \text{t1} \\ 0 & 0 & \text{t1} & 0.2 & 2 \text{t1} & 0.2\, -y & 0 & 0.2 \\ 0 & 0 & 0 & 0 & 0.2 & 0 & y+0.2 & 2 \text{t1} \\ 0 & 0 & 0 & 0 & \text{t1} & 0.2 & 2 \text{t1} & 0.2\, -y \\ \end{pmatrix}$
then continuation[mat][n]
can give a square matrix that is a continuation of original mat
with order n. For example:
continuation[mat][9]
should give a continuation of mat of order 9 as following
$\small \begin{pmatrix} y+0.2 & 2 \text{t1} & 0.2 & \text{t1} & 0 & 0 & 0 & 0 & 0 \\ 2 \text{t1} & 0.2\, -y & 0 & 0.2 & 0 & 0 & 0 & 0 & 0 \\ 0.2 & 0 & y+0.2 & 2 \text{t1} & 0.2 & \text{t1} & 0 & 0 & 0 \\ \text{t1} & 0.2 & 2 \text{t1} & 0.2\, -y & 0 & 0.2 & 0 & 0 & 0 \\ 0 & 0 & 0.2 & 0 & y+0.2 & 2 \text{t1} & 0.2 & \text{t1} & 0 \\ 0 & 0 & \text{t1} & 0.2 & 2 \text{t1} & 0.2\, -y & 0 & 0.2 & 0 \\ 0 & 0 & 0 & 0 & 0.2 & 0 & y+0.2 & 2 \text{t1} & 0.2 \\ 0 & 0 & 0 & 0 & \text{t1} & 0.2 & 2 \text{t1} & 0.2\, -y & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0.2 & 0 & y+0.2 \\ \end{pmatrix}$
How to write such a continuation
function which can automatically analyze square matrices with periodic diagonal band and give general continuation version?
The list representation of mat
is here:
mat = {{0.2 + y, 2 t1, 0.2, t1, 0, 0, 0, 0},
{2 t1, 0.2 - y, 0, 0.2, 0, 0, 0, 0},
{0.2, 0, 0.2 + y, 2 t1, 0.2, t1, 0, 0},
{t1, 0.2, 2 t1, 0.2 - y, 0, 0.2, 0, 0},
{0, 0, 0.2, 0, 0.2 + y, 2 t1, 0.2, t1},
{0, 0, t1, 0.2, 2 t1, 0.2 - y, 0, 0.2},
{0, 0, 0, 0, 0.2, 0, 0.2 + y, 2 t1},
{0, 0, 0, 0, t1, 0.2, 2 t1, 0.2 - y}}