First time studying this topic?

Launch the interactive walkthrough to discover each component, including the 3D Q-Sphere Lab & Python in Colab.

Topic 5.6

The Classical Bit: Shannon Entropy & Silicon Gates

Understand the classical foundation: Claude Shannon’s binary digit, Boolean logic gates, and physical CMOS transistor implementations.

Learning Objectives

  • ✓Define the classical bit as the fundamental atom of digital information
  • ✓Calculate Shannon Entropy: H(X) = -sum p(x) log2 p(x)
  • ✓Understand physical CMOS transistor implementation of 0 (0V) and 1 (3.3V/5V)

📖Let's Begin with a Story

In 1948, a 32-year-old mathematician at Bell Labs named Claude Shannon published a 55-page paper titled "A Mathematical Theory of Communication." Before Shannon, people thought of communication in terms of copper telegraph wires, sound waves, or radio frequencies. Shannon did something revolutionary: he proved that all information—whether a symphony by Beethoven, a telephone call, or a photograph—can be digitized into a universal currency. Shannon coined the word bit (short for "binary digit"). For 75 years, the bit has been the foundation of the modern technological world.

Why Should You Learn The Classical Bit: Shannon Entropy & Silicon Gates?

🎯 Practical & Engineering Stakes

The baseline of all computing

You cannot understand the quantum leap of the qubit until you deeply understand the mathematical and physical limits of the classical bit.

🎮 Fun Learning Zone

Grasp complex quantum concepts visually with zero prior physics or math knowledge!

Zero Prerequisites
Visual Concept Storyboard

The Mechanical Toggle Switch & The Heat of Forgetting

Railroad Track Switch & Eraser
🚂 💨 🧽

Irreversible Erasure (+Heat!)

Landauer's limit: wiping a bit dumps heat (k_B T ln 2) into the room.

Quantum Unitary Reversible Rotation
🔄 💎 ❄️

Zero Heat Dissipation (U†U = I)

Quantum gates never delete data; every operation can be run backwards!

Classical: Serial / ConstrainedQuantum: Coherent Wave Parallelism
Visual takeaway: Understand in 5 seconds

Everyday Analogy: The Mechanical Toggle Switch & The Heat of Forgetting

Think of a classical bit as a sturdy railroad track switch: the lever is either clicked all the way to the Left (0) or locked all the way to the Right (1). Inside your smartphone, billions of tiny microscopic switches (MOSFET transistors) hold electrical charges. But here is the catch: when an AND gate takes two inputs (say, 0 and 1) and outputs a single 0, what happened to the second input? It was erased! In 1961, physicist Rolf Landauer proved that erasing information has a mandatory physical cost: every erased bit expels a tiny puff of heat into the environment!
🧪

Interactive Mental Sandbox

Try It Yourself
Landauer Eraser & Thermodynamic Limit

Compare classical data erasure vs quantum reversible rotation.

Current Bit: [1]

Click "Erase Bit" or "Reversible Quantum Gate" to test Landauer's heat principle.

📖 The Thought Experiment Prompt:“Try writing a number on a chalkboard and then wiping it clean with an eraser. Your arm does work, and friction warms up the board. Classical computers wipe billions of bits every microsecond, generating so much heat that data centers require massive industrial cooling towers. In contrast, quantum computing gates are reversible rotations: they NEVER erase information, conserving energy and preserving quantum coherence!”

✨ The "Aha!" Moment

A classical bit is an irreversible binary voltage level (00 or 11) bounded by Landauer’s thermodynamic limit (kBTln⁡2k_B T \ln 2). Quantum computation avoids erasure by using reversible unitary transformations!

What Is It?

Simple Explanation

A classical bit is an absolute switch. It is either completely OFF (0) or completely ON (1). There is no middle ground, no maybe, no blurriness. Every smartphone app, video game, and website on Earth is made of billions of these tiny 0-and-1 switches flipping billions of times per second.

Technical Explanation

A classical bit is an element of the Galois field F2={0,1}\mathbb{F}_2 = \{0, 1\}. In statistical thermodynamics and information theory, the information content of a discrete random variable XX is measured by Shannon Entropy: H(X)=−∑x∈XP(x)log⁡2P(x)H(X) = -\sum_{x \in \mathcal{X}} P(x) \log_2 P(x) bits. In physical hardware, a bit is stored as a voltage level in a Complementary Metal-Oxide-Semiconductor (CMOS) transistor circuit.

📚 Key Terms

Bit (Binary Digit)

Simple: The smallest unit of digital information, holding a value of either 0 or 1.
Technical: A fundamental unit of classical information taking binary values in {0,1}\{0, 1\}.

Shannon Entropy

Simple: A formula that measures how much surprise or information is contained in a message.
Technical: The expected value of information content: H(X)=−∑P(x)log⁡2P(x)H(X) = -\sum P(x) \log_2 P(x).

CMOS Transistor

Simple: The tiny microscopic electrical switch inside computer chips.
Technical: Field-effect transistor technology using complementary pairs of p-type and n-type MOSFETs for high noise immunity and low static power consumption.

Q-Sphere Lab: The Classical Bit: Shannon Entropy & Silicon Gates

IBM Q-Sphere Model

Interactive 3D state vector exploration, unitary transformation gates, and Born rule collapse for Topic 5.6

Azimuth: 45°Elevation: 25°
+Z |0⟩-Z |1⟩+X |+⟩+Y |+i⟩01|ψ⟩
Q-Sphere Phase Color:
0 π/2 π 3π/2

Quantum Statevector

dim(H) = 2
|ψ⟩ = (1.000 + 0.000i)|0⟩
     + (0.000 + 0.000i)|1⟩
Polar Angle (θ):0.0° (0.000π rad)
Phase Angle (ϕ):0.0° (0.000π rad)

Born Rule Probabilities: P(x) = |⟨x|ψ⟩|²Σ P = 1.00

P(|0⟩) = |α|²100.0%
P(|1⟩) = |β|²0.0%
Quantum Measurement

Apply Single-Qubit Unitary Gates

Presets:
Continuous Polar Angle θ (0° = |0⟩, 180° = |1⟩):0.0°
Continuous Phase Angle ϕ (0° to 360°):0.0°
Recent Operations Log:
#1Initial state: |0⟩

📐 Mathematical Foundation

LaTeX KaTeX
H(X)=−∑i=1nP(xi)log⁡2P(xi)H(X) = -\sum_{i=1}^n P(x_i) \log_2 P(x_i)

What does it mean?

Shannon Entropy: Measures the fundamental limit of uncertainty or information content (in bits) delivered by a random binary variable. If an outcome is completely predictable, entropy is 0; if it is completely balanced, entropy reaches maximum (1.0 bit).

Understanding the Symbols

Symbol / TermMeaningBeginner Interpretation
H(X)H(X)Shannon Entropy (measured in bits)Average surprise or information content generated by the bit
P(xi)P(x_i)Probability of bit outcome iLikelihood of receiving 0 or 1
log⁡2P(xi)\log_2 P(x_i)Logarithm base 2 of probabilityNumber of binary yes/no questions needed to identify the outcome
−∑-\sumNegative sumTurns negative logarithms into a positive measure of information

📊 Numerical Example

Comparing the entropy of deterministic, fair, and biased bits:

Case 1: Deterministic Bit (P(0) = 1.0, P(1) = 0): H = -(1.0 × log2(1.0)) = -(1.0 × 0) = 0.0 bits (Zero surprise!) Case 2: Fair Random Bit (P(0) = 0.5, P(1) = 0.5): H = -[0.5 × log2(0.5) + 0.5 × log2(0.5)] = -[0.5(-1) + 0.5(-1)] = 1.0 bit (Maximum information!) Case 3: Biased Bit (P(0) = 0.8, P(1) = 0.2): H = -[0.8 × log2(0.8) + 0.2 × log2(0.2)] = -[0.8(-0.322) + 0.2(-2.322)] ≈ 0.72 bits

Result: A fair classical bit delivers exactly 1.0 bit of Shannon information; any predictability reduces its informational value.

⚙️ How Does It Work?

1

Voltage Encoding

0V to 0.8V represents Low (0); 2.0V to 3.3V represents High (1).

2

Logic Processing

NAND gates combine binary voltages to implement universal Boolean logic.

3

Storage

Capacitor charges in DRAM or magnetic polarities on hard disk platters retain bit values.

🌍 Where Is It Used?

Digital Telecommunications

Problem: Compressing text and video files to transmit across fiber optic cables without loss.

Solution: Huffman and Shannon-Fano coding compress files down to their theoretical Shannon entropy limit.

🎯 Try It Yourself

A biased coin lands on Heads 100% of the time (P = 1.0) and Tails 0% of the time (P = 0.0). How much Shannon information (entropy) is produced by flipping this coin?

Interactive activity component

🐍 Python Hands-On: Comparing Classical Bits and Quantum Qubits in Qiskit

Simulate bit flips and phase flips on single qubits using Qiskit, highlighting the difference between Boolean bits and quantum states.

Open Colab

1Install Required Packages

For Google Colab or Jupyter notebooks, run this shell command to install the required dependencies:

Terminal / Notebook Install Commandbash
!pip install qiskit numpy
Packages:
qiskitnumpy

2Import Libraries

Import Statementspython
1from qiskit import QuantumCircuit
2from qiskit.quantum_info import Statevector

from qiskit import QuantumCircuit → Circuit module

from qiskit.quantum_info import Statevector → Statevector module

3Demonstration Code & Logic

Python Execution Codepython
1# Classical bit can only be 0 or 1. A Qubit has phase and superposition.
2qc = QuantumCircuit(1)
3print('Initial state |0>:', Statevector.from_instruction(qc).data.round(2))
4
5# Bit Flip (Pauli-X)
6qc.x(0)
7print('After Bit Flip X(|0>):', Statevector.from_instruction(qc).data.round(2))
8
9# Superposition (Hadamard)
10qc.h(0)
11print('After Superposition H(|1>):', Statevector.from_instruction(qc).data.round(4))
12
13# Phase Flip (Pauli-Z) has NO classical analog
14qc.z(0)
15print('After Phase Flip Z(|->):', Statevector.from_instruction(qc).data.round(4))
16print('\nNotice: Classical bits have only values; qubits have both values and quantum phases!')
Step-by-Step Code Breakdown:

# Classical bit can only be 0 or 1. A Qubit has phase and superposition.

Introduction

qc = QuantumCircuit(1)

Initialize qubit in |0>

print('Initial state |0>:', Statevector.from_instruction(qc).data.round(2))

Initial state

# Bit Flip (Pauli-X)

Bit-flip

qc.x(0)

Flip |0> to |1>

print('After Bit Flip X(|0>):', Statevector.from_instruction(qc).data.round(2))

Result |1>

# Superposition (Hadamard)

Superposition

qc.h(0)

Apply H: transforms |1> into |->

print('After Superposition H(|1>):', Statevector.from_instruction(qc).data.round(4))

State |-> = [0.7071, -0.7071]

# Phase Flip (Pauli-Z) has NO classical analog

Phase-flip

qc.z(0)

Apply Z: flips phase of |-> to |+>

print('After Phase Flip Z(|->):', Statevector.from_instruction(qc).data.round(4))

State |+> = [0.7071, 0.7071]

print('\nNotice: Classical bits have only values; qubits have both values and quantum phases!')

Summary

📋 Complete Script (All-in-One)

Click "Copy for Colab", open Google Colab, paste into a single cell, and run.

Google Colab Notebook Scriptpython
1# =========================================================
2# Comparing Classical Bits and Quantum Qubits in Qiskit
3# Prepared for Google Colab (Run with Shift + Enter)
4# =========================================================
5
6# Step 1: Install required packages
7!pip install qiskit numpy
8
9# Step 2: Import libraries
10from qiskit import QuantumCircuit
11from qiskit.quantum_info import Statevector
12
13# Step 3: Run Demonstration
14# Classical bit can only be 0 or 1. A Qubit has phase and superposition.
15qc = QuantumCircuit(1)
16print('Initial state |0>:', Statevector.from_instruction(qc).data.round(2))
17
18# Bit Flip (Pauli-X)
19qc.x(0)
20print('After Bit Flip X(|0>):', Statevector.from_instruction(qc).data.round(2))
21
22# Superposition (Hadamard)
23qc.h(0)
24print('After Superposition H(|1>):', Statevector.from_instruction(qc).data.round(4))
25
26# Phase Flip (Pauli-Z) has NO classical analog
27qc.z(0)
28print('After Phase Flip Z(|->):', Statevector.from_instruction(qc).data.round(4))
29print('\nNotice: Classical bits have only values; qubits have both values and quantum phases!')
⚡ How to Run in Google Colab (3 Quick Steps)
  1. Click "Copy for Google Colab" above.
  2. Click Open New Google Colab Notebook (opens in a new tab).
  3. Click on the first empty code cell, press Ctrl + V (or Cmd + V) to paste, then press Shift + Enter to execute!

🔄 Algorithmic Execution Flow

1
Bit Flip Demo

Apply Pauli-X gate to invert computational basis state.

→
2
Superposition Demo

Apply Hadamard gate to create equal amplitude combination.

→
3
Phase Flip Demo

Apply Pauli-Z gate demonstrating quantum phase modulation which does not exist classically.

📥 Input / Initial State
QuantumCircuit(1) with X, H, and Z operations.
📤 Expected Output
Initial state: [1.0, 0.0]
After Bit Flip: [0.0, 1.0]
After Superposition: [0.7071, -0.7071]
After Phase Flip: [0.7071, 0.7071]
💡 What Does This Demonstration Show?

A classical bit is restricted to discrete states 0 or 1. A qubit possesses a continuous phase degree of freedom that enables constructive and destructive wave interference.

Course Learning Resource • Slide Deck19 Slides

Comprehensive Foundation in Quantum Computing

From Probability and Complex Numbers to Qubits, Interference, Entanglement, and Multi-Qubit Systems by Dr. Syed Muzamil Basha.

Author: Dr. Syed Muzamil Basha• FDP Approved Curriculum
Open in New Tab
Available Slide Decks:

📝 Learning Check

Test your understanding with these questions. Remember, this is for learning, not examination!

Question 1: What is the maximum Shannon entropy that a single classical binary bit can store?

Question 2: What is Shannon entropy for a fair coin (50% heads, 50% tails)?

Question 3: How many distinct states can n classical bits represent simultaneously?

Question 4: What is the minimum voltage swing required to reliably represent 0 and 1 in modern CMOS logic?

Question 5: Who developed the mathematical theory of information in 1948, defining the bit as the fundamental unit?