2
$\begingroup$

How can one construct a CCY gate using gates which are native to Qiskit (CCX and single qubit gates). I was able to find the answer for CCZ gates, however guessing and testing until I can figure out CCY seems like a bad way to go.

$\endgroup$
1
  • 1
    $\begingroup$ could you list what are the gates native to Qiskit? Decomposing procedures depend on the allowed gate set. Also, are you asking "How to construct a CCY gate using gates that are native to Qiskit", or "Is there a general procedure for decomposing arbitrary unitary operations?" I would put one of these two questions in the title/body of the post, and remove the other one (on stackexchange it is encouraged to ask a single question per post) $\endgroup$
    – glS
    May 29, 2019 at 17:51

1 Answer 1

5
$\begingroup$

For $\mathrm{CC} Y$, given that you have a decomposition for $\mathrm{CC} Z$ (or for $\textrm{CC} X = \mathrm{Toffoli}$), all you need is the relationship between $ X$, $Y$, and $Z$: $$ Y = R_z (-\tfrac\pi2) X R_z (\tfrac\pi2) = R_x (\tfrac\pi2) Z R_x(-\tfrac\pi2) $$ Then, given $Y = U P U^\dagger$ for some $P$ for which you know a decomposition for $\mathrm{CC} P$, simply do the analogous decomposition: $$ \mathrm{CC}Y = (\mathbf 1 \otimes \mathbf 1 \otimes U) \mathrm{CC} P (\mathbf 1 \otimes \mathbf 1 \otimes U)^\dagger. $$ You can do this for any self-inverse unitary $V$ in place of $Y$ as well.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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