# Integrating over the unitary group

Quantifying the volumes of different types of quantum states with respect to each other is an interesting tool for analysis that I’ve recently become interested in.  For example, did you know the volume of separable states is super-doubly-exponentially small with respect to all quantum states? That means that if I choose a state of 100 qubits randomly from Hilbert space, with overwhelming probability that state will be entangled.  It also raises the bar for any would-be entanglement witness to beat the performance of an algorithm which guesses entangled for every state blindly if the test set is all possible quantum states.  Of course, if you talk to any person working in an experimental quantum lab, they would certainly like it if almost everything they did resulted in an entangled state, unfortunately that’s not really reality, and we know that the set of physical states we expect to see is a tiny subset of all possible states.  Coming up with a measure that reflects that reality and readily enables computation would be valuable indeed.

Regardless, one of the tools used in many of these analyses at the moment is integration over the unitary group.  This is because the unitary group allows us a way to generate all possible quantum states from some choice of starting state.  To complete these analyses one must also integration over the simplices of eigenvalues corresponding to physical states, but for now I want to focus on the unitary group.  To talk about integration, we need some way of quantifying volume, or a measure.  The unitary group has a natural measure, its unique Haar measure that treats all unitary operators equally.  It does this by being invariant under the action of the unitary group, in the same way you wouldn’t want the volume of a box to change if you translated it through space.  Mathematically we can phrase this as saying , which leads to a corresponding Haar integral with the defining property

(1)

for any integrable function , group elements , and the last equality is written to match the shorthand commonly found in papers.  We should also note that it is convention to fix the normalization of integration over of the identity to be .  So that’s all very interesting, but something harder to dig up, is how to actually compute that integral for some actual function that has been given to you, or you find interesting.  I’ll show a few options that I’ve come across or thought about, and if you know some more, I’d love it if you would share them with me.

#### Integration through invariance

Some integrals over the unitary group can be done using only the invariance property of the Haar integral given above, and reasoning about what it implies.  This is best illustrated through an example, which I borrow from this fine set of notes by Patrick Hayden.  Suppose that , where indicates Hermitian conjugation, and the integral I am interested in is

(2)

Now take any and start using that integral invariance property as

(3)

Thus we find that for all , implying that .  If a matrix is proportional to the identity, then we can characterize it completely by its trace which we then evaluate as

(4)

From these two results, we conclude that

(5)

which was evaluated entirely through the defining invariance of the integral.

#### Monte Carlo Numerical Integration

For some problems of interest, there is no obvious way of integrating it analytically or reaching a closed result.  In order to perform a numerical integration, one could choose some parameterization and attempt integration with a quadrature, but this is both cumbersome and often runs out of steam as the dimension of the problem of interest grows.  Monte Carlo integration offers a straightforward way to at least attempt these integrations for high-dimensional problems of interest, and is often less human work even for low dimensional problems.  Monte Carlo integration is simple, and approximates the integral as

(6)

where is the number of sample points you take, and is a randomly drawn unitary that is drawn with uniform probability according to the Haar measure.  How to draw unitaries uniformly with respect to the Haar measure is not entirely obvious, but luckily this has been worked out, and there are a few ways to do this.  One of this requires only simple steps available in most modern math libraries that are

1. 1. Fill an matrix with complex Gaussian IID values, call it .
2. 2. Perform a QR decomposition of the matrix , let .

where is now the unitary of interest randomly distributed according to the Haar measure on .  Here is a Python function that can do this for you if the above steps don’t make any sense.

#### Weyl’s Integration Formula

This formula is a bit of a sledge hammer for hanging a nail, but it exists for all compact Lie groups and for the unitary group takes on the specific form

(7)

This formula also demands that be a conjugacy invariant function on the unitary group as well as symmetric in its arguments.  The correspond to the possible eigenvalues that characterize all unitary matrices.  I’ve yet to use it for a practical calculation, but like having a catalog of known options.

• Amir Safavi-Naeini

Thanks! Useful 🙂