StateVector.random

static StateVector.random(num_qudits, radixes=[])[source]

Sample a random pure state.

Parameters:
  • num_qudits (np.ndarray) – The number of qudits in the state. This is not the dimension.

  • radixes (Sequence[int]) – The radixes for the StateVector.

Returns:

A random pue quantum state.

Return type:

StateVector

Raises:
  • ValueError – If num_qudits is nonpositive.

  • ValueError – If the length of radixes is not equal to num_qudits.