Solution (source code)

= Solution

Since
$$
|\psi_2\rangle=-\sin\theta|0\rangle+\cos\theta|1\rangle,
$$
application of $X$ gives $\cos\theta|0\rangle-\sin\theta|1\rangle$, and subsequent application of $Z$ gives
$$
\cos\theta|0\rangle+\sin\theta|1\rangle=|\psi_1\rangle.
$$
\b[Thus $ZX|\psi_2\rangle=|\psi_1\rangle$.]