The Standard Gate Set

Below is a summary of the key gates used in tweedledum

Name(s)

Symbol

tweedledum symbol

Matrix

Identity

I

gate_set::identity

\(\pmatrix{1&0 \\ 0&1}\)

Hadamard

H

gate_set::hadamard

\(\frac{1}{\sqrt{2}}\pmatrix{1&1 \\ 1&-1}\)

Arbitrary rotations

X Rotation

Rx

gate_set::rotation_x

\(\pmatrix{\cos\frac\theta2 & -\mathrm{i}\sin\frac\theta2 \\ -\mathrm{i}\sin\frac\theta2 & \cos\frac\theta2}\)

Y Rotation

Ry

gate_set::rotation_y

Z Rotation

Rz

gate_set::rotation_z

\(\pmatrix{e^{-\mathrm{i}\theta}&0 \\ 0&e^{\mathrm{i}\theta}}\)

Named Rotations

Pauli X, NOT

X

gate_set::pauli_x

\(\pmatrix{0&1 \\ 1&0}\)

T

T

gate_set::t

\(\pmatrix{1&0 \\ 0&e^{\mathrm{i}\frac\pi4}}\)

T dagger

T†

gate_set::t_dagger

Phase

S

gate_set::phase

\(\pmatrix{1&0 \\ 0&\mathrm{i}}\)

Phase dagger

S†

gate_set::phase_dagger

Pauli Z, Phase flip

Z

gate_set::pauli_z

\(\pmatrix{1&0 \\ 0&-1}\)

Controlled gates

Control NOT

CNOT

gate_set::cx

\(\pmatrix{1&0&0&0 \\ 0&1&0&0 \\ 0&0&0&1 \\ 0&0&1&0}\)

Control Z

CZ

gate_set::cz

\(\pmatrix{1&0&0&0 \\ 0&1&0&0 \\ 0&0&1&0 \\ 0&0&0&-1}\)

Multiple Control NOT, Toffoli

gate_set::mcx

Multiple Control Z

gate_set::mcz