rand.random_states

Generate random quantum states using Qiskit.

Module Contents

Functions

random_states(n, d)

Generate a list of random quantum states.

rand.random_states.random_states(n, d)

Generate a list of random quantum states.

This function utilizes Qiskit’s random_statevector to generate a list of quantum states, each of a specified dimension. The states are valid quantum states distributed according to the Haar measure.

Examples

Generating three quantum states each of dimension 4.

>>> from this_module import random_states
>>> states = random_states(3, 4)
>>> len(states)
3
>>> states[0].shape
(4, 1)
Parameters:
  • n (int) – int The number of random states to generate.

  • d (int) – int The dimension of each quantum state.

Returns:

list[numpy.ndarray] A list of n numpy arrays, each representing a d-dimensional quantum state as a column vector.

Return type:

list[numpy.ndarray]