freealg.distributions.KestenMcKay.matrix#
- KestenMcKay.matrix(size, seed=None)#
Generate matrix with the spectral density of the distribution.
- Parameters:
- sizeint
Size \(n\) of the matrix.
- seedint, default=None
Seed for random number generator.
- Returns:
- Anumpy.ndarray
A matrix of the size \(n \times n\).
Notes
If the parameter \(d\) is even, the matrtix is generated from
\[\mathbf{A} = \sum_{i=1}^{d/2} \mathbf{O}_i + \mathbf{O}_o^{\intercal},\]where \(\mathbf{O}_i\) are randomly generated orthogonal matrices with Haar. This method is fast but \(d\) has to be even.
If all other \(d\), the following is used:
\[\mathbf{A} = \mathbf{P} \mathbf{O} \mathbf{D} \mathbf{O}^{-1} \mathbf{P},\]where \(\mathbf{D}\) is diagonal matrix with entries \(\pm 1\), \(\mathbf{O}\) is orthogonal with Haar measure, and \(\mathbf{P}\) is a projection matrix. For more details, see Section 5 and 6 of [1].
The orthogonal matrices are genrated using the method of [2].
References
[1]Iris S. A. Longoria and James A. Mingo, Freely Independent Coin Tosses, Standard Young Tableaux, and the Kesten–McKay Law. https://arxiv.org/abs/2009.11950
[2]Francesco Mezzadri. How to generate random matrices from the classical compact groups. https://arxiv.org/abs/math-ph/0609050
Examples