cyjax.random.complex_sphere#

cyjax.random.complex_sphere(key, shape)#

Sample uniform points on the unit sphere in complex space..

The last value in the shape tuple is interpreted as dimension \(n\) such that the points lie on the sphere \(S^{2n-1}\) of unit radius in \(\mathbb{C}^n\).

Example

>>> x = complex_sphere(jax.random.PRNGKey(0), (4, 3))
>>> jnp.allclose(jnp.linalg.norm(x, axis=-1), 1)
DeviceArray(True, dtype=bool)
Parameters:
  • key (Union[PRNGKeyArray, Array]) – PRNG random key.

  • shape (Sequence[Union[int, Any]]) – Tuple of nonnegative integers. Last value is interpreted as dimension of (ambient) complex vector space.

Returns:

Complex array of requested shape.