Simultaneous diagonalization of commuting Pauli operators is an important routine in several quantum algorithms.
We present the implementation of an algorithm that yields a quantum circuit with depth only
- Ensure the Pauli strings are writen in the file where each line is a Pauli string (for example XX (on the first line), YY (on the second line))
- Call the function
main
in the file diagonalize.py. - The Function returns X, Z, S, U
- U is the quantum circuit
- X is the transformed X part of the tableau. It should be a zero matrix.
- Z is the transformed Z part of the tableau.
- S is the sign of the transformed Pauli strings. (0 means +, 1 means -)