0
$\begingroup$

I know that I can just use the $RZ$ gate to replace the $PH$ phase gate. But I need a way to implement the controlled phase gate $C-PH$ this cannot just be replaced with a $CRZ$ gate.

$\endgroup$
6
  • $\begingroup$ Could you expand your question? Not sure what you are confused by. $\endgroup$
    – AHusain
    Aug 8, 2019 at 12:41
  • 1
    $\begingroup$ to do an $RZ$ on google cirq I can use cirq.ops.common_gates.Rz. I didn't find any way to do a phase gate on google cirq, so I just replaced all of my phase gates into $RZ$ gates. Now that I have controlled phase gates, I don't know how to implement that on google cirq because even though an RZ does the same as a Phase gate, the controlled version don't, because the controlled version of a gate does change with global phase shifts. $\endgroup$ Aug 8, 2019 at 12:56
  • 1
    $\begingroup$ Can you not compensate with RZ on each of the two qubits? $\endgroup$
    – DaftWullie
    Aug 8, 2019 at 13:21
  • $\begingroup$ I could, but I came here to find the minimal amount of gate, or some kind of workaround like if it was possible to define my own abstract gate in google cirq. $\endgroup$ Aug 8, 2019 at 13:27
  • $\begingroup$ the documentation mentions circ.CZ, and the possibility to use it to do things like cirq.CZ**t $\endgroup$
    – DaftWullie
    Aug 8, 2019 at 14:35

1 Answer 1

1
$\begingroup$

cirq.ZPowGate(exponent=t/pi).controlled_by(control_qubit).on(target_qubit)

or equivalently

cirq.CZ(control_qubit, target_qubit)**(t / pi)

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