jax.random.orthogonal#
- jax.random.orthogonal(key, n, shape=(), dtype=<class 'float'>)[source]#
Sample uniformly from the orthogonal group O(n).
If the dtype is complex, sample uniformly from the unitary group U(n).
- Parameters:
key (ArrayLike) – a PRNG key used as the random key.
n (int) – an integer indicating the resulting dimension.
shape (Shape) – optional, the batch dimensions of the result. Default ().
dtype (DTypeLikeFloat) – optional, a float dtype for the returned values (default float64 if jax_enable_x64 is true, otherwise float32).
- Returns:
A random array of shape (*shape, n, n) and specified dtype.
- Return type:
References