Skip to content

arunpandianj/Qiskit_Superposition_Entanglement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Superposition and Entanglement with Qiskit

This repository contains a Jupyter Notebook demonstrating quantum superposition and entanglement using Qiskit, a Python framework for quantum computing. The notebook provides hands-on examples to help students understand fundamental quantum computing concepts.


πŸ“ Repository Contents

  • Qiskit_Superposition_Entanglement.ipynb – Main notebook demonstrating:
    1. Superposition of a single qubit.
    2. Entanglement (Bell state) of two qubits.

πŸ’» About the Notebook

The notebook is divided into three main parts:

1. Installation

Installs the required packages:

!pip install qiskit
!pip install qiskit-aer

2. Imports

Imports the necessary modules from Qiskit and visualization tools:

from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram, plot_bloch_multivector
from qiskit.quantum_info import Statevector
import matplotlib.pyplot as plt

3. Superposition Example

  • Creates a single qubit circuit.
  • Applies a Hadamard (H) gate to place the qubit in superposition.
  • Measures the qubit and plots the histogram of outcomes.
  • Visualizes the state on the Bloch sphere.

4. Entanglement Example

  • Creates a 2-qubit circuit.
  • Applies H to the first qubit, then CNOT to entangle both qubits.
  • Measures both qubits and plots the histogram.
  • Shows the statevector of the entangled qubits.

πŸŽ“ Student Tasks

After exploring the notebook, students can try these small tasks:

Task 1: Superposition

  • Create a single qubit circuit.
  • Apply a Hadamard gate.
  • Measure and plot the histogram.
  • Observe equal probabilities for 0 and 1.

Task 2: Entanglement

  • Create a 2-qubit circuit.
  • Apply H to qubit 0, then CNOT (0β†’1).
  • Measure and plot the histogram.
  • Observe correlated outcomes (00 or 11).

πŸ“Š Visualizations

The notebook includes visualizations for:

  • Bloch sphere – Shows the qubit state for superposition.
  • Histogram – Shows measurement probabilities for superposition and entangled states.

πŸ“ How to Run

  1. Clone the repository:
git clone <repository-url>
  1. Open the notebook Qiskit_Superposition_Entanglement.ipynb in Jupyter Notebook, JupyterLab, or VS Code.
  2. Run the cells step by step to explore superposition, entanglement, and perform student tasks.

About

Demonstrates quantum superposition and entanglement using Qiskit with hands-on examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published