4
$\begingroup$

I am trying to build the Grover circuit using the IBM Quantum Composer circuit composer. The Grover example has a CZ gate. I can't find that gate in circuit composer.

$\endgroup$

2 Answers 2

6
$\begingroup$

There is no Controlled-Z in the circuit composer by default because this gate can be built from CNOT ($CX$) and Hadamard gate $H$. This is because we have the identity $$ Z = HXH$$ This implies that $CZ$ can be constructed as:

enter image description here

Now, in the qiskit composer, there is a button + Add that allows you to add this gate operation as a pre-defined gate and you can named it as CZ gate.

enter image description here

$\endgroup$
1
  • $\begingroup$ This is very helpful, thank you. The only downside I see is that the icon for the gate I add does not show the connection to the other qubit, only a box on line for one qubit. The cz gate for the Grover example shows a connection to both qubits.I am not sure how they did that. Are you allowed to design your own icons? $\endgroup$
    – Pete
    Feb 5, 2021 at 20:52
1
$\begingroup$

Not sure how it was in 2021, currently (Oct 2022) the way to create a CZ gate in the IBM Quantum Composer is:

  1. Add a Z gate
  2. Edit it
  3. Add control
  4. You can change the control and target qubit from the menu.

how to create a CZ gate

$\endgroup$

Your Answer

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

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