ffsim.random.random_real_symmetric_matrix

ffsim.random.random_real_symmetric_matrix(dim, *, rank=None, seed=None, dtype=<class 'float'>)[source]

Return a random real symmetric matrix from the Gaussian orthogonal ensemble.

The Gaussian orthogonal ensemble (GOE) is the canonical distribution over real symmetric matrices: it is the unique Gaussian distribution invariant under conjugation by an orthogonal matrix. Off-diagonal entries have unit variance and diagonal entries have variance two, so the eigenvalues follow the semicircle law on [-2 * sqrt(dim), 2 * sqrt(dim)].

If rank is specified, then the sampled matrix is a GOE matrix supported on a uniformly random subspace of that dimension. Passing rank=dim is equivalent to leaving rank unspecified.

Parameters:
  • dim (int) – The width and height of the matrix.

  • rank (int | None) – The rank of the matrix. If None, the maximum rank is used.

  • seed – A seed to initialize the pseudorandom number generator. Should be a valid input to np.random.default_rng.

  • dtype – The data type to use for the result.

Return type:

ndarray

Returns:

The sampled real symmetric matrix.

References