1
$\begingroup$

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?

$\endgroup$
4
  • 3
    $\begingroup$ Please, be more specific. Where did you read about CNOT1,n gates? Do you have a reference? $\endgroup$ Commented Apr 18, 2023 at 7:39
  • $\begingroup$ @MicheleAmoretti i read it in a book. They said:"For n = 2, the indices are length-4 strings y1y2z1z2, which are permuted into y1y2(y1 ⊕ z1)(y2 ⊕ z2). This is a composition of two CNOT operations, one on the first and third indices (preserving the others), which we denote by C1,3, and the other on the second and fourth, written as C2,4. For general n, the final operator is the composition Cn = C1,n+1C2,n+2⋯Cn,2n." $\endgroup$
    – Huy By
    Commented Apr 18, 2023 at 7:57
  • 1
    $\begingroup$ Ok, it is just notation, not familiar to me. Can you please tell us what is the book? $\endgroup$ Commented Apr 18, 2023 at 11:01
  • 1
    $\begingroup$ Please, if you could, post a picture of a circuit where the gate is used. $\endgroup$ Commented Apr 18, 2023 at 14:26

2 Answers 2

2
$\begingroup$

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. $$

$\endgroup$
2
  • $\begingroup$ I think you are right, but how do you get that formular, can i get the general formular to compute any gate like this? $\endgroup$
    – Huy By
    Commented Apr 18, 2023 at 7:59
  • $\begingroup$ Yes. You just have a tensor product structure covering all qubits, and put $I$ everywhere that you're not doing anything. $\endgroup$
    – DaftWullie
    Commented Apr 18, 2023 at 8:07
1
$\begingroup$

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.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.