cyjax.random.uniform_components#
- cyjax.random.uniform_components(key, shape)#
Complex values with uniform real and imaginary parts.
Imaginary and real components are individually uniformly distributed between 0 and 1. This results in uniform values in the unit square in the complex plane.
Example
>>> x = uniform_components(jax.random.PRNGKey(0), (4,)) >>> jnp.all(jnp.abs(x.real) < 1) DeviceArray(True, dtype=bool) >>> jnp.all(jnp.abs(x.imag) < 1) DeviceArray(True, dtype=bool)
- Parameters:
key (
Union
[PRNGKeyArray
,Array
]) – PRNG random key.shape (
Sequence
[Union
[int
,Any
]]) – tuple of nonnegative integers.
- Return type:
Union
[Array
,ndarray
,bool_
,number
]- Returns:
Array of requested
shape
.