# What does the identity operator represent when computing $\langle\varphi|I\otimes Z|\varphi\rangle$?

Consider a single qubit state $$|\varphi\rangle$$ and a hamiltonian $$H = Z$$. Evaluating $$\langle \varphi | H | \varphi \rangle$$ corresponds to a measurement of $$|\varphi\rangle$$ in the computational basis. This is easy to generalise to $$n$$ qubits and any Hamiltonian expressed as a tensor product of Pauli matrices $$X, Z, Y$$.

My question is: what to do when the Hamiltonian is, for example, $$H = I \otimes Z$$. What does $$\langle \varphi | H | \varphi \rangle$$ mean in this case?

When you have $$\langle \varphi | I \otimes Z | \varphi \rangle$$ It means you are calculating the expectation of the operator $$I \otimes Z$$ with respect to some state $$|\varphi \rangle$$. Since $$I$$ is on the first qubit, we would not need to do anything there, no need to do any rotation or even measurement. The eigenspace is decomposed into two halves depending on the second qubit. That is, the states $$\{ |00\rangle, |10\rangle \}$$ belong to the $$+1$$ eigenspace, and the states $$\{| 01\rangle, |11\rangle \}$$ belong to the $$-1$$ eigenspace. Notice how only the second qubit value matter.
Similarly, if we have $$\langle Z \otimes I \rangle$$ instead, then we would measure the first qubit and leave the second qubit alone. In this case, the states $$\{ |00\rangle, |01\rangle \}$$ belong to the $$+1$$ eigenspace, and the states $$\{| 10\rangle, |11\rangle \}$$ belong to the $$-1$$ eigenspace.
If we have $$\langle I \otimes X \rangle$$ then we would do a Hadamard rotation before measuring the second qubit and leave the first qubit alone.