2
$\begingroup$

I am trying to figure out the matrix for a gate I'm going to be implementing - a mirror, i.e., a $180^{\circ}$ phase shift. Quantiki gives

$$R(\theta)=\begin{bmatrix}1&0\\0&e^{2\pi i\theta}\end{bmatrix}$$

for the phase shift gate; here I assume I would set $\theta = 180$ (unless that's the wrong units or something...)

Wikipedia gives

$$R_\phi = \begin{bmatrix}1&0\\0&e^{i\phi}\end{bmatrix}$$

for the phase shift gate, here I guess I'd set $\phi = 180$?

Here's the problem - they're not the same. My guess would be $\phi = 2\pi\theta$ (perhaps, I don't know). Which is the correct matrix? Or are they the same (and if so, how)?

$\endgroup$
  • $\begingroup$ Who is Quantiki? $\endgroup$ – Ryan Unger Jul 23 '17 at 1:15
  • $\begingroup$ @0celoñe7 Quantiki is a combination of forum and wikipedia, dedicated to quantum computing. $\endgroup$ – heather Jul 23 '17 at 13:51
  • $\begingroup$ What do you mean be "correct"? Where do you get the phase parameter from? $\endgroup$ – Norbert Schuch Jul 26 '17 at 6:43
2
$\begingroup$

If you want to phase the $|1\rangle$ state by 180 degrees (i.e. a half-turn) relative to the $|0\rangle$ state, then the operation you want is:

$$R(\pi) = \begin{bmatrix} 1 & 0 \\ 0 & e^{i \pi} \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} = Z$$

Because $\pi$ is a half-turn in radians.

$\endgroup$
2
$\begingroup$

Craig Gidney already gave the answer to your main problem. I will answer the second one: What is the relation between the two matrices. You know that cosine and sine are $2\pi$ periodic, meaning $\cos(x+2\pi k) = \cos(x)$ and $\sin(x) = \sin(x+2\pi k)$ for any integer $k$. So the function repeats itself every period, which is in the standard case $2\pi$ long. Further $e^{i\theta}=\cos(\theta)+i\sin(\theta)$. Since both function are $2\pi$ periodic and we only add them, $e^{i\theta}$ is also $2\pi$ periodic. This $e^{2\pi i\theta}=e^{i\theta}$. So the two matrices are equal.

It would be useful if you put the link of quantiki in your post, I do not see why someone should write the first form. On quantiki I only found the second form https://www.quantiki.org/wiki/basic-concepts-quantum-computation

$\endgroup$
  • $\begingroup$ Here is the quantiki link. $\endgroup$ – heather Jul 24 '17 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.