# Generate a normalized Haar-random vector

What is the procedure to generate a random qutrit quantum state?

That is, I want to generate a $$3 \times 1$$ vector $$u$$ such that $$u$$ is generated by a Haar random $$3 \times 3$$ unitary $$U$$ multiplied with the $$3 \times 1$$ column vector $$\begin{pmatrix} 1 \\ 0 \\ 0\\ \end{pmatrix}.$$

## 1 Answer

There are two ways I can see (so made this an answer!):

1. Generate a random unitary matrix and take the first column (or row)

For this, you're looking for CircularUnitaryMatrixDistribution[3] for the Haar distribution on unitary matrices. To get an actual matrix from this distribution, use

RandomVariate[CircularUnitaryMatrixDistribution[3]]


Check out the Background & Context section of the documentation:

Probabilistically, the circular unitary matrix distribution represents a uniform distribution over the unitary square matrices, while mathematically it is a so-called Haar measure on the unitary group $$U(n)$$.

Note that for efficiency, you can simply take the First element instead of dotting with {1,0,0}.

1. Generate a random point on the 6D sphere

The unit sphere in $$\mathbb{C}^3$$ under the standard (physical) inner product can be viewed as the unit sphere in $$\mathbb{R}^6$$.

Then we have

Complex @@@ Partition[RandomPoint[Sphere[6]], 2]


as a random (representative of a) qutrit directly.

(One potential issue is that quantum mechanical states are not actually in correspondence with points on the unit sphere in $$\mathbb{C}^3$$, but with orbits of such points under the action of multiplication by phase. However, since each orbit has the same induced measure, choosing a random point on the sphere is equivalent to choosing a random orbit.)