Q2NS dev
ns-3 module
Loading...
Searching...
No Matches
q2nsviz-entanglement-distribution-example.cc File Reference

Pairwise Bell-pair distribution across 3 fully-connected nodes. More...

#include "ns3/core-module.h"
#include "ns3/internet-module.h"
#include "ns3/network-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/simulator.h"
#include "ns3/q2ns-netcontroller.h"
#include "ns3/q2ns-qgate.h"
#include "ns3/q2ns-qnode.h"
#include "ns3/q2ns-qubit.h"
#include "ns3/q2nsviz-trace-writer.h"
#include "ns3/q2nsviz-trace.h"
#include <array>
#include <iostream>
Include dependency graph for q2nsviz-entanglement-distribution-example.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Variables

static const uint16_t kAckPort = 9100
 

Detailed Description

Pairwise Bell-pair distribution across 3 fully-connected nodes.

Three nodes (Node1, Node2, Node3) share quantum and classical links in a full-mesh topology. Bell pairs are distributed sequentially so that every pair of nodes ends up sharing one entangled qubit:

Step 1 - Node1 creates Bell pair 0, keeps half, sends the other to Node2. Step 2 - Node1 creates Bell pair 1, keeps half, sends the other to Node3. Step 3 - Node2 creates Bell pair 2, keeps half, sends the other to Node3.

After the protocol each link (1-2, 1-3, 2-3) carries one shared Bell pair.

Timing model (illustrative): kSingleGate = 100 ns (single-qubit gate) kTwoQGate = 300 ns (two-qubit gate) kQDelay = 100 ns (quantum channel propagation, ~20 m fiber)

Steps start at T = 1, 3, 5 us for clear visualization; final trace at ~20 us.

Visualization output is written to examples/example_traces/q2nsviz-entanglement-distribution-example.json and can be loaded in the q2nsviz viewer (src/q2ns/utils/q2nsviz-serve.sh).

See docs/tutorials/tutorial-00.md for a detailed walkthrough.

Definition in file q2nsviz-entanglement-distribution-example.cc.

Function Documentation

◆ main()

Variable Documentation

◆ kAckPort

const uint16_t kAckPort = 9100
static

Definition at line 57 of file q2nsviz-entanglement-distribution-example.cc.

Referenced by main().