iqm.benchmarks.compressive_gst.mgst.reporting.reporting.compute_sparsest_Pauli_Hamiltonian#
- iqm.benchmarks.compressive_gst.mgst.reporting.reporting.compute_sparsest_Pauli_Hamiltonian(U_set: ndarray) ndarray#
Takes the matrix logarithms of the given unitaries and returns sparsest Hamiltonian parameters in Pauli basis.
The parametrization is U = exp(-i pi H/2), i.e. H = i log(U)*2/pi. Different branches in the matrix logarithm lead to different Hamiltonians. This function optimizes over combinations of adding 2*pi to different eigenvalues, in order arrive at the branch with the Hamiltonian whose Pauli basis representation is the most sparse.
- Parameters:
U_set (ndarray) – A list contining unitary matrices
- Returns:
The full list of Pauli basis coefficients of the Hamiltonian for all gates
- Return type:
Notes
sqrt(pdim) factor is due to Pauli basis normalization