What is the mathematics of compute_decomposition?

I used compute_decomposition on a diagonal unitary matrix and the result is shown. I am curious to know on what mathematical principle compute_decomposition is constructed. I need more formulas to explain it.

Hi @RX1 , thanks for the question. :slight_smile:
You can find the explanation of how qml.DiagonalQubitUnitary.compute_decomposition works here, where there’s also the direct link to the source code. Hopefully this helps you along with the equations? :slight_smile:

Alternatively, if you’re wondering about how to decompose your gate to a different gate set in PennyLane, you might want to check out this link: Compiling circuits — PennyLane 0.32.0 documentation