Skip to content

dq.random.psd

psd(key: PRNGKeyArray, shape: tuple[int, ...]) -> Array

Returns a random complex positive semi-definite matrix.

Parameters

  • key –

    A PRNG key used as the random key.

  • shape (shape of the form (..., n, n)) –

    Shape of the returned array.

Returns

(array of shape (*shape)) Random complex positive semi-definite matrix.

Examples

>>> key = jax.random.PRNGKey(42)
>>> dq.random.psd(key, (2, 2))
Array([[1.145+0.j  , 0.582+0.33j],
       [0.582-0.33j, 0.844+0.j  ]], dtype=complex64)