quantumnet · quantum link simulation

Every hop costs fidelity, and the bill arrives at the key.

An entangled pair is created imperfect, spent to extend a link, degraded while it waits, and purified before anything can be extracted from it. Scroll, and watch one pair go through that: the fidelity figure is the whole subject.

0.990
source pair
no hops yet
Scroll to spend it ↓
0.990
fidelitysource pair
edge repeater repeater repeater edge
key threshold created spent · held · distilled key

Illustrative values from one example hop budget. quantumnet computes these from the parameters you give it, which is the point of the simulator.

Stage one · created

A pair is made, and it is already imperfect

Two adjacent nodes generate a Bell pair. No source is ideal: the photons are not perfectly indistinguishable, the detectors have dark counts, and the pair arrives with fidelity just under one.

Everything that follows multiplies against this number, so the first thing the simulator reports is what the source actually delivers rather than what the datasheet claims.

Fidelity 0.990 · one hop, and nothing spent yet

Stage two · extended

Extending the link spends the pair

To reach further, an intermediate node performs a Bell-state measurement on one half of each of two pairs. The two outer halves become entangled, and both input pairs are destroyed in the process.

A swap cannot improve fidelity. Each one multiplies the two contributing pairs, so the cost compounds with every repeater between the endpoints.

Fidelity 0.972 · two pairs consumed to make one longer link

Stage three · held

Waiting is not free

Entanglement has to be held while the rest of the route is scheduled. In a memory buffer the state relaxes on T1 and loses phase on T2, and the second is usually the one that ends the route.

This is where a schedule matters more than a shorter path. The time spent standing still can cost more fidelity than an extra hop.

Fidelity 0.918 · below the key threshold

Stage four · purified

Quality is bought with quantity

BBPSSW rounds take many weakly entangled pairs and, by measuring some of them, keep the ones that agree. The surviving pair is cleaner; the rest are gone.

Purification is the only step that raises fidelity, and it does so by spending pairs. Whether it is worth the expenditure is a routing decision the simulator makes for you.

Fidelity 0.963 · recovered, at the cost of 256 pairs

Stage five · routed

The shortest path is not the question

The topology layer asks which path clears the fidelity threshold once every swap and every hold on it is accounted for. A route that arrives too degraded to extract a key from is not a route.

# route entanglement across a live mesh export
py -m quantumnet ghost-net --topology mesh.json
{"route": [0, 4, 9, 11], "fidelity": 0.963, "distilled": true, "hops": 3}

Fidelity 0.963 · three hops, distillation applied

Stage six · spent

Then the key comes out, or nothing does

A real BB84 exchange runs at the route's noise level. Above the quantum bit error threshold the exchange is aborted and the fidelity was spent for nothing; below it, key material comes out.

# derive key material at the route's fidelity
py -m quantumnet qkd-derive --fidelity 0.963 --out key.bin

# every protocol, in sequence
py -m quantumnet all

Fidelity 0.963 · QBER under 4%, 32 bytes of key

What is inside

Nine primitives, ten protocols, five topology modules

Core

  • qubitdensity matrices
  • gateunitaries, Pauli
  • measurementPOVM, collapse
  • noisedepolarise, damp
  • channelattenuation
  • stabilizerClifford tableau
  • schedulerdiscrete event
  • ipc_nodeprocess per node

Protocols

  • bb84with eavesdropper
  • e91CHSH violation
  • teleportationstate transfer
  • superdensetwo bits, one qubit
  • swappingextend the link
  • distillationBBPSSW, Deutsch
  • memoryT1 / T2
  • shor · steane9- and 7-qubit codes

Topology

  • graphlinks, fidelity
  • routingthreshold-constrained
  • scheduletime-aware plan
  • visualizeASCII
  • ghostnetlive mesh export

Scope

  • realthe quantum mechanics
  • modelledhardware and network
  • no photonsno fibre, no sockets
  • not claimedhardware predictions
git clone https://github.com/KELLERBABG/QEL
cd QEL
py -m pip install -e ".[dev]"
py -m pytest -q        # about 80 seconds, 122 tests