ffsim.random.random_special_orthogonal

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

Return a random special orthogonal matrix distributed with Haar measure.

The matrix is sampled by drawing a Haar-distributed orthogonal matrix and negating its first row if its determinant is negative. Negating a row is multiplication by a fixed reflection, which maps the Haar measure of the orthogonal group, conditioned on the determinant being -1, onto the Haar measure of the special orthogonal group, so the result is Haar-distributed.

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

  • 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 special orthogonal matrix.

References