Curriculum / Quantum Foundations / The Pauli-X (NOT) Gate

Lesson 3 of 17Code challengeFree+100 XP

The Pauli-X (NOT) Gate

Flip a qubit from |0⟩ to |1⟩ using the X gate.

The Pauli-X (NOT) Gate

Flipping Qubits

The Pauli-X gate is the quantum equivalent of a classical NOT gate. It flips a qubit:

  • X|0⟩ = |1⟩
  • X|1⟩ = |0⟩
qc.x(0)  # Flip qubit 0

Your Challenge

Apply the X gate to qubit 0, then measure. You should see 100% |1⟩ results.

Gate Matrix

The Pauli-X gate as a matrix:

Acting on basis states:

and

This is why X is called the quantum NOT gate, it flips between 0 and 1.

Up next

Next: superposition. Apply the Hadamard gate and put a qubit into a weighted combination of |0⟩ and |1⟩.

How this lesson works

A hands-on coding challenge. You write Qiskit-compatible Python in the browser editor, run it instantly via WebAssembly, watch the circuit and Bloch sphere react, and pass automatic output checks. The AI tutor Qubitus gives Socratic hints if you get stuck.

Part of: Quantum Foundations

Learn the basics: qubits, gates, superposition, and measurement.

Take this lesson free

Create a free account and start this lesson in your browser. No credit card, no installation.