To find the inverse of a special kind of matrix. In a matrix analysis problem, I encountered the following special kind of matrix
$$  
    \begin{bmatrix}
    0 & 1 & a & a & a & a \\
    1 & 0 & a& a& a& a \\
    a& a &0 & 1& a& a \\
    a& a &1 & 0 & a& a \\
    a & a & a & a &0 & 1\\
    a & a & a & a &1 & 0
    \end{bmatrix}
$$
where $a$ is a positive integer.But this matrix is not a circulant matrix. It is not in my knowledge if this is any known form.
We can also search for inverses for the general form of the matrix for even order.
 A: You can write it as a sum:
$$ \begin{bmatrix}
0 & 1 & a & a & a & a \\ 
1 & 0 & a & a & a & a \\ 
a & a & 0 & 1 & a & a \\ 
a & a & 1 & 0 & a & a \\ 
a & a & a & a & 0 & 1 \\ 
a & a & a & a & 1 & 0 
\end{bmatrix} = 
\begin{bmatrix}
-a & 1-a & 0 & 0 & 0 & 0 \\ 
1-a & -a & 0 & 0 & 0 & 0 \\ 
0 & 0 & -a & 1-a & 0 & 0 \\ 
0 & 0 & 1-a & -a & 0 & 0 \\ 
0 & 0 & 0 & 0 & -a & 1-a \\ 
0 & 0 & 0 & 0 & 1-a & -a \end{bmatrix}
+
\begin{bmatrix} a \\ a\\ a \\ a \\ a \\ a \end{bmatrix}.\begin{bmatrix}1 \\ 1 \\ 1 \\ 1\\ 1 \\ 1 \end{bmatrix}^T $$
 and then use the Sherman–Morrison formula to invert this sum of two matrices. The dimension of the matrix can be easily adapted.
A: This is a BCCB matrix (Block circulant with circulant blocks). We have
$\mathbf A = \begin{pmatrix} \mathbf{C}_1 & \mathbf{C}_2 & \mathbf{C}_2 \\ 
\mathbf{C}_2 & \mathbf{C}_1 & \mathbf{C}_2  \\ 
\mathbf{C}_2 & \mathbf{C}_2 & \mathbf{C}_1 \\
\end{pmatrix}$ 
with $\mathbf C_1 = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$ and
$\mathbf C_2 = \begin{pmatrix} a & a \\ a & a \end{pmatrix}$. Clearly $\mathbf A$ is block-circulant and $C_1$ and $C_2$ are also circulant.
It can be diagonalized with the 2D DFT matrix (instead of the (1D) DFT matrix for ordinary circulant matrices).
When it is diagonalized the inverse is readily obtained by inverting the elements in the diagonal matrix (any applying the inverse 2D DFT). Also one knows that it is invertable if and only if there are no zeros in the diagonal matrix.
Details can be found here.
A: Suppose your matrix is $2n\times 2n$. Let $J=\pmatrix{0&1\\ 1&0},\ E=\pmatrix{1&1\\ 1&1}$. Then your matrix can be written as
$$
M=\pmatrix{J&aE&\cdots&aE\\ aE&\ddots&\ddots&\vdots\\ \vdots&\ddots&\ddots&aE\\ aE&\cdots&aE&J}.
$$
Note that
$$
\pmatrix{J&aE&\cdots&aE\\ aE&\ddots&\ddots&\vdots\\ \vdots&\ddots&\ddots&aE\\ aE&\cdots&aE&J}
\underbrace{\pmatrix{pJ+qE&rE&\cdots&rE\\ rE&\ddots&\ddots&\vdots\\ \vdots&\ddots&\ddots&rE\\ rE&\cdots&rE&pJ+qE}}_{\text{educated guess for } M^{-1}}
=\pmatrix{X&Y&\cdots&Y\\ Y&\ddots&\ddots&\vdots\\ \vdots&\ddots&\ddots&Y\\ Y&\cdots&Y&X},
$$
where
\begin{aligned}
X&=J(pJ+qE)+(n-1)(aE)(rE)\\
&=pI+\left[q+2(n-1)ar\right]E,\\
Y&=(aE)(pJ+qE)+J(rE)+(n-2)(aE)(rE)\\
&=\left[ap+2aq+(2(n-2)a+1)r\right]E.
\end{aligned}
So, $M^{-1}$ can be found by solving the system of equations $p=1$, $q+2(n-1)ar=0$ and $ap+2aq+(2(n-2)a+1)r=0$. It is not hard to see that the solution is given by
$$
p=1,\qquad q=\dfrac{-2(n-1)a^2}{4(n-1)a^2-2(n-2)a-1},\qquad r=\dfrac{a}{4(n-1)a^2-2(n-2)a-1}.
$$
(As $a$ is an integer, the denominator terms in $q$ and $r$ are odd numbers and hence they are never zero.)
