2
$\begingroup$

I am trying to build the Grover circuit using the Qiskit circuit composer. The Grover example has a cz gate. I can't find that gate in circuit composer.

I am new at this.

$\endgroup$
3
$\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 at 20:52

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.