Introduction to Quantum Computing: Qubits, Hadamard Gates, and Superposition

QUANTUM SERIES 2026
Qubits, the Hadamard gate, superposition, tensor products, and quantum interference from first principles.

Classical computers store information in bits that are always exactly 0 or 1. Quantum computers exploit the principles of quantum mechanics to do something fundamentally different: they operate on qubits, which can exist in a superposition of both states simultaneously. The Hadamard gate is the simplest gate that creates this superposition, and understanding it from first principles is the entry point to every quantum algorithm that follows.


1  ·  The Qubit

A qubit is the fundamental unit of quantum information. Unlike a classical bit, a qubit can exist in a superposition of |0⟩ and |1⟩ simultaneously. We write its general state using Dirac (bra-ket) notation:

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

Here α and β are complex numbers called probability amplitudes. They must satisfy the normalisation condition:

|α|² + |β|² = 1

The two computational basis states are represented as column vectors:

|0⟩ = 1
0
|1⟩ = 0
1

When we measure the qubit in state |ψ⟩ = α|0⟩ + β|1⟩, we get |0⟩ with probability |α|² and |1⟩ with probability |β|². The act of measurement destroys the superposition and collapses the qubit to a definite classical state.

Key distinction: The superposition is not just ignorance about a hidden value. The qubit genuinely occupies both states until measured, and this physical reality is what quantum algorithms exploit.

2  ·  The Hadamard Gate

The Hadamard gate H is a 2×2 unitary matrix that maps each computational basis state to an equal superposition:

H  =  (1/√2)    +1   +1 
 +1   −1 

Applying H to each basis state:

InputH |input⟩Short name
|0⟩(1/√2)( |0⟩ + |1⟩ )|+⟩
|1⟩(1/√2)( |0⟩ |1⟩ )|−⟩

Both outputs have equal amplitudes of 1/√2, giving a 50% measurement probability for each outcome. The sign difference between |+⟩ and |−⟩ is what drives interference later.

Unitarity check: H†H = I. Since H is real and symmetric, H† = H, so H² = I. The Hadamard gate is its own inverse.

3  ·  H² = I: Quantum Interference

Applying H twice to |0⟩ returns the qubit to |0⟩. The algebra shows exactly why the |1⟩ amplitudes cancel through destructive interference:

H(H|0⟩)
  = H( (1/√2)(|0⟩ + |1⟩) )
  = (1/√2)( H|0⟩ + H|1⟩ )
  = (1/√2)( (1/√2)(|0⟩+|1⟩) + (1/√2)(|0⟩−|1⟩) )
  = (1/2)( |0⟩ + |1⟩ + |0⟩ − |1⟩ )
  = (1/2)( 2|0⟩ )
  = |0⟩ ✓
The +|1⟩ and −|1⟩ terms cancel completely (destructive interference) while the |0⟩ terms add (constructive interference). This is the fundamental mechanism behind quantum algorithms: arranging amplitudes so wrong answers cancel and the correct answer survives.

4  ·  Single-Qubit Circuit: H–H–Measure

A single qubit routed through two Hadamard gates and then measured always returns 0 with 100% probability:

q_0: H H M
StepStateNotes
1. Initialise|ψ₀⟩ = |0⟩Ground state
2. First H|ψ₁⟩ = (1/√2)(|0⟩+|1⟩)Superposition: 50/50
3. Second H|ψ₂⟩ = |0⟩Interference collapses back
4. MeasureResult = 0100% probability
This is a concrete demonstration that superposition is not just probabilistic noise. The deterministic outcome of 0 is only possible because the two Hadamard gates interact through interference, a purely quantum effect with no classical analogue.

5  ·  Tensor Products and Multi-Qubit States

Multi-qubit systems are described using the tensor product (⊗). For two qubits, the four computational basis states are:

KetTensor formColumn vector
|00⟩|0⟩ ⊗ |0⟩[1, 0, 0, 0]ᵀ
|01⟩|0⟩ ⊗ |1⟩[0, 1, 0, 0]ᵀ
|10⟩|1⟩ ⊗ |0⟩[0, 0, 1, 0]ᵀ
|11⟩|1⟩ ⊗ |1⟩[0, 0, 0, 1]ᵀ

The tensor product of two vectors is computed by multiplying each element of the first vector by the entire second vector and stacking the results. For |0⟩ ⊗ |1⟩:

|0⟩ ⊗ |1⟩
  = [1, 0]ᵀ ⊗ [0, 1]ᵀ
  = [ 1×[0,1]ᵀ ]  =  [0, 1, 0, 0]ᵀ  = |01⟩
    [ 0×[0,1]ᵀ ]
Dimension growth: n qubits span a 2ⁿ-dimensional Hilbert space. A 3-qubit system already has 8 basis states; a 50-qubit system has 2⁵⁰ ≈ 10¹⁵, impossible to store classically.

6  ·  Two-Qubit Superposition: H⊗H on |00⟩

Applying independent Hadamard gates to both qubits starting from |00⟩:

q_0: H
q_1: H
(H⊗H)|00⟩
  = (H|0⟩) ⊗ (H|0⟩)
  = (1/√2)(|0⟩+|1⟩) ⊗ (1/√2)(|0⟩+|1⟩)
  = (1/2)( |00⟩ + |01⟩ + |10⟩ + |11⟩ )
All four two-qubit basis states appear with equal amplitude 1/2. Each has measurement probability (1/2)² = 25%. This is the two-qubit analogue of the uniform superposition that opens algorithms like Grover’s.

7  ·  Interference in a Two-Qubit H–H Circuit

Applying H⊗H twice to |00⟩ returns it to |00⟩. The interference analysis on each basis state shows the mechanism:

Input to 2nd H⊗HAfter (H⊗H)
|00⟩(1/2)( |00⟩ + |01⟩ + |10⟩ + |11⟩ )
|01⟩(1/2)( |00⟩ − |01⟩ + |10⟩ − |11⟩ )
|10⟩(1/2)( |00⟩ + |01⟩ − |10⟩ − |11⟩ )
|11⟩(1/2)( |00⟩ − |01⟩ − |10⟩ + |11⟩ )

The initial superposition has equal weight 1/2 on each of the four states. Summing contributions to each output:

Output stateAmplitude sum (× 1/4)Result
|00⟩+1 +1 +1 +14/4 = 1 ✓ constructive
|01⟩+1 −1 +1 −10 destructive
|10⟩+1 +1 −1 −10 destructive
|11⟩+1 −1 −1 +10 destructive
Only |00⟩ survives. This is the same interference structure that the Grover diffusion operator exploits at scale: constructive interference on the target state, destructive on all others.

8  ·  The H⊗H Matrix and Why It Matters

The combined H⊗H operator is a 4×4 Walsh-Hadamard matrix (scaled by 1/2). Its sign pattern is exactly the two-qubit case of the popcount rule derived in the Walsh-Hadamard post:

H⊗H  =  (1/2)    +1   +1   +1   +1 
 +1   −1   +1   −1 
 +1   +1   −1   −1 
 +1   −1   −1   +1 

Every quantum algorithm that achieves a speedup over classical computation does so through the same three-phase structure:

PhaseOperationPurpose
1. OpenHadamard on all qubitsCreate uniform superposition over all 2ⁿ states
2. OperateOracle / phase manipulationMark or bias the amplitude of the target answer
3. CloseHadamard again (+ measurement)Interference concentrates probability on the answer
The bottom line: the qubit and the Hadamard gate are the entry point to everything. Grover’s O(√N) search, Shor’s O((log N)³) factoring, and every other quantum speedup ultimately trace back to this interference mechanism operating at scale.
About the author

Malcolm Low is an Associate Professor at the Singapore Institute of Technology, writing on quantum computing, programming, and applied computing from Singapore.

Website: malcolmlow.com  ·  Singapore


Quantum Series 2026  ·  Built with Qiskit 1.x

✦ This article was generated with the assistance of Claude by Anthropic

Euler’s Formula: Why e^(iφ) Is Just Shorthand for a Circle

QUANTUM SERIES 2026
Foundational pre-reading: why e is just shorthand for a circle.

This is the foundational pre-reading for the upcoming Quantum Mechanics series. Before wave functions, probability amplitudes, and the quirks of qubits, one piece of mathematics has to be demystified: Euler’s formula. Quantum physics literature leans on the expression e, the phase factor, on almost every page. Raising a constant to an imaginary exponent looks intimidating at first, but conceptually it is nothing more than elegant shorthand for drawing a circle.

New to the math? Read top to bottom. Comfortable with the complex plane already? Skip ahead to Section 4 to see why quantum mechanics relies on this shorthand.

1  ·  The geometry: mapping the complex plane

On a standard 2D graph, points are plotted against an x-axis and a y-axis. The complex plane keeps the layout but changes the meaning: the horizontal axis measures real numbers, and the vertical axis measures imaginary numbers, the multiples of i. Draw a unit circle, a circle of radius 1, and any point on it is fixed by a single angle φ measured counter-clockwise from the positive real axis. Basic trigonometry gives its two coordinates: the horizontal coordinate is cos φ and the vertical coordinate is sin φ. Placed in the complex plane, that point is the real part plus i times the imaginary part, which is exactly Euler’s formula:

e = cos φ + i sin φ
Re
Im
e
φ
cos φ
sin φ
1
Fig 1: a point e on the unit circle. Its horizontal coordinate is cos φ, its vertical coordinate is sin φ.

As φ increases from 0 to 2π, the point sweeps out a full circle around the origin. The right-hand side spells out the coordinates; the left-hand side, the exponential, is the shorthand for the same thing.

2  ·  The mechanics of i: the ultimate rotator

Why should a circle be written as an exponent? The answer starts by reframing the imaginary unit. Algebraically i is the square root of minus one. Geometrically, multiplying any number by i rotates it 90 degrees counter-clockwise in the complex plane. Start at 1, pointing right. One multiplication by i gives i, pointing straight up. Another gives −1, pointing left. Two more pass through −i and return to 1.

1  ×i  i  ×i  −1  ×i  −i  ×i  1
each ×i is a 90° counter-clockwise turn

Seen this way, i is not really a number at all. It is a rotational operator.

3  ·  The calculus: why the base e?

The base e earns its place through calculus: ex is the only function that is its own derivative, so its rate of change always equals its current value. Feeding the rotational operator i into the exponent and differentiating by the chain rule gives:

ddφ e = i e

That small equation carries a large physical statement. The velocity of the point, the direction it is moving, equals its current position multiplied by i, which means the velocity is always exactly 90 degrees away from the position vector.

90°
e
i·e
Fig 2: the velocity i·e is the position vector turned 90°, so it stays tangent to the circle. Perpetual perpendicular velocity is exactly circular motion.

In geometry and orbital mechanics alike, a velocity that stays perpendicular to the position vector is the signature of perfect circular motion. The exponential therefore encodes the act of tracing a circle, automatically.

4  ·  Why quantum mechanics needs this

Rather than writing out a vector built from a real cosine component and an imaginary sine component every time, physicists write the phase factor and move on. The shorthand packs the coordinates, the radius, and the continuous rotation into one compact exponent. The next articles in this series turn to quantum superposition, where relative phase decides whether amplitudes interfere constructively or destructively. Because that relative phase behaves exactly like an angle travelling around a circle, e is the natural tool for modelling it.


Quantum Series 2026  ·  Foundational pre-reading

✦ Drafted with Gemini by Google, formatted and illustrated with Claude by Anthropic ✦

Quantum Computing: CHSH Game Simulator and Bell’s Inequality

QUANTUM SERIES 2026
Exploring Quantum Entanglement: CHSH Game Simulator

Have you ever wondered how quantum mechanics defies everyday intuition? This project demonstrates one of the most striking phenomena in quantum physics: quantum entanglement and its ability to violate classical physics constraints through a playable cooperative game.

🎮 Try the CHSH Game Simulator  |  📂 View on GitHub


1 · What Is the CHSH Game in Quantum Computing?

The CHSH (Clauser-Horne-Shimony-Holt) game is a cooperative thought experiment that reveals the strange power of quantum entanglement. Two players, Alice and Bob, cannot communicate during the game but may share a pre-agreed strategy or, crucially, a pair of entangled qubits.

Player Receives from referee Outputs
Alice Random bit x Bit a
Bob Random bit y Bit b

They win if and only if:

(a + b) mod 2 = x × y
With classical strategies, Alice and Bob can win at most 75% of the time. With a quantum strategy using entangled qubits, they can reach approximately 85.4%, violating the classical bound.

2 · Bell’s Inequality and the CHSH Value

In 1964, John Bell proved that no local hidden variable theory can reproduce all predictions of quantum mechanics. The CHSH inequality formalises Bell’s theorem as a single testable number S:

Theory CHSH Value (S) Win Rate
Classical (any local strategy) S ≤ 2 75%
Quantum mechanics S = 2√2 ≈ 2.828 ~85.4%

This violation is not a loophole or a trick. It proves that the correlations produced by entangled qubits cannot be explained by any shared classical information, even with pre-agreed randomness. Loophole-free Bell test experiments confirm that quantum entanglement is a genuine physical phenomenon with no classical analogue.

3 · Measurement Angles and Quantum Correlation

The quantum advantage arises from choosing measurement bases at specific angles. For the standard |Φ+⟩ Bell state, the optimal angles are:

Player Input bit Measurement basis
Alice x = 0
Alice x = 1 45°
Bob y = 0 22.5°
Bob y = 1 −22.5°

The probability that Alice and Bob produce the same outcome is:

P(same) = cos²(δ)

where δ is the angle between their chosen measurement bases. This quantum correlation is what enables them to exceed the 75% classical ceiling. Different Bell states exhibit either parallel correlation (|Φ+⟩, |Ψ+⟩: qubits tend to give the same outcome) or orthogonal correlation (|Φ−⟩, |Ψ−⟩: one qubit effectively rotated 90° relative to the other). The simulator adjusts its probability calculations accordingly for each state.

🧪 4 · The Four Bell States

The simulator supports all four maximally entangled Bell states. Each uses optimised measurement angles to achieve the theoretical quantum win rate of ~85%.

State Definition Correlation
|Φ+⟩ (|00⟩ + |11⟩) / √2 Parallel
|Φ−⟩ (|00⟩ − |11⟩) / √2 Orthogonal
|Ψ+⟩ (|01⟩ + |10⟩) / √2 Parallel
|Ψ−⟩ (|01⟩ − |10⟩) / √2 Orthogonal

🎯 5 · CHSH Game Simulator Features

Feature Details
🎯 Interactive Visualization Real-time p5.js visualization showing the entangled state, Alice’s measurement collapse, and Bob’s final measurement. Coloured basis quadrants and correlation indicators included.
🎮 Strategy Comparison Switch between Classical (always outputs 0, max 75%) and Quantum (entangled qubits, ~85.4%) strategies in real time.
🎲 Flexible Input Controls Set Alice’s x and Bob’s y to Random or Fixed (0 or 1) to test specific measurement configurations.
📊 Real-Time Statistics Running totals for rounds played, wins, losses, and win percentage converging toward theoretical predictions.
🔄 Round History Navigation Step through previous rounds to review specific outcomes and trace the quantum measurement process.
Built with: React, p5.js, and Claude Code

6 · Try the Quantum Entanglement Simulator

A suggested sequence to build intuition:

  1. Open the simulator and select the Classical strategy. Run 100 rounds and watch the win rate converge toward 75%.
  2. Switch to the Quantum strategy with the |Φ+⟩ Bell state. Run another 100 rounds and observe the rate climb toward 85%.
  3. Try the other three Bell states. Note how each state’s correlation type (parallel vs orthogonal) affects the outcome distribution.
  4. Set Alice and Bob’s inputs to Fixed values to test individual measurement configurations and trace the correlation manually.
  5. Use Round History to step back through specific rounds and verify the win condition (a + b) mod 2 = x × y by hand.

7 · Open Source Code on GitHub

The complete source code is on GitHub. Contributions welcome: explore the code, report issues, suggest improvements, or fork it to build your own quantum visualisations.

Planned enhancements include a 3D Bloch sphere visualisation (Three.js), step-by-step animated transitions, an in-app educational tutorial, a mathematical deep-dive panel, and improved mobile layout.

The CHSH game demonstrates that quantum entanglement is not a mathematical abstraction but a measurable, observable phenomenon with no classical analogue. This simulator makes that phenomenon interactive and accessible to anyone curious about quantum mechanics.


QUANTUM SERIES 2026 · Quantum Entanglement and Bell Inequalities

✦ This article was generated with the assistance of Claude by Anthropic

About the author

Malcolm Low is an Associate Professor at the Singapore Institute of Technology, writing on quantum computing, programming, and applied computing from Singapore.

Website: malcolmlow.com  ·  Singapore

Playing with possibilities: Teaching quantum through chess

https://youtube.com/live/dMxnHwS23DA?si=oYc-f3v6f1-Ah1Nh

Google’s Quantum Chip Sparks Debate on Multiverse Theory

According to Google, Willow solved a computational problem in under five minutes — a task that would have taken the world’s fastest supercomputers approximately 10 septillion years.

https://thequantuminsider.com/2024/12/16/googles-quantum-chip-sparks-debate-on-multiverse-theory/

Amazon Unveils Its First Quantum Computing Chip

https://m.slashdot.org/story/439265

Debunking Hype: China Hasn’t Broken Military Encryption with Quantum

https://m.slashdot.org/story/434461

Chinese Scientists Report Using Quantum Computer To Hack Military-grade Encryption

https://m.slashdot.org/story/434243

As Quantum Computing Threats Loom, Microsoft Updates Its Core Crypto Library

https://m.slashdot.org/story/433019

Recommendation on a Coordinated Implementation Roadmap for the transition to Post-Quantum Cryptography | Shaping Europe’s digital future

https://digital-strategy.ec.europa.eu/en/library/recommendation-coordinated-implementation-roadmap-transition-post-quantum-cryptography