For a Hamiltonian composed of a list of weighted Pauli strings, to calculate the expectation value, we need to obtain the expectation value of each Pauli string. To reduce the measurement overhead, one common method is to group the commuting Pauli terms. If we consider a certain commutativity rule, say full commutativity, we use certain method to generate a measurement circuit. How to check if the measurement circuit correctly diagonalized the circuit? Let's say the observable is M, and the unitary of the diagonalizable circuit is U, if $UMU^\dagger$ is a diagonal matrix, we are good? Is this $U$ the diagonalizable circuit unitary, or the unitary of its inverse (put gate operation in the reversed order)?
If we have a partially commutativity, for example, 2-qubit commutativity, does the equation still apply?