Simulation Framework for a Noisy Weak Broadcast Protocol
This repository contains the code for simulation and analysis on the impact of gate-level depolarizing noise on the Weak Broadcast Protocol (WBC(3,1)), based on the implementation described in the Bachelor thesis "Noisy Byzantine Agreement in Quantum Networks: Impact of Gate Errors on a Weak Broadcast Protocol".
The goal of this code is to evaluate how hardware-level imperfections (specifically two-qubit gate depolarizing noise) affect the failure probability of the protocol under three adversarial models: no faulty, sender (S) faulty, and receiver (R0) faulty.
This thesis and repository are part of Research Project 2025, conducted at the Faculty of Electrical Engineering, Mathematics and Computer Science, Delft University of Technology.
All simulations are organized in the protocol/ directory. Each adversary configuration has its own subfolder containing the full SquidASM simulation stack.
protocol/
βββ no_faulty/
β βββ application.py
β βββ config.yaml
β βββ run_simulation.py
β βββ simulation_nofaulty.py
β βββ plot_nofaulty.py
βββ s_faulty/
β βββ application.py
β βββ config.yaml
β βββ run_simulation.py
β βββ simulation_sfaulty.py
β βββ plot_sfaulty.py
βββ r0_faulty/
βββ application.py
βββ config.yaml
βββ run_simulation.py
βββ simulation_r0faulty.py
βββ plot_r0faulty.py
- application.py β Implements the WBC(3,1) protocol logic for the three participating nodes.
- config.yaml β Describes the network configuration (node layout, noise settings, number of qubits, etc.).
- run_simulation.py β Entry point for launching the simulation with SquidASM.
- simulation_.py β Manages batch simulations for different depolarizing noise levels using parallelization.
- plot_.py β Generates the final failure probability plots used in the thesis.
To run the simulations, follow these steps:
NetSquid is a closed-source simulator that requires registration.
- Visit the NetSquid website and request access.
SquidASM is an open-source Python package that wraps NetSquid to simplify network simulations.
- GitHub repository: SquidASM
- Follow installation instructions in their documentation.
The code was developed in Python, alongside these following packages:
pip install matplotlib numpy pandas pyyamlEach strategy can be simulated independently by navigating into its folder and running the simulation_<strategy>.py file. Example:
cd protocol/no_faulty
python simulation_nofaulty.pyThis will generate output data and plots showing the failure probability of the protocol at various depolarization levels. Note that the data will need to be manually aggregated and introduced in the plot files.
To generate the corresponding plot separately:
python plot_nofaulty.pyRepeat the same steps for the s_faulty and r0_faulty directories.
- SquidASM Documentation: https://github.com/QuTech-Delft/squidasm
- NetSquid Forum: https://forum.netsquid.org/
- Bachelor Thesis:
Noisy Byzantine Agreement in Quantum Networks: Impact of Gate Errors on a Weak Broadcast Protocol(link pending)
All unused or outdated scripts have been removed. Some debug data has been left to facilitate a better understanding of the protocol's mechanics. Each file in this repository is part of the final simulation and analysis pipeline used to produce the results cited in the accompanying thesis.