7

The QISKIT documentation doesn't explain what a TDG gate does and I can't find it anywhere else online.

Sanchayan Dutta
  • 17,945
  • 8
  • 50
  • 112

1 Answers1

8

According to the QISKit documentation, tdg(q) applies the Tdg gate to a qubit.

$T$ is the basically the $\pi/8$ phase shift gate whose matrix representation considering standard (computational) basis is:

$$\left(\begin{matrix}1 & 0 \\ 0 & e^{i\pi/4}\end{matrix}\right)$$

Tdg is simply the conjugate transpose of the matrix $T$ i.e. $T^{\dagger}$, which is:

$$\left(\begin{matrix}1 & 0 \\ 0 & e^{-i\pi/4}\end{matrix}\right)$$

Thus, the $T$ gate would map the basis vectors (of a qubit) $|0\rangle$ to $|0\rangle$ itself and $|1\rangle$ to $e^{i\pi/4}|1\rangle$, whereas $T^{\dagger}$ would map $|0\rangle$ to $|0\rangle$ itself and $|1\rangle$ to $e^{-i\pi/4}|1\rangle$.

P.S: In case you're wondering what dg means in tdg, it is simply an abbreviation for "dagger" i.e. in the sense of $T^{\dagger}$ (pronounced as $T$ - dagger).

Sanchayan Dutta
  • 17,945
  • 8
  • 50
  • 112