haar

haar(n, ew=None, seed=None)

Generates a random matrix with prescribed eigenvalues by sampling uniformly from the orthogonal group O(n).

Parameters

Name Type Description Default
n int The size of the matrix. required
ew Optional[np.ndarray] Desired eigenvalues of A. If not provided, generates random values in the range [0, 1]. None
seed Union[int, np.random.Generator, None] seed for the random number generator. None

Returns

Name Type Description
np.ndarray A random matrix with the presribed eigenvalues.