0
$\begingroup$

How does a controlled R gate look like (matrixwise)? And how to generate CCR, CCCR and so on?

$\endgroup$
1
$\begingroup$

I found the answer and it seems like for a gate

$$ U = \begin{bmatrix} x_{00} & x_{10}\\ x_{00} & x_{11} \end{bmatrix} $$

its controlled variant would be: $$ CU=\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & x_{00} & x_{01} \\ 0 & 0 & x_{10} & x_{11} \end{bmatrix} $$

Hence for R, which is $$ R(\theta) = \begin{bmatrix} 1 & 0\\ 0 & e^{i \theta} \end{bmatrix} $$

CR would be: $$ CR(\theta)=\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & e^{i \theta} \end{bmatrix} $$

P.S.: Please, correct me if I'm wrong.

$\endgroup$
  • 1
    $\begingroup$ Yes, you are right. Similarly you can get a C...CU gate, $U$ is in the right bottom corner of a C...CU gate, other diagonal elements are ones and other non-diagonal elements are zeros. $\endgroup$ – Martin Vesely Dec 8 '19 at 22:20

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.