Launch the interactive walkthrough to discover each component, including the 3D Q-Sphere Lab & Python in Colab.
Master the fundamental bit-flip gate: matrix formulation, 180-degree rotation around the X-axis of the Bloch sphere, and code execution.
Interactive 3D state vector exploration, unitary transformation gates, and Born rule collapse for Topic 6.4
| Symbol / Term | Meaning | Beginner Interpretation |
|---|---|---|
| Pauli-X matrix | The quantum bit-flip operator [[0, 1], [1, 0]] | |
| Bit-flip on ground state | Transforms standard 0 into standard 1 | |
| Bit-flip on excited state | Transforms standard 1 into standard 0 | |
| Self-inverse property | Applying NOT twice flips back to original (NOT NOT = no change) |
Applying Pauli-X to superposition state |Οβ© = 0.6|0β© + 0.8|1β©:
Result: Amplitudes and probabilities are completely swapped, and applying X again restores the original state.
Ingest single qubit state alpha|0> + beta|1>.
The X gate swaps the amplitudes: beta|0> + alpha|1>.
Applying X a second time swaps them back to alpha|0> + beta|1>.
Problem: Groverβs algorithm requires an auxiliary qubit initialized to the minus state |->.
Solution: Applying X followed by H to |0> produces state |->: H(X|0>) = H|1> = |->.
Interactive activity component
Apply the Pauli-X gate to basis states |0> and |1> in Qiskit and verify bit-flip behavior with Statevector simulation.
For Google Colab or Jupyter notebooks, run this shell command to install the required dependencies:
!pip install qiskit1 from qiskit import QuantumCircuit 2 from qiskit.quantum_info import Statevector
from qiskit import QuantumCircuit β Circuit module
from qiskit.quantum_info import Statevector β Statevector module
1 # 1. Apply X to |0> -> should yield |1> 2 qc0 = QuantumCircuit(1) 3 qc0.x(0) # Apply Pauli-X 4 sv0 = Statevector.from_instruction(qc0) 5 print('Input |0> -> After X gate:', sv0.data.round(2)) 6 print('Probabilities:', sv0.probabilities_dict()) 7 8 # 2. Apply X to |1> -> should yield |0> 9 qc1 = QuantumCircuit(1) 10 qc1.x(0) # Make |1> 11 qc1.x(0) # Apply X again 12 sv1 = Statevector.from_instruction(qc1) 13 print('\nInput |1> -> After X gate:', sv1.data.round(2)) 14 print('Probabilities:', sv1.probabilities_dict()) 15 print('\nProves: X * X = I (Pauli-X is self-inverse)')
# 1. Apply X to |0> -> should yield |1>
Flip 0
qc0 = QuantumCircuit(1)
Init |0>
qc0.x(0) # Apply Pauli-X
Apply X
sv0 = Statevector.from_instruction(qc0)
Simulate
print('Input |0> -> After X gate:', sv0.data.round(2))
Result |1>
print('Probabilities:', sv0.probabilities_dict())
{'1': 1.0}
# 2. Apply X to |1> -> should yield |0>
Flip 1
qc1 = QuantumCircuit(1)
Init |0>
qc1.x(0) # Make |1>
Flip to 1
qc1.x(0) # Apply X again
Flip back to 0
sv1 = Statevector.from_instruction(qc1)
Simulate
print('\nInput |1> -> After X gate:', sv1.data.round(2))
Result |0>
print('Probabilities:', sv1.probabilities_dict())
{'0': 1.0}
print('\nProves: X * X = I (Pauli-X is self-inverse)')
Self-inverse
Click "Copy for Colab", open Google Colab, paste into a single cell, and run.
1 # ========================================================= 2 # Simulating the Quantum NOT (Pauli-X) Gate in Qiskit 3 # Prepared for Google Colab (Run with Shift + Enter) 4 # ========================================================= 5 6 # Step 1: Install required packages 7 !pip install qiskit 8 9 # Step 2: Import libraries 10 from qiskit import QuantumCircuit 11 from qiskit.quantum_info import Statevector 12 13 # Step 3: Run Demonstration 14 # 1. Apply X to |0> -> should yield |1> 15 qc0 = QuantumCircuit(1) 16 qc0.x(0) # Apply Pauli-X 17 sv0 = Statevector.from_instruction(qc0) 18 print('Input |0> -> After X gate:', sv0.data.round(2)) 19 print('Probabilities:', sv0.probabilities_dict()) 20 21 # 2. Apply X to |1> -> should yield |0> 22 qc1 = QuantumCircuit(1) 23 qc1.x(0) # Make |1> 24 qc1.x(0) # Apply X again 25 sv1 = Statevector.from_instruction(qc1) 26 print('\nInput |1> -> After X gate:', sv1.data.round(2)) 27 print('Probabilities:', sv1.probabilities_dict()) 28 print('\nProves: X * X = I (Pauli-X is self-inverse)')
Verify that state |0> rotates 180 degrees around X-axis into state |1>.
Verify that applying X again restores state |0>.
Confirm that X^2 = Identity.
QuantumCircuit(1) with X and X^2 operations.
Input |0> -> After X: [0.0, 1.0] -> P(1) = 100% Input |1> -> After X: [1.0, 0.0] -> P(0) = 100% X * X = I
The Pauli-X gate acts as the quantum equivalent of the classical NOT gate, rotating states by pi radians around the X-axis of the Bloch sphere.
Hadamard, CNOT, Bell-state intuition, and correlated quantum circuits.
Test your understanding with these questions. Remember, this is for learning, not examination!