catalyst
catalyst copied to clipboard
Contextual decomposition strategy to improve differentiability
Issue description
-
Expected behavior: QubitUnitary for gates with more than 2 qubits is not differentiable using Enzyme. This means that programs that transform gates to QubitUnitary cannot be differentiated. However, it is possible to differentiate these programs if instead of transforming gates to QubitUnitary they are decomposed to other gates.
-
Actual behavior: The decomposition strategy right now is indeed to decompose as much as possible without changing them to QubitUnitary, but once matrix gates are used, some gates will be changed to QubitUnitary.