# What is the difference between the action of $Z$ and $\exp(-i Z t)$ on a state?

What is the difference between performing $$Z$$ operation and performing $$e^{-i Zt}$$ operation on a state, given that $$e^{-i Zt}= \mathbb{1} + (-i Zt) + ...$$ is not equal to $$Z$$ for any value of $$t$$?

Effectively, the Z operation (represented by the Pauli $$Z$$ matrix) applies a rotation about the $$Z$$-axis. As you note, rotations can also be written in the form $$e^{-i Z t}$$. To see that, you can use a trick pretty similar to the one used to derive Euler's identity ($$e^{i \theta} = \cos(\theta) + i \sin(\theta)$$) to rewrite the Taylor series that you quoted in your question.

In particular, to derive Euler's identity, you can use that $$i^2 = -1$$ to separate the even and odd powers of the series $$e^x$$ and identify the series for $$\cos(\theta)$$ and $$\sin(\theta)$$. Since $$(Zt)^2 = 𝟙t^2$$ , you can pull the same trick with $$e^{i Z t}$$:

\begin{align} e^{i Z t} & = \sum_{j = 0}^{\infty} \frac{(iZt)^j}{j!} \\ & = 𝟙\left[\sum_{k = 0}^{\infty} \frac{(-1)^k}{(2k)!}t^{2k}\right] + i Z \left[ \sum_{k=0}^{\infty} \frac{(-1)^k}{(2k+1)!}t^{2k+1} \right] \\ & = 𝟙 \cos(t) + i Z \sin(t) \end{align}

Thus, at $$t = \pi / 2$$, $$e^{i Z t} = iZ$$. Since $$i$$ is an example of a global phase, evolving under $$Z$$ for time $$t = \pi / 2$$ gives you the same unitary transformation as $$Z$$. Indeed, you can check the equivalence of the two matrices using QuTiP:

In : import qutip as qt
In : import numpy as np
In : Z = qt.sigmaz()
In : -1j * (1j * Z * np.pi / 2).expm()
Out:
Quantum object: dims = [, ], shape = (2, 2), type = oper, isherm = True
Qobj data =
[[ 1.  0.]
[ 0. -1.]]


You can also check that the quantum program Z(q); does the same thing as Exp([PauliZ], PI() / 2.0, [q]); using the AssertOperationsEqualReferenced operation:

open Microsoft.Quantum.Arrays;
open Microsoft.Quantum.Diagnostics;
open Microsoft.Quantum.Math;

operation ApplyZ(qubits : Qubit[]) : Unit is Adj + Ctl {
}

operation CheckIfOperationsEqual() : Unit {
AssertOperationsEqualReferenced(1,
ApplyZ,
Exp([PauliZ], PI() / 2.0, _)
);
Message("Operations are equal!");
}


Try it online!

• If you are interested in more, check out Chris and my book, Learn Quantum Computing with Python and Q# manning.com/books/…. Chapter 9 which should be out shortly talks about 'Exp' and using Hamiltionians to describe the time evolution of states. Jan 29, 2020 at 19:48
• @ChrisGranade There's a sign error in your Taylor expansion. The Taylor series for the exponential function gives $e^{i Z t} = \sum_{k = 0}^{\infty} \frac{(iZt)^k}{k!} = 𝟙 + iZt - \frac12 Z^2 t^2 \cdots$, ultimately resulting in $e^{iZt}=𝟙\cos(t)+iZ \sin(t)$. Aug 1, 2020 at 9:35
• Thanks for pointing that out, @JonathanTrousdale. I'll admit I am pretty bad at keeping track of minus signs... in any case, would you like to edit my answer, then, so that you get the karma for that fix? Aug 2, 2020 at 17:33
• @ChrisGranade No problem. I'm not one to turn down good karma. Aug 2, 2020 at 19:31