# Get parameters of a CU gate for implementing an erroneous CX gate with fidelity = 0.81

Let's say the definition of an erroneous CNOT gate is given as - CNOT is a 2-qubit quantum gate when the control qubit is at state 0, applies identity operation on the target qubit, when the control qubit is at state 1, applies NOT operation on the target with probability 𝑝 and applies identity operation on the target with probability 1−𝑝.

Was trying to solve it via CU gate for p=0.81 and trying to calculate the parameters but I'm arriving at an incorrect answer. Any insights on how can I solve it?

tl;dr: The operation you're describing is not unitary and cannot be implemented with a CU gate.

A standard CX gate implements the operation

$$CX = |0\rangle\langle 0| \otimes \mathbb{1} + |1\rangle\langle 1| \otimes X$$

This is a unitary operation, since $$CX^\dagger CX = \mathbb{1} \otimes \mathbb{1}$$. The erroneous CX you describe above would perform the operation

$$CX_{err} = |0\rangle\langle 0| \otimes \mathbb{1} + |1\rangle\langle 1| \otimes \left((1-p)\mathbb{1} + pX\right)$$

We can check if this is unitary by computing

$$CX_{err}^\dagger CX_{err} = ... = |0\rangle\langle 0| \otimes \mathbb{1} + |1\rangle\langle 1| \otimes \left((p^2 + (1-p)^2)\mathbb{1} + 2p(1-p)X\right) \neq \mathbb{1} \otimes \mathbb{1}$$

The CU gate is a unitary operation and can therefore not be used to implement $$CX_{err}$$.

• sorry I edited the question, the p is 0.81 Nov 5 at 9:36
• This operation is not unitary, except p=0 :) Nov 5 at 9:39
• Got it is it possible via some other gate or methodology in qiskit? Nov 5 at 13:41
• Since it's not a unitary operation, you can represent it using a quantum channel on a density matrix. You could e.g. use the Kraus operators (qiskit.org/documentation/stubs/qiskit.quantum_info.Kraus.html) and write your operation as sum of two A-matrices. Nov 7 at 10:41