What Are Quantum Gates?

Understanding H, X, and CNOT — the building blocks of quantum algorithms

1. The Big Idea

In classical computing, we use logic gates (AND, OR, NOT) to manipulate bits (0 or 1).

In quantum computing, we use quantum gates to manipulate qubits, which can be: 0, 1 or a superposition of both

 Quantum gates don’t just flip bits, they rotate probabilities and phases.

2. Intuition: Think of a Maze Game

Once again imagine a maze where:

  • A classical player chooses one path at a time
  • A quantum player explores all paths at once

Quantum gates:

  • Don’t just choose paths
  • They shape which paths survive and which cancel out

3. What Is a Quantum Gate?

A quantum gate is:

  • A mathematical operation
  • That changes a qubit’s state
  • While preserving total probability

Technically: unitary transformation

4. Visualizing a Qubit

A qubit state:

|ψ⟩ = α|0⟩ + β|1⟩

Where:

  • α² → probability of 0
  • β² → probability of 1

5. The X Gate (Quantum NOT Gate)

The X gate (Pauli-X) flips a qubit’s state, turning |0⟩ into |1⟩ and vice versa, much like a classical NOT gate. When applied to a superposition, it swaps the probability amplitudes of |0⟩ and |1⟩ without destroying the quantum state. It is represented by the matrix and swaps the amplitudes of the qubit.

6. The H Gate (Hadamard Gate)

The Hadamard (H) gate creates superposition, transforming a definite state like |0⟩ into an equal mix of |0⟩ and |1⟩. It enables quantum parallelism by allowing a qubit to explore multiple states simultaneously.  Matrix representation of H gate is

Maze Analogy:

Start   ->   [H]   ->  Split into multiple paths

7. The CNOT Gate (Controlled NOT)

The CNOT (Controlled-NOT) gate is a two-qubit gate that flips the target qubit only when the control qubit is in state |1⟩. It is essential for creating entanglement, enabling correlations between qubits that have no classical equivalent. The matrix representation of the CNOT gate is as below.

Rule:

  • If control = 0 → do nothing
  • If control = 1 → flip target

8. Magic Happens: Entanglement

The qubits are now linked

  • If one is 0, the other is 0
  • If one is 1, the other is 1

Even if separated!

9. Full Picture

This is the foundation of quantum algorithms

10. Why These Gates Matter

Together, they enable:

  • Quantum parallelism
  • Interference
  • Quantum speedup

11. Deep Insight (Important)

Classical gates:
                Change values

Quantum gates:
            Change probability amplitudes and phase