Skip to content

Add BBM92 entanglement-based QKD protocol#334

Draft
nenadilic84 wants to merge 2 commits intoQuantumSavory:masterfrom
nenadilic84:bbm92-qkd-protocol
Draft

Add BBM92 entanglement-based QKD protocol#334
nenadilic84 wants to merge 2 commits intoQuantumSavory:masterfrom
nenadilic84:bbm92-qkd-protocol

Conversation

@nenadilic84
Copy link
Copy Markdown

Summary

Implements the BBM92 (Bennett-Brassard-Mermin 1992) entanglement-based quantum key distribution protocol as a new protocol in the ProtocolZoo, addressing issue #137.

BBM92 is the canonical application-layer protocol for entanglement distribution networks. It consumes shared Bell pairs from the existing EntanglerProtSwapperProtEntanglementTracker pipeline, with each party independently choosing a random measurement basis (Z or X) and performing projective measurements. Post-processing extracts the sifted key, estimates the quantum bit error rate (QBER), and computes key generation rate.

Components

  • BBM92Prot: Coordinator-style protocol (like EntanglementConsumer) that queries for EntanglementCounterpart tags between Alice and Bob, measures in random bases via project_traceout!, and logs results
  • sifted_key(log): Extracts matching-basis key bits for both parties
  • qber_estimate(log): Computes QBER from the measurement log
  • keyrate(log): Average sifted key generation rate (bits/time)
  • HTML show method displaying protocol statistics (total measurements, sifted bits, QBER, key rate)
  • Tests covering direct links, multi-hop repeater chains (3/5/8 nodes), event-driven waiting (period=nothing), and edge cases
  • Interactive examples (GLMakie + WGLMakie) showing real-time QBER, cumulative key length, key rate, and basis matching statistics over a 4-node repeater chain

Test results (local, Julia 1.12)

  • Direct link (2 nodes): ~499 measurements/50 time units, sifting rate ≈ 50%, QBER = 0.0, keys match perfectly
  • Repeater chain (3 nodes): 177 measurements/200 time units, QBER = 0.0, keys match
  • All helper function edge cases pass

Closes #137

Implement the BBM92 (Bennett-Brassard-Mermin 1992) quantum key distribution
protocol as a new protocol in the ProtocolZoo. BBM92 is the canonical
application-layer protocol for entanglement distribution networks, turning
shared Bell pairs into cryptographic key material.

The protocol consumes entangled pairs distributed by the existing
EntanglerProt/SwapperProt/EntanglementTracker pipeline. For each pair,
both parties independently choose a random measurement basis (Z or X),
perform projective measurements via project_traceout!, and record results.
Post-processing functions extract the sifted key, estimate QBER, and
compute key generation rate.

Components:
- BBM92Prot: coordinator-style protocol (like EntanglementConsumer)
- sifted_key(): extract matching-basis key bits for Alice and Bob
- qber_estimate(): quantum bit error rate from the measurement log
- keyrate(): average sifted key generation rate
- HTML show method with protocol statistics
- Comprehensive tests over direct links and repeater chains
- Interactive GLMakie/WGLMakie example over a 4-node repeater chain

Closes QuantumSavory#137
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 13, 2026

Benchmark Results (Julia v1)

Time benchmarks
master 96b9235... master / 96b9235...
onchange/dual_messagebuffer_any/writers_2_waiters_1 1.24 ± 0.035 ms 1.22 ± 0.03 ms 1.01 ± 0.038
onchange/dual_messagebuffer_any/writers_4_waiters_1 2.45 ± 0.086 ms 2.43 ± 0.079 ms 1.01 ± 0.048
onchange/dual_messagebuffer_any/writers_4_waiters_4 2.03 ± 0.059 ms 2.02 ± 0.056 ms 1 ± 0.04
onchange/dual_messagebuffer_any/writers_8_waiters_4 4.04 ± 0.21 ms 4.03 ± 0.2 ms 1 ± 0.072
onchange/sharded_registers/pairs_1 0.647 ± 0.083 ms 0.858 ± 0.093 ms 0.754 ± 0.13
onchange/sharded_registers/pairs_16 10.1 ± 0.14 ms 12.8 ± 0.26 ms 0.79 ± 0.019
onchange/sharded_registers/pairs_32 20.7 ± 0.24 ms 26 ± 0.38 ms 0.794 ± 0.015
onchange/sharded_registers/pairs_4 2.47 ± 0.039 ms 3.15 ± 0.062 ms 0.785 ± 0.02
onchange/shared_messagebuffer_channel/writers_1_waiters_1 0.846 ± 0.022 ms 0.934 ± 0.021 ms 0.906 ± 0.031
onchange/shared_messagebuffer_channel/writers_1_waiters_8 0.552 ± 0.02 ms 0.681 ± 0.02 ms 0.811 ± 0.038
onchange/shared_messagebuffer_channel/writers_4_waiters_4 2.26 ± 0.28 ms 2.75 ± 0.32 ms 0.821 ± 0.14
onchange/shared_messagebuffer_channel/writers_8_waiters_1 6.68 ± 0.79 ms 7.41 ± 0.83 ms 0.902 ± 0.15
onchange/shared_messagebuffer_direct/writers_16_waiters_2 5 ± 0.87 ms 5.04 ± 0.94 ms 0.993 ± 0.25
onchange/shared_messagebuffer_direct/writers_1_waiters_1 0.403 ± 0.063 ms 0.409 ± 0.066 ms 0.986 ± 0.22
onchange/shared_messagebuffer_direct/writers_1_waiters_8 0.29 ± 0.058 ms 0.294 ± 0.06 ms 0.986 ± 0.28
onchange/shared_messagebuffer_direct/writers_2_waiters_16 0.518 ± 0.097 ms 0.524 ± 0.11 ms 0.988 ± 0.28
onchange/shared_messagebuffer_direct/writers_4_waiters_4 1.08 ± 0.19 ms 1.09 ± 0.21 ms 0.993 ± 0.26
onchange/shared_messagebuffer_direct/writers_8_waiters_1 2.95 ± 0.48 ms 2.97 ± 0.53 ms 0.992 ± 0.24
onchange/shared_register/writers_16_waiters_2 9.39 ± 1.4 ms 12 ± 1.7 ms 0.782 ± 0.16
onchange/shared_register/writers_1_waiters_1 0.666 ± 0.084 ms 0.871 ± 0.097 ms 0.765 ± 0.13
onchange/shared_register/writers_1_waiters_8 0.677 ± 0.11 ms 0.804 ± 0.13 ms 0.842 ± 0.19
onchange/shared_register/writers_2_waiters_16 1.72 ± 0.34 ms 1.91 ± 0.38 ms 0.9 ± 0.25
onchange/shared_register/writers_4_waiters_4 2.35 ± 0.37 ms 2.95 ± 0.41 ms 0.795 ± 0.17
onchange/shared_register/writers_8_waiters_1 5.18 ± 0.67 ms 6.69 ± 0.75 ms 0.775 ± 0.13
onchange/shared_regref/writers_1_waiters_1 0.682 ± 0.088 ms 0.868 ± 0.098 ms 0.786 ± 0.13
onchange/shared_regref/writers_1_waiters_8 0.674 ± 0.11 ms 0.8 ± 0.13 ms 0.843 ± 0.2
onchange/shared_regref/writers_4_waiters_4 2.38 ± 0.37 ms 2.98 ± 0.42 ms 0.798 ± 0.17
onchange/shared_regref/writers_8_waiters_1 5.23 ± 0.69 ms 6.62 ± 0.76 ms 0.791 ± 0.14
quantumstates/observable/quantumoptics 0.841 ± 0.25 μs 0.852 ± 0.23 μs 0.987 ± 0.4
querywait/messagebuffer_channel/writers_1_waiters_1 1.01 ± 0.015 ms 1.13 ± 0.027 ms 0.888 ± 0.025
querywait/messagebuffer_channel/writers_1_waiters_8 1.97 ± 0.15 ms 2.13 ± 0.16 ms 0.923 ± 0.099
querywait/messagebuffer_channel/writers_4_waiters_4 6.42 ± 0.85 ms 7 ± 0.98 ms 0.917 ± 0.18
querywait/messagebuffer_channel/writers_8_waiters_1 8.19 ± 0.9 ms 9.08 ± 0.94 ms 0.902 ± 0.14
querywait/messagebuffer_direct/writers_1_waiters_1 0.521 ± 0.073 ms 0.556 ± 0.069 ms 0.938 ± 0.18
querywait/messagebuffer_direct/writers_1_waiters_8 1.47 ± 0.24 ms 1.52 ± 0.25 ms 0.962 ± 0.22
querywait/messagebuffer_direct/writers_4_waiters_4 4.37 ± 0.68 ms 4.51 ± 0.79 ms 0.969 ± 0.23
querywait/messagebuffer_direct/writers_8_waiters_1 4.06 ± 0.58 ms 4.26 ± 0.57 ms 0.952 ± 0.19
querywait/register_query_wait/writers_1_waiters_1 0.59 ± 0.067 ms 0.711 ± 0.067 ms 0.829 ± 0.12
querywait/register_query_wait/writers_1_waiters_8 1.64 ± 0.26 ms 1.97 ± 0.3 ms 0.831 ± 0.18
querywait/register_query_wait/writers_4_waiters_4 4.31 ± 0.63 ms 5.56 ± 0.73 ms 0.774 ± 0.15
querywait/register_query_wait/writers_8_waiters_1 4.73 ± 0.53 ms 5.66 ± 0.55 ms 0.836 ± 0.12
querywait/register_querydelete_wait/writers_1_waiters_1 0.588 ± 0.065 ms 0.648 ± 0.067 ms 0.907 ± 0.14
querywait/register_querydelete_wait/writers_1_waiters_8 1.65 ± 0.25 ms 1.98 ± 0.29 ms 0.83 ± 0.18
querywait/register_querydelete_wait/writers_4_waiters_4 4.28 ± 0.63 ms 5.03 ± 0.66 ms 0.851 ± 0.17
querywait/register_querydelete_wait/writers_8_waiters_1 4.71 ± 0.53 ms 5.18 ± 0.51 ms 0.909 ± 0.14
register/creation_and_initialization/from_tests 0.259 ± 0.024 ms 0.264 ± 0.023 ms 0.979 ± 0.13
tagquery/messagebuffer/query 0.461 ± 0.01 μs 0.531 ± 0.02 μs 0.868 ± 0.038
tagquery/messagebuffer/query_high_arity 0.441 ± 0.01 μs 0.48 ± 0.01 μs 0.919 ± 0.028
tagquery/messagebuffer/query_high_arity_predicate 9.03 ± 1.9 μs 9.23 ± 2 μs 0.978 ± 0.3
tagquery/messagebuffer/query_miss 0.171 ± 0.01 μs 0.171 ± 0.01 μs 1 ± 0.083
tagquery/messagebuffer/query_tag_dispatch 1.6 ± 0.01 μs 1.63 ± 0.02 μs 0.982 ± 0.013
tagquery/messagebuffer/querydelete 1.25 ± 0.16 μs 1.24 ± 0.18 μs 1.01 ± 0.19
tagquery/messagebuffer/querydelete_back 0.551 ± 0.13 μs 0.451 ± 0.14 μs 1.22 ± 0.48
tagquery/messagebuffer/querydelete_front 0.21 ± 0.021 μs 0.2 ± 0.04 μs 1.05 ± 0.23
tagquery/messagebuffer/querydelete_miss 0.471 ± 0.1 μs 0.431 ± 0.14 μs 1.09 ± 0.42
tagquery/misc/from_tests 12.2 ± 0.81 μs 11.2 ± 0.65 μs 1.09 ± 0.097
tagquery/register/query 4.72 ± 0.022 s 4.43 ± 0.036 s 1.07 ± 0.0099
tagquery/register/query_assigned 1.31 ± 0.029 μs 0.962 ± 0.02 μs 1.36 ± 0.041
tagquery/register/query_exact_fifo 0.621 ± 0.02 μs 0.661 ± 0.02 μs 0.939 ± 0.042
tagquery/register/query_exact_filo 2.29 ± 0.031 μs 2.56 ± 0.03 μs 0.895 ± 0.016
tagquery/register/query_locked 1.98 ± 0.09 μs 0.551 ± 0.011 μs 3.6 ± 0.18
tagquery/register/query_miss 2.01 ± 0.019 μs 2.5 ± 0.021 μs 0.804 ± 0.01
tagquery/register/query_predicate 2.84 ± 0.15 μs 1.46 ± 0.02 μs 1.94 ± 0.11
tagquery/register/query_tag_dispatch 2.11 ± 0.011 μs 2.11 ± 0.03 μs 1 ± 0.015
tagquery/register/query_unassigned 1.76 ± 0.021 μs 1.38 ± 0.011 μs 1.27 ± 0.018
tagquery/register/queryall 5.02 s 4.63 ± 0.02 s 1.08
tagquery/register/queryall_fifo 3.05 ± 1.8 μs 4.56 ± 1.8 μs 0.668 ± 0.47
tagquery/register/queryall_filo 2.73 ± 0.25 μs 2.83 ± 0.34 μs 0.961 ± 0.15
tagquery/register/queryall_tag_dispatch 2.17 ± 0.071 μs 2.18 ± 0.022 μs 0.991 ± 0.034
tagquery/register_high_arity/query_exact 0.361 ± 0.011 μs 0.361 ± 0.02 μs 1 ± 0.063
tagquery/register_high_arity/query_predicate 1.87 ± 0.041 μs 1.57 ± 0.02 μs 1.19 ± 0.03
tagquery/register_high_arity/queryall 0.381 ± 0.02 μs 0.401 ± 0.01 μs 0.95 ± 0.055
tagquery/register_mutating/querydelete_register 1.79 ± 0.13 μs 1.4 ± 0.12 μs 1.28 ± 0.14
tagquery/register_mutating/querydelete_regref_fifo 1.56 ± 0.14 μs 1.26 ± 0.1 μs 1.24 ± 0.15
tagquery/register_mutating/querydelete_regref_filo 1.45 ± 0.12 μs 1.31 ± 0.11 μs 1.11 ± 0.13
tagquery/register_mutating/untag_by_id 0.211 ± 0.03 μs 0.22 ± 0.021 μs 0.959 ± 0.16
tagquery/register_ref/query_fifo 0.602 ± 0.02 μs 0.571 ± 0.02 μs 1.05 ± 0.051
tagquery/register_ref/query_filo 0.651 ± 0.02 μs 0.661 ± 0.02 μs 0.985 ± 0.042
tagquery/register_ref/query_tag_dispatch 0.401 ± 0.019 μs 0.391 ± 0.011 μs 1.03 ± 0.057
tagquery/register_ref/queryall_fifo 1.04 ± 0.021 μs 1.32 ± 0.03 μs 0.788 ± 0.024
tagquery/register_ref/queryall_filo 0.732 ± 0.02 μs 0.751 ± 0.021 μs 0.975 ± 0.038
time_to_load 18.4 ± 0.28 s 17.8 ± 0.12 s 1.03 ± 0.017
Memory benchmarks
master 96b9235... master / 96b9235...
onchange/dual_messagebuffer_any/writers_2_waiters_1 10.8 k allocs: 0.591 MB 10.8 k allocs: 0.591 MB 1
onchange/dual_messagebuffer_any/writers_4_waiters_1 21.4 k allocs: 1.18 MB 21.4 k allocs: 1.18 MB 0.999
onchange/dual_messagebuffer_any/writers_4_waiters_4 21.5 k allocs: 1.18 MB 21.5 k allocs: 1.18 MB 1
onchange/dual_messagebuffer_any/writers_8_waiters_4 0.045 M allocs: 2.39 MB 0.045 M allocs: 2.39 MB 1
onchange/sharded_registers/pairs_1 3.85 k allocs: 0.189 MB 3.85 k allocs: 0.189 MB 1
onchange/sharded_registers/pairs_16 0.0692 M allocs: 3.19 MB 0.0692 M allocs: 3.19 MB 1
onchange/sharded_registers/pairs_32 0.143 M allocs: 6.44 MB 0.143 M allocs: 6.44 MB 1
onchange/sharded_registers/pairs_4 15.6 k allocs: 0.768 MB 15.6 k allocs: 0.768 MB 1
onchange/shared_messagebuffer_channel/writers_1_waiters_1 4.67 k allocs: 0.241 MB 4.67 k allocs: 0.241 MB 1
onchange/shared_messagebuffer_channel/writers_1_waiters_8 4.68 k allocs: 0.241 MB 4.68 k allocs: 0.241 MB 1
onchange/shared_messagebuffer_channel/writers_4_waiters_4 18.4 k allocs: 0.949 MB 18.4 k allocs: 0.949 MB 1
onchange/shared_messagebuffer_channel/writers_8_waiters_1 0.0384 M allocs: 1.91 MB 0.0384 M allocs: 1.91 MB 1
onchange/shared_messagebuffer_direct/writers_16_waiters_2 0.0447 M allocs: 2.31 MB 0.0447 M allocs: 2.31 MB 1
onchange/shared_messagebuffer_direct/writers_1_waiters_1 2.66 k allocs: 0.142 MB 2.66 k allocs: 0.142 MB 1
onchange/shared_messagebuffer_direct/writers_1_waiters_8 2.67 k allocs: 0.145 MB 2.67 k allocs: 0.145 MB 1
onchange/shared_messagebuffer_direct/writers_2_waiters_16 5.33 k allocs: 0.283 MB 5.33 k allocs: 0.283 MB 1
onchange/shared_messagebuffer_direct/writers_4_waiters_4 10.6 k allocs: 0.569 MB 10.6 k allocs: 0.569 MB 1
onchange/shared_messagebuffer_direct/writers_8_waiters_1 21.2 k allocs: 1.13 MB 21.2 k allocs: 1.13 MB 1
onchange/shared_register/writers_16_waiters_2 0.0713 M allocs: 3.27 MB 0.0713 M allocs: 3.27 MB 1
onchange/shared_register/writers_1_waiters_1 3.85 k allocs: 0.189 MB 3.85 k allocs: 0.189 MB 1
onchange/shared_register/writers_1_waiters_8 5.46 k allocs: 0.264 MB 5.46 k allocs: 0.264 MB 1
onchange/shared_register/writers_2_waiters_16 14.6 k allocs: 0.839 MB 14.6 k allocs: 0.839 MB 1
onchange/shared_register/writers_4_waiters_4 18.1 k allocs: 0.878 MB 18.1 k allocs: 0.878 MB 1
onchange/shared_register/writers_8_waiters_1 0.0317 M allocs: 1.55 MB 0.0317 M allocs: 1.55 MB 1
onchange/shared_regref/writers_1_waiters_1 3.85 k allocs: 0.189 MB 3.85 k allocs: 0.189 MB 1
onchange/shared_regref/writers_1_waiters_8 5.46 k allocs: 0.264 MB 5.46 k allocs: 0.264 MB 1
onchange/shared_regref/writers_4_waiters_4 18.1 k allocs: 0.877 MB 18.1 k allocs: 0.878 MB 0.999
onchange/shared_regref/writers_8_waiters_1 0.0317 M allocs: 1.55 MB 0.0317 M allocs: 1.55 MB 1
quantumstates/observable/quantumoptics 22 allocs: 2.44 kB 22 allocs: 2.44 kB 1
querywait/messagebuffer_channel/writers_1_waiters_1 5.22 k allocs: 0.262 MB 5.22 k allocs: 0.263 MB 0.999
querywait/messagebuffer_channel/writers_1_waiters_8 14.1 k allocs: 0.753 MB 14.1 k allocs: 0.753 MB 1
querywait/messagebuffer_channel/writers_4_waiters_4 0.0437 M allocs: 2.23 MB 0.0442 M allocs: 2.26 MB 0.988
querywait/messagebuffer_channel/writers_8_waiters_1 0.0438 M allocs: 2.11 MB 0.0438 M allocs: 2.11 MB 1
querywait/messagebuffer_direct/writers_1_waiters_1 3.2 k allocs: 0.164 MB 3.2 k allocs: 0.164 MB 1
querywait/messagebuffer_direct/writers_1_waiters_8 12.1 k allocs: 0.657 MB 12.1 k allocs: 0.657 MB 1
querywait/messagebuffer_direct/writers_4_waiters_4 0.0344 M allocs: 1.82 MB 0.0345 M allocs: 1.83 MB 0.995
querywait/messagebuffer_direct/writers_8_waiters_1 25.7 k allocs: 1.31 MB 25.7 k allocs: 1.31 MB 1
querywait/register_query_wait/writers_1_waiters_1 2.59 k allocs: 0.14 MB 2.59 k allocs: 0.14 MB 1
querywait/register_query_wait/writers_1_waiters_8 11.7 k allocs: 0.594 MB 11.7 k allocs: 0.594 MB 1
querywait/register_query_wait/writers_4_waiters_4 27.1 k allocs: 1.4 MB 27.1 k allocs: 1.4 MB 1
querywait/register_query_wait/writers_8_waiters_1 20.6 k allocs: 1.12 MB 20.6 k allocs: 1.12 MB 1
querywait/register_querydelete_wait/writers_1_waiters_1 2.52 k allocs: 0.135 MB 2.52 k allocs: 0.135 MB 1
querywait/register_querydelete_wait/writers_1_waiters_8 11.7 k allocs: 0.589 MB 11.7 k allocs: 0.589 MB 1
querywait/register_querydelete_wait/writers_4_waiters_4 26.9 k allocs: 1.38 MB 26.9 k allocs: 1.38 MB 1
querywait/register_querydelete_wait/writers_8_waiters_1 20.1 k allocs: 1.08 MB 20.1 k allocs: 1.08 MB 1
register/creation_and_initialization/from_tests 2.58 k allocs: 0.943 MB 2.58 k allocs: 0.943 MB 1
tagquery/messagebuffer/query 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
tagquery/messagebuffer/query_high_arity 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
tagquery/messagebuffer/query_high_arity_predicate 0.393 k allocs: 6.22 kB 0.393 k allocs: 6.22 kB 1
tagquery/messagebuffer/query_miss 0 allocs: 0 B 0 allocs: 0 B
tagquery/messagebuffer/query_tag_dispatch 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
tagquery/messagebuffer/querydelete 3 allocs: 0.0938 kB 3 allocs: 0.0938 kB 1
tagquery/messagebuffer/querydelete_back 1 allocs: 32 B 1 allocs: 32 B 1
tagquery/messagebuffer/querydelete_front 1 allocs: 32 B 1 allocs: 32 B 1
tagquery/messagebuffer/querydelete_miss 0 allocs: 0 B 0 allocs: 0 B
tagquery/misc/from_tests 0.187 k allocs: 13.1 kB 0.187 k allocs: 13.1 kB 1
tagquery/register/query 4.99 M allocs: 0.622 GB 2.39 M allocs: 0.293 GB 2.12
tagquery/register/query_assigned 3 allocs: 0.281 kB 3 allocs: 0.281 kB 1
tagquery/register/query_exact_fifo 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register/query_exact_filo 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register/query_locked 3 allocs: 0.281 kB 3 allocs: 0.281 kB 1
tagquery/register/query_miss 1 allocs: 0.109 kB 1 allocs: 0.109 kB 1
tagquery/register/query_predicate 14 allocs: 0.578 kB 14 allocs: 0.578 kB 1
tagquery/register/query_tag_dispatch 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register/query_unassigned 3 allocs: 0.281 kB 3 allocs: 0.281 kB 1
tagquery/register/queryall 4.71 M allocs: 0.916 GB 3.84 M allocs: 0.743 GB 1.23
tagquery/register/queryall_fifo 6 allocs: 6.8 kB 6 allocs: 6.8 kB 1
tagquery/register/queryall_filo 6 allocs: 6.8 kB 6 allocs: 6.8 kB 1
tagquery/register/queryall_tag_dispatch 3 allocs: 0.625 kB 3 allocs: 0.625 kB 1
tagquery/register_high_arity/query_exact 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register_high_arity/query_predicate 21 allocs: 0.75 kB 21 allocs: 0.75 kB 1
tagquery/register_high_arity/queryall 3 allocs: 0.625 kB 3 allocs: 0.625 kB 1
tagquery/register_mutating/querydelete_register 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register_mutating/querydelete_regref_fifo 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register_mutating/querydelete_regref_filo 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register_mutating/untag_by_id 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
tagquery/register_ref/query_fifo 3 allocs: 0.375 kB 3 allocs: 0.375 kB 1
tagquery/register_ref/query_filo 3 allocs: 0.375 kB 3 allocs: 0.375 kB 1
tagquery/register_ref/query_tag_dispatch 3 allocs: 0.375 kB 3 allocs: 0.375 kB 1
tagquery/register_ref/queryall_fifo 4 allocs: 0.734 kB 4 allocs: 0.734 kB 1
tagquery/register_ref/queryall_filo 4 allocs: 0.734 kB 4 allocs: 0.734 kB 1
time_to_load 0.148 k allocs: 10.8 kB 0.148 k allocs: 10.8 kB 1

Signed-off-by: Nenad Ilic <nenadilic84@gmail.com>
@Krastanov
Copy link
Copy Markdown
Member

Krastanov commented Feb 13, 2026

Hi, Nenad! Thank you for the contribution, on a quick skim it looks pretty complete.

I noticed that you have submitted a lot of PRs to QuantumSavory, JuliaGraphs, and qojulia this morning. Given the very quick pace, this leads me to believe you have used LLM agents to do so. That is not bad on its own -- I myself use such tools quite a bit -- but it fairly widely accepted that politeness requires disclosing this fact.

The main problem is knowing whether I can trust your contributions. An LLM makes it very easy for a PR to look polished while having severe difficult to discover flaws. One of the main signals I used to rely on -- polish correlating with correctness, is not valid anymore. Even worse -- given the type of bugs that LLMs create, reviewing a PR is now actually much more difficult.

This also leads to a contributor asymmetry -- it used to be the case that a large PR implied to contributor spent significant effort, while these days large seemingly-polished PRs are easy to generate and they are difficult to treat as anything different from spam, given the immense effort that reviewing requires.

As I mentioned though, using an LLM is not disqualifying, but it requires some level of building of trust before I spent the very significant effort of reviewing all of this. If you are ok with these constraints, could you please do the following:

  • on all of your PRs, disclose whether you used an LLM, and which agent/model/version you used
  • share what the prompts you wrote were
  • share what was initially done wrong by the LLM agent and what you had to do manually
  • confirm you read and understood every single line
  • confirm that every single example script and test is something that you executed locally and carefully verified (this is something that you really should not be able to do in less than an hour, otherwise I would not be comfortable trusting you were thorough)
  • do not use an LLM to answer these points (e.g. the way the description of this PR is mostly generated by an LLM)

I will provide a review on the merits of the contribution after your answer.

Thank you for contributing this and other changes in other organizations, they can be very valuable! And apologies for the less than warm welcome -- it is necessary to defend the quality of these open source projects now that the proliferation of LLM agents is ripping apart the social contract and the community goodwill.

@nenadilic84
Copy link
Copy Markdown
Author

Hey Stefan, I did use LLMs to aid me with coding on these. I'll go over each PR and share what I can recover/remember.

I used Claude (Anthropic) via the Claude Code CLI. My workflow was: describe what I want, review the output, fix things, iterate.

This PR (BBM92) was the heaviest. I read the paper and studied existing protocols in ProtocolZoo, especially EntanglerProt and SwapperProt. Claude helped scaffold the protocol struct and ConcurrentSim process function, but the measurement logic and key sifting needed manual fixes. Claude kept getting the basis reconciliation wrong. I wrote the tests iteratively, running them, finding failures, fixing the protocol logic until things worked.

For #332 (tags/entanglement links): I read through QuantumSavoryMakie.jl and prompted Claude with that code. Main fix was the Makie recipe patterns, Claude didn't match the observable/lift conventions in the repo so I had to rework those.

For #333 (ring network): Used firstgenrepeater examples as reference. Claude generated initial scripts, I fixed the network topology to work with RegisterNet and ran both visualization versions locally.

What Claude got wrong across these: PR descriptions were mostly LLM-generated (you noticed), Makie observable handling needed several rounds of fixes, BBM92 basis logic was wrong on first pass, some ConcurrentSim @yield patterns were off, CHANGELOG entries were too wordy.

I've read all the code and can walk through any part of it. Ran all tests locally, ran each example script. This one took the most real time, especially the protocol logic.

Happy to address anything specific you find during review.

@hanakl
Copy link
Copy Markdown
Contributor

hanakl commented Mar 1, 2026

Hi @nenadilic84, thanks for your submission! I have a few initial points that I’d like you to address:

  1. You mentioned in the docstring that SwapperProt is used, but it is not actually used in your code nor does it seem necessary; could you confirm that you understand the protocol and the role of the swapper, and explain why it was referenced? I did notice that you test this on a repeater chain (which uses swapper), can you also explain your rationale behind that choice as well?
  2. For QKD protocols, the eavesdropper component (Eve) is a critical part of the security model, as these protocols are designed to be secure against such attacks. It seems like this part is not incorporated in your protocol.
  3. Regarding the visuals and show methods, it would be very helpful if you could include screenshots along with brief explanations of what they demonstrate.

There are a few other things, but I will do a more thorough review once these questions are answered. Please note that LLM should not be used to address these points!

@Krastanov
Copy link
Copy Markdown
Member

Hi, @nenadilic84 ! I will mark this as a draft to keep my review queue a bit more organized. Do not hesitate to get it back into ready-for-review state if you feel like continuing it.

@Krastanov Krastanov marked this pull request as draft March 20, 2026 17:56
@Krastanov
Copy link
Copy Markdown
Member

Closing this due to inactivity -- if you decide to take it back up, please do not hesitate to reopen it. Thanks for looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a networking protocol primitive [$400]

3 participants