Spaces:
Sleeping
Sleeping
Update tab/tab6_noise_simulation.py
Browse files
tab/tab6_noise_simulation.py
CHANGED
|
@@ -42,14 +42,14 @@ def compare_original_vs_noisy(key_str):
|
|
| 42 |
|
| 43 |
# ---------------- First plot: Original Key (all green) ----------------
|
| 44 |
axs[0].bar(x, heights, color='green', edgecolor='black', linewidth=0.2)
|
| 45 |
-
axs[0].set_title("
|
| 46 |
axs[0].set_yticks([])
|
| 47 |
axs[0].set_ylabel("Bit")
|
| 48 |
|
| 49 |
# ---------------- Second plot: Noisy Key (red where flipped, green where same) ----------------
|
| 50 |
colors = ['red' if i in flipped_indices else 'green' for i in range(total_bits)]
|
| 51 |
axs[1].bar(x, heights, color=colors, edgecolor='black', linewidth=0.2)
|
| 52 |
-
axs[1].set_title("
|
| 53 |
axs[1].set_xlabel("Bit Index")
|
| 54 |
axs[1].set_yticks([])
|
| 55 |
axs[1].set_ylabel("Bit")
|
|
|
|
| 42 |
|
| 43 |
# ---------------- First plot: Original Key (all green) ----------------
|
| 44 |
axs[0].bar(x, heights, color='green', edgecolor='black', linewidth=0.2)
|
| 45 |
+
axs[0].set_title("Before Noise: Original QKD Key", fontsize=11)
|
| 46 |
axs[0].set_yticks([])
|
| 47 |
axs[0].set_ylabel("Bit")
|
| 48 |
|
| 49 |
# ---------------- Second plot: Noisy Key (red where flipped, green where same) ----------------
|
| 50 |
colors = ['red' if i in flipped_indices else 'green' for i in range(total_bits)]
|
| 51 |
axs[1].bar(x, heights, color=colors, edgecolor='black', linewidth=0.2)
|
| 52 |
+
axs[1].set_title("After Noise: Key with Eavesdropper Flips", fontsize=11)
|
| 53 |
axs[1].set_xlabel("Bit Index")
|
| 54 |
axs[1].set_yticks([])
|
| 55 |
axs[1].set_ylabel("Bit")
|