Skip to content

Slygriyrsk/quantum-communication-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌌 Quantum Communication Simulator

Quantum Communication Simulator Banner

📊 Interactive Visualization of Quantum Entanglement, Noise, and Purification

License: MIT Version PRs Welcome

A cutting-edge web-based simulator for quantum communication networks that visualizes quantum entanglement, noise effects, and purification protocols in real-time.


📋 Table of Contents


🔭 Overview

The Quantum Communication Simulator is an interactive web application designed to visualize and simulate quantum entanglement between multiple nodes in a quantum network. It provides real-time visualization of quantum phenomena including entanglement generation, noise effects, and purification protocols.

This simulator serves as both an educational tool for understanding quantum communication principles and a research platform for exploring quantum network topologies and error correction techniques.


✨ Features

🔬 Core Simulation Capabilities

  • Real-time Quantum Entanglement Visualization: Watch as quantum entanglement is established between nodes
  • Noise Simulation: Observe how environmental noise affects quantum states
  • Purification Protocols: Implement and visualize quantum purification to improve fidelity
  • Multiple Entanglement Types: Simulate Bell states, GHZ states, and W states
  • Various Error Models: Choose between depolarizing noise, amplitude damping, and phase damping

🖥️ Interactive User Interface

  • Dynamic Network Visualization: See quantum nodes and their entanglement connections
  • Quantum Circuit Diagram: View the quantum gates and operations in real-time
  • Fidelity Charts: Track the quality of entanglement over time
  • Detailed Results Analysis: Get comprehensive metrics on simulation performance

🛠️ Advanced Configuration Options

  • Adjustable Noise Levels: Fine-tune the amount of noise in the quantum channel
  • Simulation Speed Control: Run simulations at different speeds
  • Network Topology Selection: Choose from linear chains, star networks, rings, or fully connected meshes
  • Node Scaling: Simulate networks with 2 to 10 quantum nodes
  • Data Export: Save simulation results for further analysis

📸 Screenshots

Main Interface

Main Interface The main interface showing the quantum network visualization and control panel

Quantum Circuit View

Quantum Circuit Detailed quantum circuit visualization with gates and qubit states

Fidelity Chart

Fidelity Chart Real-time tracking of quantum fidelity throughout the simulation

Results Analysis

Results Analysis Comprehensive breakdown of simulation results and performance metrics


🚀 Installation

Prerequisites

  • Modern web browser (Chrome, Firefox, Safari, or Edge)
  • Local web server (optional for local development)

Quick Start

  1. Clone the repository:
    git clone https://github.com/Slygriyrsk/quantum-communication-simulator.git
    cd quantum-communication-simulator
  2. Open the project:
  • For static HTML only open:
`twonode.html` or `multinode.html` directly in your browser
  • For server functionality:

1. Create and activate a virtual environment:

# On Windows
python -m venv venv
venv\Scripts\activate

# On macOS/Linux
python -m venv venv
source venv/bin/activate

2. Install required packages:

pip install -r requirements.txt

3. Start the Flask server:

python server.py

3. Open your browser and navigate to: http://localhost:5000

4. Alternatively, visit the live demo at: https://Slygriyrsk.github.io/quantum-communication-simulator


📁 Project Structure

quantum-communication-simulator/
├── twonode.html            # Self-contained two-node simulator (includes CSS & JS)
├── multinode.html          # Multi-node simulator HTML
├── style.css               # Main stylesheet for multi-node simulator
├── script.js               # Main JavaScript for multi-node simulator
├── server.py               # Flask server for backend processing
├── requirements.txt        # Python dependencies
├── README.md               # Project documentation
├── LICENSE                 # MIT License
├── results/                # Screenshots and exported data
│   ├── banner.png
│   ├── main-interface.png
│   ├── quantum-circuit.png
│   ├── fidelity-chart.png
│   └── results-analysis.png
└── python/                    # Core simulation libraries
    ├── quantum-simulation.js
    ├── quantum-network.js
    ├── quantum-circuit.js
    ├── fidelity-chart.js
    └── results-display.js

Key Files

  • twonode.html: A standalone implementation of the quantum simulator focused on two-node entanglement. Contains all HTML, CSS, and JavaScript in a single file for easy deployment.

  • multinode.html: The main HTML file for the multi-node simulator, which supports advanced network topologies and more complex simulations.

  • script.js: Contains the core JavaScript implementation for the multi-node simulator, including:

  • Quantum state calculations

  • Simulation logic

  • Visualization rendering

  • User interface interactions

  • style.css: Contains all styling for the multi-node simulator interface.

  • server.py: A Flask-based server that provides:

  • API endpoints for more complex quantum simulations

  • Data persistence for saving simulation results

  • Backend processing for computationally intensive operations

Server Implementation

The Flask server (server.py) provides backend functionality:

from flask import Flask, request, jsonify, render_template, send_from_directory
import os
import time
import random
import json

app = Flask(__name__, static_folder='.')

# Serve static files

@app.route('/<path:path>')

def serve_static(path):
    return send_from_directory('.', path)

# Serve index.html
@app.route('/')

def index():
    return send_from_directory('.', 'multinode.html')

# API endpoint for quantum simulation
@app.route('/api/simulate', methods=['POST'])

def simulate():
    data = request.json

    # Process simulation request
    # ...
    return jsonify(results)

if __name__ == "__main__":
    app.run(debug=True, host='0.0.0.0', port=500

1. For local development with a server:

# If you have Python installed
python -m http.server
# Then open http://localhost:8000 in your browser

2. Or simply open index.html directly in your browser

3. Alternatively, visit the live demo at: https://Slygriyrsk.github.io/quantum-communication-simulator


📖 Usage Guide

Basic Simulation

1. Set Simulation Parameters:

  • Adjust the Noise Level slider to set environmental interference

  • Toggle Purification on/off to enable quantum state purification

  • Set Simulation Speed to control how fast the simulation runs

2. Start the Simulation:

  • Click the Start Simulation button to begin

  • Use Pause to temporarily halt the simulation

  • Use Reset to clear results and start over

3. View Results:

  • Switch between tabs to view the Quantum Circuit, Fidelity Chart, or Results

  • Examine how different parameters affect entanglement success

Advanced Configuration

1. Entanglement Types:

  • Bell State: The simplest form of quantum entanglement between two qubits

  • GHZ State: Greenberger-Horne-Zeilinger state for multi-particle entanglement

  • W State: Another type of multi-particle entanglement with different properties

2. Error Models:

  • Depolarizing: Random errors that can flip bits or phases

  • Amplitude Damping: Models energy dissipation in quantum systems

  • Phase Damping: Models loss of quantum information without energy loss

3. Network Topology:

  • Linear Chain: Nodes connected in sequence (A-B-C-D)

  • Star Network: Central node connected to all others

  • Ring Network: Nodes in a circular arrangement

  • Fully Connected Mesh: Every node connected to every other node

4. Visualization Options:

  • Standard View: Basic circuit representation

  • Detailed View: Shows quantum states at each step

  • Bloch Sphere: Represents qubit states on the Bloch sphere


🧪 Scientific Background

Quantum Entanglement

Quantum entanglement is a physical phenomenon that occurs when pairs or groups of particles interact in ways such that the quantum state of each particle cannot be described independently of the others. Instead, a quantum state must be described for the system as a whole.

In quantum communication, entanglement serves as a resource that enables protocols such as quantum teleportation and quantum key distribution.

Noise in Quantum Systems

Quantum systems are extremely sensitive to environmental interactions, which introduce noise and errors. This simulator models several types of noise:

  • Depolarizing Noise: Randomly replaces the quantum state with a completely mixed state

  • Amplitude Damping: Models energy dissipation (e.g., spontaneous emission)

  • Phase Damping: Represents loss of quantum information without energy exchange

Purification Protocols

Quantum purification protocols are methods to improve the fidelity of entangled states by using multiple lower-fidelity entangled pairs to distill fewer pairs with higher fidelity. This is crucial for long-distance quantum communication where noise accumulates over distance.

Fidelity Measurement

Fidelity is a measure of how close two quantum states are to each other. In our simulator, it represents how well the actual entangled state matches the ideal target state. A fidelity of 1.0 represents a perfect match, while lower values indicate degradation due to noise.


💻 Implementation Details

Architecture

The simulator is built using a modular architecture with the following components:

1. Simulation Core: Handles the quantum mechanical calculations and state evolution

2. Visualization Layer: Renders the quantum network, circuit diagrams, and charts

3. User Interface: Provides controls and displays for user interaction

Technologies Used

  • Frontend: HTML5, CSS3, JavaScript (ES6+)

  • Visualization: Canvas API for dynamic rendering

  • Mathematics: Custom implementation of quantum operations and linear algebra

Key Classes

  • QuantumSimulation: Core simulation logic and state management

  • QuantumNetworkVisualizer: Renders the quantum network visualization

  • QuantumCircuitVisualizer: Renders the quantum circuit diagram

  • FidelityChartVisualizer: Creates and updates the fidelity charts

  • ResultsVisualizer: Formats and displays simulation results

Performance Optimizations

  • Canvas-based rendering for efficient animations

  • Optimized matrix operations for quantum calculations

  • Throttled updates to maintain smooth performance even with complex simulations


🚀 Future Enhancements

Planned Features

1. Quantum Error Correction:

  • Implementation of various QEC codes (e.g., Surface codes, Shor code)

  • Visualization of error detection and correction

2. Advanced Network Topologies:

  • Custom network design interface

  • Simulation of quantum repeaters

  • Hierarchical quantum networks

3. Realistic Noise Models:

  • Channel-specific noise characteristics

  • Time-dependent noise evolution

  • Hardware-inspired noise profiles

4. Quantum Algorithms:

  • Integration of quantum communication protocols (QKD, teleportation)

  • Demonstration of quantum advantage in communication tasks

5. 3D Visualization:

  • Three-dimensional network topology visualization

  • Interactive 3D Bloch sphere representation

6. Machine Learning Integration:

  • ML-based optimization of purification strategies

  • Predictive modeling of entanglement success

7. Collaborative Features:

  • Multi-user simulations

  • Shared workspaces for research teams


🔬 Research Applications

This simulator has potential applications in several quantum research areas:

Quantum Network Design

  • Evaluate different network topologies for quantum communication

  • Optimize node placement and connection strategies

  • Test scalability of quantum networks

Error Mitigation Strategies

  • Compare effectiveness of different purification protocols

  • Develop new approaches to quantum error correction

  • Analyze the impact of various noise models

Educational Tool

  • Demonstrate quantum entanglement concepts visually

  • Provide hands-on experience with quantum communication principles

  • Support classroom teaching of quantum information science

Protocol Development

  • Test new quantum communication protocols

  • Benchmark performance under realistic noise conditions

  • Validate theoretical predictions in simulated environments


👥 Contributing

Contributions to the Quantum Communication Simulator are welcome! Here's how you can contribute:

1. Fork the repository

2. Create a feature branch:

git checkout -b feature/amazing-feature

3. Commit your changes:

git commit -m 'Add some amazing feature'

4. Push to the branch:

git push origin feature/amazing-feature

5. Open a Pull Request

Please read CONTRIBUTING.md for detailed guidelines.


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgements


📬 Contact

Project Link: https://github.com/Slygriyrsk/quantum-communication-simulator

About

This project features a Quantum Simulator upto 10 nodes which will show the internal working of how simulator works

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published