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
  • 13,891
  • 4
  • 28
  • 65
Huy By
  • 83
  • 5
  • 3
    Please, be more specific. Where did you read about CNOT1,n gates? Do you have a reference? – Michele Amoretti Apr 18 '23 at 07:39
  • @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." – Huy By Apr 18 '23 at 07:57
  • 1
    Ok, it is just notation, not familiar to me. Can you please tell us what is the book? – Michele Amoretti Apr 18 '23 at 11:01
  • 1
    Please, if you could, post a picture of a circuit where the gate is used. – Martin Vesely Apr 18 '23 at 14:26

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
  • 57,689
  • 3
  • 46
  • 124
  • I think you are right, but how do you get that formular, can i get the general formular to compute any gate like this? – Huy By Apr 18 '23 at 07:59
  • Yes. You just have a tensor product structure covering all qubits, and put $I$ everywhere that you're not doing anything. – DaftWullie Apr 18 '23 at 08:07
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