I would like to find a smart way to generate a $N\times N$ random matrix $M$ with arbitrary correlation: \begin{equation} \boxed{\langle M_{ij}M_{kl}\rangle=\tau_{ijkl}} \end{equation} Where the mean and variance of the elements are given by: \begin{align} \langle M_{ij}\rangle&=0 \\ \langle M_{ij}^2\rangle&=\sigma^2 \end{align}
The case I am interested in is actually a sub-problem of this. I would like to generate a matrix whose elements follow a normal distribution of mean $0$ and variance $1/N$, and whose elements are correlated the following way: \begin{equation} \langle M_{ij}M_{ki}\rangle=\tau_{ijk} \end{equation} When $\tau_{ijk}=\delta_{jk}N^{-1}$ I recover a symmetric matrix.