cirq.testing.random_superposition

cirq.testing.random_superposition(dim: int, *, random_state: cirq.RANDOM_STATE_OR_SEED_LIKE = None) → numpy.ndarray[source]

Returns a random unit-length vector from the uniform distribution.

Parameters
  • dim – The dimension of the vector.

  • random_state – A seed (int) or np.random.RandomState class to use when generating random values. If not set, defaults to using the module methods in np.random.

Returns

The sampled unit-length vector.