Loading image

Blogs / Programming

Quantum Informatics Explained: Qubits, Measurement, and BB84

Quantum Informatics Explained: Qubits, Measurement, and BB84

  • showkat ali
  • 4 min read
  • 0 Comments
  • 30 View

Quantum Informatics Explained: Qubits, Measurement, and BB84

Introduction

Quantum informatics is a modern field that combines quantum physics with information theory. It forms the foundation of:

  • Quantum Computing

  • Quantum Cryptography

  • Quantum Communication

Unlike classical computers that use bits (0 or 1), quantum systems use qubits, which behave very differently.

In this blog, we will explain:

  • What is a qubit?

  • What is superposition?

  • How quantum measurement works

  • What is the Bloch sphere?

  • What is the No-Cloning Theorem?

  • How BB84 quantum key distribution works

  • Simple Qiskit code examples


1. From Classical to Quantum Information

Classical Bit

A classical bit can be:

0 OR 1

Example:

  • Light OFF → 0

  • Light ON → 1

Very simple.


Quantum Bit (Qubit)

A qubit can be:

0
1
OR both at the same time (superposition)

Mathematically

ψ=α0+β1|\psi\rangle = \alpha |0\rangle + \beta |1\rangle

Where:

  • α and β are complex numbers (called amplitudes)

  • α2+β2=1|\alpha|^2 + |\beta|^2 = 1

This condition is called normalization.


2. Superposition (The Core Idea)

Superposition means a qubit can exist in both states at the same time.

Example:

ψ=120+121|\psi\rangle = \frac{1}{\sqrt{2}} |0\rangle + \frac{1}{\sqrt{2}} |1\rangle

Now:

P(0)=(12)2=1/2

P(0) = \left(\frac{1}{\sqrt{2}}\right)^2 = 1/2P(1)=1/2

So we get:

  • 50% chance → 0

  • 50% chance → 1

Important:

👉 Probability = square of amplitude


3. How Quantum Measurement Works

Measurement is very special in quantum mechanics.

When we measure:

  • We choose a basis (Z or X)

  • The state collapses

  • We get only one result

If:

ψ=α0+β1|\psi\rangle = \alpha |0\rangle + \beta |1\rangle

Then:

P(0)=α2P(0) = |\alpha|^2
P(1)=β2P(1) = |\beta|^2

After measurement:

  • If result is 0 → state becomes |0⟩

  • If result is 1 → state becomes |1⟩

Superposition disappears.


4. Measurement Depends on Basis

Two common bases:

Z-Basis (Computational Basis)

0,1|0\rangle, |1\rangle

X-Basis

+=12(0+1)|+\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)
=12(01)|-\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)

Changing basis changes probability.

This is very important in BB84.


5. Bloch Sphere (Visualizing a Qubit)

A qubit can be written as:

ψ=cos(θ/2)0+eiϕsin(θ/2)1|\psi\rangle = \cos(\theta/2)|0\rangle + e^{i\phi}\sin(\theta/2)|1\rangle

This represents a point on a sphere called the Bloch Sphere.

Important:

  • Every pure qubit = point on sphere surface

  • Measurement = projection onto axis

  • Probability depends on angle


6. Unitary Operations

Quantum operations must satisfy:

UU=IU^\dagger U = I

This means:

  • Operations are reversible

  • No information is destroyed

Example: Pauli matrices

σx=(0110)\sigma_x = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}

This flips:

|0⟩ → |1⟩
|1⟩ → |0⟩


7. Two Qubits

Two qubits have 4 basis states:

|00⟩
|01⟩
|10⟩
|11⟩

General state:

ψ=a00+b01+c10+d11|\psi\rangle = a|00\rangle + b|01\rangle + c|10\rangle + d|11\rangle

Quantum system grows exponentially.

That is why quantum computing is powerful.


8. No-Cloning Theorem

Very important concept.

It says:

❌ You cannot copy an unknown quantum state.

Why?

Because copying would require:

Uψ0=ψψU |\psi\rangle |0\rangle = |\psi\rangle |\psi\rangle

But this cannot work for all states.

This is why quantum cryptography is secure.


9. One-Time Pad (Classical Perfect Encryption)

If:

Length(key) = Length(message)

Encryption:

Cipher = Plaintext ⊕ Key

Example:

Plaintext:  0100
Key:        1100
Cipher:     1000

Decrypt:

Cipher ⊕ Key = Plaintext

If the key is random and never reused:

👉 It is unbreakable.

Problem: How to share key securely?

Answer: Quantum Key Distribution.


10. BB84 Quantum Key Distribution

Developed in 1984 by:

  • Charles Bennett

  • Gilles Brassard

Main Idea:

Use quantum physics to share the secret key securely.


BB84 Steps

Step 1: Alice

  • Chooses random bits

  • Chooses random basis (Z or X)

  • Sends qubits

Step 2: Bob

  • Chooses random basis

  • Measures qubits

Step 3: Public Discussion

They compare only bases (not values).

They keep only matching basis bits.


Eavesdropping Detection

If Eve tries to measure:

  • She chooses wrong basis half of time

  • Introduces errors

  • Maximum error ≈ 25%

If error rate too high → abort communication.

Security comes from:

  • Measurement disturbs state

  • No cloning theorem


11. Simple Qiskit Code Example

Create superposition and measure:

from qiskit import QuantumCircuit, Aer, execute

qc = QuantumCircuit(1, 1)

qc.h(0)          # Create superposition
qc.measure(0, 0)

simulator = Aer.get_backend('qasm_simulator')
result = execute(qc, simulator, shots=1000).result()
counts = result.get_counts()

print(counts)

Output will be close to:

{'0': 500, '1': 500}

This shows 50%-50% probability.


12. Why Quantum Cryptography Is Important

Future quantum computers may break:

  • RSA

  • Diffie-Hellman

This is called:

"Harvest now, decrypt later."

But BB84 provides:

✔ Physically guaranteed security
✔ Eavesdropping detection
✔ Secure key generation


Final Summary

Quantum informatics introduces a new way to process information using:

  • Superposition

  • Measurement

  • Unitary operations

  • No-cloning principle

Qubits are fundamentally different from classical bits.

Quantum key distribution (BB84) uses these properties to create secure communication based on physics, not mathematical hardness.

Quantum technology is the foundation of:

  • Quantum computing

  • Quantum cryptography

  • Future secure communication systems

  • Programming
showkat ali Author

showkat ali

Greetings, I'm a passionate full-stack developer and entrepreneur. I specialize in PHP, Laravel, React.js, Node.js, JavaScript, and Python. I own interviewsolutionshub.com, where I share tech tutorials, tips, and interview questions. I'm a firm believer in hard work and consistency. Welcome to interviewsolutionshub.com, your source for tech insights and career guidance.

0 Comments

Post Comment