Quantum Gates

Gaurikhard
3 min readJun 21, 2023

--

Photo by Dan Cristian Pădureț on Unsplash

Quantum gates are unitary operations that act on one or more qubits while maintaining the quantum state’s normalization. These gates are commonly represented by matrices, and matrix multiplication transforms the state of the qubit(s).

  1. Pauli gates: The Pauli gates include the Pauli-X, Pauli-Y, and Pauli-Z gates. These gates correspond to rotations around the X, Y, and Z axes of the Bloch sphere, respectively.

Pauli-X Gate (or NOT Gate): The Pauli-X gate is a single-qubit gate that corresponds to a rotation around the X-axis of the Bloch sphere by π radians (180 degrees). It is often referred to as the NOT gate because it flips the state of the qubit. The gate matrix representation is:

0  1
1 0

The Pauli-X gate can be applied to a qubit in the following way:

  • |0⟩ state is transformed to |1⟩ state.
  • |1⟩ state is transformed to |0⟩ state.

Pauli-Y Gate: The Pauli-Y gate is another single-qubit gate that corresponds to a rotation around the Y-axis of the Bloch sphere by π radians (180 degrees). The gate matrix representation

0  -i
i 0

The Pauli-Y gate transforms the qubit states as follows:

  • |0⟩ state is transformed to i|1⟩ state.
  • |1⟩ state is transformed to -i|0⟩ state.

Pauli-Z Gate: The Pauli-Z gate is a single-qubit gate that corresponds to a rotation around the Z-axis of the Bloch sphere by π radians (180 degrees). The gate matrix representation is:

1   0
0 -1

The Pauli-Z gate transforms the qubit states as follows:

  • |0⟩ state is unchanged.
  • |1⟩ state is transformed to -|1⟩ state.
  1. Hadamard gate:The Hadamard gate (H gate) is a superposition-creating single-qubit gate. It combines the basis states |0 and |1 into equal superpositions of both. It corresponds to a rotation of radians around the axis that is the sum of the Bloch sphere’s X and Z axes. The gate matrix is represented as follows:
1   1
1 -1

The Hadamard gate transforms the qubit states as follows:

  • |0⟩ state is transformed to |+⟩ state (superposition of |0⟩ and |1⟩).
  • |1⟩ state is transformed to |-⟩ state (superposition of |0⟩ and |1⟩ with a phase difference).
  1. CNOT gate: The Controlled-NOT gate (CNOT) is a two-qubit gate that flips the target qubit (the second qubit) if and only if the control qubit (the first qubit) is in the state |1⟩. It is widely used in quantum algorithms and entanglement generation. The target qubit is flipped if and only if the control qubit is in the state |1⟩. The gate matrix representation is:
  1   0   0   0
0 1 0 0
0 0 0 1
0 0 1 0

The CNOT gate transforms the four possible input states as follows:

  • |00⟩ state is unchanged.
  • |01⟩ state is unchanged.
  • |10⟩ state is transformed to |11⟩ state.
  • |11⟩ state is transformed to |10⟩ state.
  1. Toffoli gate: The Toffoli gate is a three-qubit gate that performs a controlled-NOT operation on the last qubit (target) if both the first two qubits (controls) are in the state |1⟩. It is also called the controlled-controlled-NOT gate (CCNOT).The gate matrix representation is:
  1   0   0   0   0   0   0   0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0

The Toffoli gate transforms the eight possible input states as follows:

  • The target qubit remains unchanged if both control qubits are in the state |0⟩.
  • The target qubit is flipped if both control qubits are in the state |1⟩.
  1. SWAP gate: The SWAP gate exchanges the states of two qubits. It is a two-qubit gate and is used for qubit rearrangement and data swapping. The gate matrix representation is:
  1   0   0   0
0 0 1 0
0 1 0 0
0 0 0 1

The SWAP gate transforms the four possible input states as follows:

  • |00⟩ state is unchanged.
  • |01⟩ state is transformed to |10⟩ state.
  • |10⟩ state is transformed to |01⟩ state.
  • |11⟩ state is unchanged.

--

--

Responses (1)