I'm trying to implement a doubly controlled phase gate using Qiskit. I'm aware of this proposed solution, but it's not working on my Google collab notebook. For some reason, I cannot import the "get_controlled_circuit" part. How can I implement the following doubly controlled phase gate using Qiskit? This gate appears on this paper, fig. 2.
Asked
Active
Viewed 272 times
1 Answers
2
You can use control() method to create a controlled version for any gate. For example:
from qiskit import QuantumCircuit
from qiskit.circuit.library import RZGate
from numpy import pi
phi = pi / 4
gate = RZGate(phi)
circ = QuantumCircuit(5)
circ.append(gate.control(2), [1, 3, 4])
circ.draw('mpl')
Egretta.Thula
- 12,146
- 1
- 13
- 35

