![]() |
Q2NS dev
ns-3 module
|
Entanglement swapping via a quantum repeater (source-centric BSG model). 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 <iostream>Go to the source code of this file.
Functions | |
| int | main (int argc, char **argv) |
Variables | |
| static const uint16_t | kAckPort = 9200 |
| static const uint16_t | kCtrlPort = 9100 |
Entanglement swapping via a quantum repeater (source-centric BSG model).
Two dedicated Bell-State Generator (BSG) source nodes create the link-level entanglement and distribute the qubits: Src1 generates (fly_a, rep_a): fly_a -> Alice, rep_a -> Repeater. Src2 generates (rep_b, fly_b): rep_b -> Repeater, fly_b -> Bob.
Once Alice and Bob receive their flying qubits they each send a classical ACK to the Repeater. When both ACKs arrive the Repeater performs a Bell-State Measurement (BSM) on mem_a and mem_b, swapping entanglement end-to-end. BSM outcomes are forwarded to Bob, who applies the Pauli corrections.
Timing model (illustrative): kSingleGate = 100 ns (single-qubit gate) kTwoQGate = 300 ns (two-qubit gate / BSM) kQDelay = 10 ns (quantum channel propagation, ~2 m fiber)
Visualization output is written to examples/example_traces/q2nsviz-repeater-swap-example.json and can be loaded in the q2nsviz viewer (src/q2ns/utils/q2nsviz-serve.sh).
Definition in file q2nsviz-repeater-swap-example.cc.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 55 of file q2nsviz-repeater-swap-example.cc.
References TraceWriter::Close(), q2ns::NetController::CreateNode(), q2ns::NetController::InstallQuantumLink(), TraceWriter::Instance(), kAckPort, kCtrlPort, m1, m2, TraceWriter::Open(), StrCat(), Trace(), TraceCreateCbit(), TraceCreateChannel(), TraceCreateNode(), TraceCreateQubit(), TraceEntangle(), TraceMeasure(), TraceNodeText(), TraceRemoveCbit(), TraceRemoveQubit(), TraceSendCbit(), TraceSendPacket(), TraceSendQubit(), q2ns::gates::X(), and q2ns::gates::Z().
|
static |
Definition at line 52 of file q2nsviz-repeater-swap-example.cc.
Referenced by main().
|
static |
Definition at line 53 of file q2nsviz-repeater-swap-example.cc.
Referenced by main().