# Get matrix for an X gate for a given fidelity p

Wanted to check on how to mathematically obtain the matrix of an X gate which has fidelity/probability $$p$$? (i.e. it acts as an $$X$$ gate with probability $$p$$)

• And what does the gate act as with probability $1-p$? Nov 4, 2023 at 6:22
• It acts as I gate Nov 8, 2023 at 17:27

## 1 Answer

The usual way to represent this isn't via a matrix, but via the Kraus representation. That is, a quantum operation can be written as: $$\rho\mapsto\sum_iK_i\rho K_i^\dagger$$ with $$\sum\limits_iK_i^\dagger K_i\leqslant I$$. Here, the quantum operation you're looking for is the well-known bit-flip channel with probability $$p$$: $$\rho\mapsto(1-p)\rho+pX\rho X$$ That is, with probability $$1-p$$, nothing is done on the quantum state, and with probability $$p$$ an $$X$$ gate is applied. Here, the Kraus operators describing this operation are $$K_0=\sqrt{1-p}I$$ and $$K_1=\sqrt{p}X$$.

• I was interpreting OP's question as $X$ gate occurs with probability $p$ and erroneous $X$ gate occurs with probability $1-p$, like $e^{-i \theta X}$ with $\theta \neq \frac{\pi}{2}$. Nov 4, 2023 at 18:29