Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔔 HelloBell

A quantum computing "hello world" — creating a Bell state with Qiskit.

Qiskit Python

HelloBell is the quantum analogue of printing "hello, world". It builds the simplest entangled state in quantum computing — the Bell state

$$|\Phi^+\rangle = \frac{|00\rangle + |11\rangle}{\sqrt{2}}$$

using a Hadamard gate followed by a CNOT gate, then verifies entanglement via:

  • Expectation values$\langle ZZ \rangle = 1$, $\langle XX \rangle = 1$, $\langle ZI \rangle = \langle IZ \rangle = 0$
  • Measurement sampling — a 50/50 split between $|00\rangle$ and $|11\rangle$

🚀 Getting Started

# Activate the virtual environment
source .venv/bin/activate

# Run the hello world
python hello_bell.py

Expected output:

Expectation values (ideal Bell state):
  ⟨ZZ⟩ = 1.0000   (should be  1.0000)
  ⟨ZI⟩ = 0.0000   (should be  0.0000)
  ⟨IZ⟩ = 0.0000   (should be  0.0000)
  ⟨XX⟩ = 1.0000   (should be  1.0000)

Measurement counts (1024 shots):
  |00⟩:  542  (52.9%)
  |11⟩:  482  (47.1%)

📁 Project Structure

HelloBell/
├── hello_bell.py      # Bell-state circuit + verification
├── .venv/             # Python virtual environment
├── .gitignore
└── README.md

🔬 What's Happening?

Gate Qubit 0 Qubit 1 Effect
H ─┤H├─ ───── Creates superposition: $
CX ─■─── ─┤X├─ CNOT flips q₁ when q₀ = $

The result is a maximally entangled two-qubit state — measuring one qubit instantly tells you the outcome of the other.

📦 Requirements

  • Python 3.12+
  • Qiskit 2.x (installed in .venv/)

📄 License

This project is for educational purposes. Feel free to use, share, and modify.

About

A quantum computing "hello world"

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages