Skip to content

Available gates

Hernán Indíbil de la Cruz Calvo edited this page May 30, 2022 · 10 revisions

The QSimov library lets you use a wide set of quantum gates, with aliases to let you use the same gate with different names. This helps people that may have learned quantum computing from other sources.

The parameters are shown in order, so when using for example the U gate, it will be written like U(θ, ϕ, λ), changing θ, ϕ and λ with the desired angles in radians.

X Gate:

  • Description: The Pauli X gate, rotates 𝜋 radians around the X axis. Bit-flip
  • Aliases:
    • X
    • Not
  • No parameters
  • Matrix:
0 1
1 0

Y Gate:

  • Description: The Pauli Y gate, rotates 𝜋 radians around the Y axis
  • Aliases:
    • Y
  • No parameters
  • Matrix:
0 -i
i 0

Z Gate:

  • Description: The Pauli Z gate, rotates 𝜋 radians around the Z axis
  • Aliases:
    • Z
  • No parameters
  • Matrix:
1 0
0 -1

H Gate:

  • Description: Hadamard gate
  • Aliases:
    • H
  • No parameters
  • Matrix:
1/√2 1/√2
1/√2 -1/√2

√Not Gate:

  • Description: Square root of the X gate. Applying it twice leads to the same result as applying the X gate
  • Aliases:
    • sqrtnot
    • sqrtx
    • v
  • No parameters
  • Matrix:
0.5 + 0.5i 0.5 - 0.5i
0.5 - 0.5i 0.5 + 0.5i

Phase-Shift Gate:

  • Description: family of single-qubit gates that leave the basis state | 0 ⟩ unchanged and map | 1 ⟩ to e^(iϕ)| 1 ⟩
  • Aliases:
    • r
    • phaseshift
    • phasechange
  • Parameters:
    • ϕ: the angle
  • Matrix:
1 0
0 e^(iϕ)

Rx Gate:

  • Description: family of single-qubit gates that rotate ϕ radians around X axis
  • Aliases:
    • Rx
  • Parameters:
    • ϕ: the angle
  • Matrix:
cos(ϕ/2) -i*sin(ϕ/2)
-i*sin(ϕ/2) cos(ϕ/2)

Ry Gate:

  • Description: family of single-qubit gates that rotate ϕ radians around Y axis
  • Aliases:
    • Ry
  • Parameters:
    • ϕ: the angle
  • Matrix:
cos(ϕ/2) -sin(ϕ/2)
sin(ϕ/2) cos(ϕ/2)

Rz Gate:

  • Description: family of single-qubit gates that rotate ϕ radians around Z axis. Same as the Phase Shift gate but with a hidden phase change. No observable differences
  • Aliases:
    • Rz
  • Parameters:
    • ϕ: the angle
  • Matrix:
e^(-iϕ/2) 0
0 e^(iϕ/2)

Root of the Unity gate:

  • Description: family of single-qubit gates used in the QFT
  • Aliases:
    • runity
    • rootphase
  • Parameters:
    • n: refers to the nth root of the unity
  • Matrix: Phase shift with ϕ = 2𝜋/2^n

Half-Deutsch Gate:

  • Description: family of single-qubit gates where C-C-HalfDeutsch is the so called Deutsch gate. Therefore it will probably be used in its double controlled form
  • Aliases:
    • d
    • deutsch
    • halfdeutsch
    • partialdeutsch
  • Parameters:
    • ϕ: the angle
  • Matrix:
i*cos(ϕ) sin(ϕ)
sin(ϕ) i*cos(ϕ)

U Gate:

  • Description: family of single-qubit gates from which any other single qubit gate can be obtained
  • Aliases:
    • u
    • u3
  • Parameters:
    • θ: an angle
    • ϕ: an angle
    • λ: an angle
  • Matrix:
cos(θ/2) -e^(iλ) * sin(θ/2)
e^(iϕ) * sin(θ/2) e^(i(ϕ+λ)) * cos(θ/2)

U2 Gate:

  • Description: family of single-qubit gates where U2(ϕ, λ) = U(𝜋/2, ϕ, λ)
  • Aliases:
    • u2
  • Parameters:
    • ϕ: an angle
    • λ: an angle
  • Matrix:
1/√2 -e^(iλ) * 1/√2
e^(iϕ) * 1/√2 e^(i(ϕ+λ)) * 1/√2

U1 Gate:

  • Description: family of single-qubit gates with the same effects as the Phase-Shift gate. No observable differences
  • Aliases:
    • u1
  • Parameters:
    • ϕ: an angle
  • Matrix: Same as the Phase-Shift gate

Swap Gate:

  • Description: swaps two qubits (therefore it is a two qubit gate)
  • Aliases:
    • swap
  • No parameters
  • Matrix:
1 0 0 0
0 0 1 0
0 1 0 0
0 0 0 1

iSwap Gate:

  • Description: swap that does something to the imaginary part (therefore it is a two qubit gate)
  • Aliases:
    • iswap
  • No parameters
  • Matrix:
1 0 0 0
0 0 i 0
0 i 0 0
0 0 0 1

√Swap Gate:

  • Description: two applications of this gate lead to the same results as applying a Swap
  • Aliases:
    • sqrtswap
  • No parameters
  • Matrix:
1 0 0 0
0 0.5 + 0.5i 0.5 - 0.5i 0
0 0.5 - 0.5i 0.5 + 0.5i 0
0 0 0 1

Ising XX coupling gate:

  • Description: 2-qubit gate that is implemented natively in some trapped-ion quantum computers
  • Aliases:
    • xx
    • isingx
    • isingxx
  • Parameters:
    • ϕ: an angle
  • Matrix:
1/√2 0 0 -i*e^(iϕ)*1/√2
0 1/√2 -i*1/√2 0
0 -i*1/√2 1/√2 0
-i*e^(-iϕ)*1/√2 0 0 1/√2

Ising YY coupling gate:

  • Description: 2-qubit gate that is implemented natively in some trapped-ion quantum computers
  • Aliases:
    • yy
    • isingy
    • isingyy
  • Parameters:
    • ϕ: an angle
  • Matrix:
cos(ϕ) 0 0 i*sin(ϕ)
0 cos(ϕ) -i*sin(ϕ) 0
0 -i*sin(ϕ) cos(ϕ) 0
i*sin(ϕ) 0 0 cos(ϕ)

Ising ZZ coupling gate:

  • Description: 2-qubit gate that is implemented natively in some trapped-ion quantum computers
  • Aliases:
    • zz
    • isingz
    • isingzz
  • Parameters:
    • ϕ: an angle
  • Matrix:
e^(iϕ/2) 0 0 0
0 e^(-iϕ/2) 0 0
0 0 e^(-iϕ/2) 0
0 0 0 e^(iϕ/2)