Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleans up code and refactors tests for single qubit unitary decomposi…
…tions (#4869) **Context:** As I am implementing the XZX single qubit decomposition (#4862), I noticed some issues with the the code and the tests for single qubit unitary decompositions. **Description of the Change:** Cleans up ```transforms/decompositions/single_qubit_unitary.py```. - Removes duplicate code, - Fixes doc examples that were untrue - Adds support for returning global phase for the `rot` decomposition. - Normalize all rotation angles to the range $[0, 4\pi]$ Refactors ```tests/transforms/test_decompositions.py```. - Generalizes logic for obtaining decompositions and asserting their correctness such that all types of decompositions share the same assertion logic. Removes duplicate code. - Adds testing for when ```return_global_phase=False``` as well as when ```return_global_phase=True``` - Update test cases to use analytical instead of numerical values when possible. **Benefits:** Cleaner code. **Related GitHub Issues:** #4868 #4862
- Loading branch information