Is there any way that I can self define a control gate in qiskit? I have define a new quantum gate qg
, and it will be applied to the "data" qubit if the "control" qubit is 1, and it will not be applied if the "control" qubit is 0. How can I implement this?
Here is the definition of the quantum circuit
n_control = 2
n_data = 2
control = QuantumRegister(n_control, 'control')
data = QuantumRegister(n_data, 'data')
qc = QuantumCircuit(control, data)
The new quantum gate acts by
qc.append(qg, data)
and I want this operation to be controlled by control