Why does a symmetry operator commute with the Hamiltonian? Suppose that a symmetry operator $O$ leaves the Hamiltonian $H$ unchanged. From books I know that there should be the relation $OH=HO$. But I don't understand why it is not that $H=HO$ since when the operator acts on a wave function we have $H\psi=H(O\psi)$ (The effect of the Hamiltonian before and after $O$ acts on the wave function is the same). Can someone explain it?
 A: If $O$ is a symmetry and $\psi$ is an energy eigen-state, then $O\psi$ should also be an energy eigenstate (with the same eigenvalue $E$).
With the equation that you propose, $HO = H$, we have :
$$HO\psi = H\psi = E\psi\neq EO\psi$$
On the other hand, with $HO = OH$, we have :
$$HO \psi = OH\psi =EO\psi$$
so $O\psi$ has indeed energy $E$.
A: This confusion is probably caused by sloppy language: The $O$ in $[H,O] = HO - OH = 0$ for a "symmetry" $O$ is not actually the symmetry, it is the symmetry generator (or "infinitesimal symmetry") - the one-parameter unitary operator $U_O(\epsilon) = \mathrm{e}^{\mathrm{i}O\epsilon}$ associated to $O$ via Stone's theorem is the actual symmetry operator (in the sense of Wigner's theorem which says all symmetries are (anti-)unitary and $O$ is Hermitian, not unitary) for which the Hamiltonian is "unchanged" as in
$$ U_O(\epsilon)HU_O(\epsilon)^\dagger= H.$$
This is now really the statement that the symmetry leaves the Hamiltonian invariant and should be our actual definition of what it means for an operator to be a symmetry. This equation, in turn, implies for the generator that $[H,O] = 0$ (e. g. via application of the BCH formula).
A: It might be instructive to look at a concrete example. Let's consider $L^2(\mathbb R^2)$, that is, wave functions $\psi(x,y)$ in 2D space and the Hamiltonian $H = \partial_x^2 + \partial_y^2$. We would expect this to be symmetric under rotations of the coordinate system, such as the 90° rotation
$$ (O\psi)(x,y) = \psi(y, -x) . $$
Let us evaluate:

*

*$(H\psi)(x,y) = \psi_{11}(x,y) + \psi_{22}(x,y) $ (where I use subscripts to denote the partial derivative with respect to the first / second argument)

*$(HO\psi)(x,y) = \psi_{22}(y, -x) + \psi_{11}(y, -x)$
These are not the same and the reason is that the two functions $H\psi$ and $HO\psi$ "live" in different coordinate systems. So what we really want to compare $HO\psi$ to is

*

*$(OH\psi)(x,y) = \psi_{11}(y, -x) + \psi_{22}(y, -x)$
A useful next exercise might be to try and see where it goes wrong for the Hamiltonian $H_2 = \partial_x^2$, which is not rotationally symmetric.
A: The confusion may be because in classical physics, the Hamiltonian is a scalar function of the state, and a symmetry transformation on the state does indeed leave the Hamiltonian invariant. However, the quantum operator $H$ is not a scalar function but maps a state vector to another vector (in the Hilbert space). $H$ determines the evolution of the wave function via the time-dependent Schrödinger equation
$$i\hbar\frac{d\psi}{dt} = H\psi.$$
Given that $\psi$ is a solution of this equation, we should still have a solution if we replace it by the transformed wave function $O\psi$ at all times. Thus,
$$i\hbar\frac{d(O\psi)}{dt} = HO\psi.$$
Using the original equation, the left-hand side here reduces to $OH\psi$. Thus the symmetry preserves solutions if $OH = HO$.
