Skip to content

1012ayush/EKert91

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ekert91 (E91) Quantum Key Distribution Simulator

An interactive, single-page pedagogical instrument designed to simulate, visualize, and verify the Ekert91 (E91) Quantum Key Distribution (QKD) protocol. This simulator models the deep relationship between quantum non-locality (via CHSH inequality violations) and cryptographic security bounds.


🚀 Quick Start

This project is entirely self-contained within a single index.html file with no external compile steps or heavy NPM dependencies. You can spin it up locally using any standard static file server.

Prerequisites

Make sure you have Python (or Node.js) installed on your system.

Running the Simulator

  1. Clone or download this repository to your local machine:
    git clone https://github.com/your-username/E-91-Simulator.git
    cd E-91-Simulator
  2. Fire up the local web server using Python's built-in module:
    python -m http.server 8000
  3. Open your preferred web browser and navigate to the application:
    http://localhost:8000
    

📊 Core Architecture & Physics Engine

The core simulation engine mathematically models a centralized source emitting maximally entangled Einstein-Pedolsky-Rosen (EPR) photon pairs in the symmetric Bell state:

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

1. State Space Angle Conversion

To bridge real-world laboratory setups with quantum mechanical probability matrices, physical polarizer display angles ($\phi$) are scaled down to state-space orientation vectors ($\theta$) using $\theta = \frac{\phi}{2}$:

  • Alice's Set ($\theta_A$): $0, \frac{\pi}{8}, \frac{\pi}{4}$ (corresponding to display angles $0^\circ, 45^\circ, 90^\circ$)
  • Bob's Set ($\theta_B$): $\frac{\pi}{8}, \frac{\pi}{4}, \frac{3\pi}{8}$ (corresponding to display angles $45^\circ, 90^\circ, 135^\circ$)

2. Quantum Correlation & CHSH Verification

For mismatched testing bases, individual correlation coefficients $E(\phi_A, \phi_B)$ are determined empirically from the trials ledger using the true quantum expectation fraction:

$$E(\phi_A, \phi_B) = \frac{\text{Matches (+1)} - \text{Mismatches (-1)}}{\text{Total Trials in Group}}$$

The aggregate CHSH inequality index $S$ is computed using four specific non-parallel basis combinations:

$$S = E(a_1, b_1) - E(a_1, b_3) + E(a_3, b_1) + E(a_3, b_3)$$


🛠️ Operational Scenarios

The simulator accurately maps out the operational divergence between a secure quantum channel and one under a malicious intercept-resend attack:

Metric Parameter Authentic Channel (Eve Inactive) Intercept-Resend Attack (Eve Active)
Quantum Waveform Coherent, stable green sinusoids Collapsed, fragmented red indicators
CHSH Index ($S$) $S \to 2\sqrt{2} \approx 2.828$ (Violates Local Realism) $S \le 2.0 \approx 1.414$ (Collapses to Classical Limits)
Key Agreement Status Secure channel verified; keys match perfectly Protocol aborted; data stream compromised
Key Basis QBER 0.00% $\approx 25.00%$ (Superposition destroyed)

🛠️ Interface Components

  • Control Console: Fine-tune experimental parameters including total photon pair volume ($N \in [10, 200]$), execution intervals, and toggle switches for live eavesdropping interception.
  • Quantum Channel Visualizer: An interactive HTML5 Canvas that renders real-time wave functions, polarization indicators on flying photons, and dynamic polarizer dial rotations.
  • Telemetry Panel: Instantly audits statistical variables including the Quantum Bit Error Rate (QBER), live tracking of the $S$-parameter, and channel safety ratings.
  • Protocol Ledger: A reverse-chronological streaming row component displaying basis assignments, raw outputs, allocation pathways (Key Gen vs. CHSH Test), and sifting status flags.

🎓 Faculty Auditing & Pedagogical Notes

This dashboard acts as an omniscient administrative HUD. In a real physical deployment, Alice's and Bob's local registers are isolated to preserve confidentiality. This view intentionally links them side-by-side on one screen to allow faculty inspectors to easily audit the software's structural integrity, the performance of the sifting loops, and the convergence of statistical variance under the Law of Large Numbers.

About

An interactive, high-fidelity Ekert91 (E91) Quantum Key Distribution (QKD) simulator engineered to model, visualize, and verify quantum non-locality, real-time cryptographic key sifting, and intercept-resend eavesdropping attacks via empirical CHSH inequality testing.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors