2
$\begingroup$

I asked about decomposition gate of CCRY last week, and the answer was:

enter image description here

However, I now also want to do this for CCCRY. Please someone tell me.

$\endgroup$
1
  • $\begingroup$ Thank you KAJ226, Yitian Wang and Appo. $\endgroup$
    – Hirokoudai
    Nov 27, 2020 at 6:06

3 Answers 3

1
$\begingroup$

There is an automatic way to design a gate, utilizing qiskit. When drawing the figure of a quantum, you can use the code circ.decompose().draw() to show a decomposed circuit.

Code first:

from qiskit import QuantumCircuit,QuantumRegister
from qiskit.circuit.library.standard_gates import RYGate
from qiskit.circuit import Parameter
import matplotlib.pyplot as plt
qr=QuantumRegister(4)
circ=QuantumCircuit(qr)
a=Parameter('a') # You can replace a with theta here
CCCRY=RYGate(a).control(3)
circ.append(CCCRY,qr)
circ.decompose().draw('mpl')
plt.show()

And this gives the following decomposition:

CCCRY

In this figure, $U_3(\theta,\phi,\lambda)=RZ(\phi)RX(-\pi/2)RZ(\theta)RX(\pi/2)RZ(\lambda)$, so $U_3(\theta,0,0)=RY(\theta)$.

$\endgroup$
1
$\begingroup$

In general, you can design $n$-controlled $U$ gate, $CCC\cdots CU = C^{n}U $, using the technique from Mike and Ike on page 184, starting with

enter image description here

where

enter image description here

and here your $Controlled-U$ is $CR_y$ which is

enter image description here

$\endgroup$
0
$\begingroup$

You can use the same trick by replacing $RY(\theta)$ by $CRY(\theta)$ i.e

$$ CCCRY = CC(CRY) $$

Then you can continue the simplification process till you find an excutable circuit.

$\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.