1

I'm familiar with the CNOT gate and I know the matrix of that gate. But what is CNOT1,3 gate and what is its matrix, how to compute it?

Martin Vesely
  • 15,398
  • 4
  • 32
  • 75
Huy By
  • 133
  • 6

2 Answers2

2

Without context, we can only guess. My guess would be that CNOT1,3 means a controlled-not, controlled off qubit 1 and targetting qubit 3. In a 3-qubit setting, the gate would then look like $$ |0\rangle\langle 0|\otimes I\otimes I+|1\rangle\langle 1|\otimes I\otimes X. $$

DaftWullie
  • 63,351
  • 4
  • 57
  • 142
1

For a general formula, consider an $n$-qubit state. Denote $c$ and $t$ as the indices of the control and target qubits (indexing from 0). Then, a general gate $CNOT_{c,t}$ can be given by $$I^{\otimes c} \otimes |0\rangle \langle 0| \otimes I^{\otimes (n-c-1)}$$ $$+ I^{\otimes c} \otimes |1\rangle \langle 1| \otimes I^{\otimes (t-c-1)} \otimes X \otimes I^{\otimes (n-t-1)}$$ where $I^{\otimes i}$ denotes the $i$-fold tensor product of the identity. Note that here, we have assumed $c < t$, however, a similar formula can be arrived in the other case.

Jurij
  • 11
  • 3