1
$\begingroup$

How to draw CCZ gate in IBM Quantum Composer? There is no CCZ gate in quantum composer.

In addition to this, please help me to draw the gate shown in below figure in quantum composer. enter image description here

$\endgroup$
1
  • $\begingroup$ I don't sure but this post might help. $\endgroup$
    – Mr. Morgan
    Aug 13, 2022 at 14:19

1 Answer 1

2
$\begingroup$

To my knowledge, there is no built-in CCZ gate in Qiskit at all, and thus it doens't exist in the IBM Quantum Composer as well.

In order to run a CCZ gate one needs to construct it. There are several options to do that, some more or less efficient than the others. Anyway a basic identity of single-qubit gates is $Z = HXH$ (You can try the matrix multiplication yourself and see it works). Since CCX is a built-in gate in Qiskit and it's usable in IBM Quantum Composer you can construct easily the following circuit for CCZ:

enter image description here

About the second question - the following decomposition for the gate in the picture you have posted can be implemented easily using IBM Quantum Composer:

enter image description here

It's equivalent to the gate in the picture that you have posted because q1 has been defined as an "anti-control" qubit - I.e the opposite of a control qubit, i.e perform the controlled operation if the qubit is in state $|0⟩$. So flipping this qubit just before and right after the control gate does the job.

I don't know why you limit yourself to IBM Quantum Composer only, but if we use Qiskit than we can construct the gate in the picture you have posted using the following code:

from qiskit import QuantumCircuit
from qiskit.circuit.library.standard_gates.z import ZGate

qc1 = QuantumCircuit(3)
U1 = ZGate().control(num_ctrl_qubits = 2, ctrl_state = '01')
qc1.append(U1,qargs = [0,1,2])
$\endgroup$
2
  • $\begingroup$ thanks!!! Other part of the question is that how to draw the gate shown in the figure. $\endgroup$ Aug 13, 2022 at 15:15
  • 1
    $\begingroup$ I modified my answer and added a solution for you second question as well. $\endgroup$
    – Ohad
    Aug 13, 2022 at 21:57

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.