18#include "ns3/simulator.h"
19#include "ns3/traced-callback.h"
21#include "ns3/q2ns-qchannel.h"
22#include "ns3/q2ns-qmap.h"
23#include "ns3/q2ns-qstate-registry.h"
31#include <unordered_map>
132 ns3::Ptr<QNode>
CreateNode(
const std::string& label =
"");
141 ns3::Ptr<QNode>
GetNode(uint32_t nodeId);
175 std::vector<ns3::Ptr<QChannel>>
InstallQuantumChain(
const std::vector<ns3::Ptr<QNode>>& nodes);
199 ns3::Ptr<QChannel>
GetChannel(ns3::Ptr<QNode> a, ns3::Ptr<QNode> b);
206 std::shared_ptr<QState>
GetState(
const std::shared_ptr<Qubit>& q)
const;
222 std::unordered_map<uint32_t, ns3::Ptr<QNode>>
nodes_;
223 std::map<std::pair<uint32_t, uint32_t>, ns3::Ptr<QChannel>>
Main user-facing facade for creating and configuring a quantum network.
std::map< std::pair< uint32_t, uint32_t >, ns3::Ptr< QChannel > > channels_
Undirected link map keyed by sorted endpoint ids.
QStateRegistry registry_
Shared state registry.
QStateRegistry & GetRegistry()
Access the shared state registry.
void EnsureStreamsAssigned_()
Ensure RNG streams have been assigned before simulation activity begins.
int64_t nextStream_
Next stream index to assign.
ns3::Ptr< QChannel > GetChannel(ns3::Ptr< QNode > a, ns3::Ptr< QNode > b)
Return the QChannel connecting two nodes.
int64_t AssignStreams(int64_t stream)
Assign RNG streams to q2ns-owned random sources.
std::vector< ns3::Ptr< QChannel > > InstallQuantumAllToAll(const std::vector< ns3::Ptr< QNode > > &nodes)
Connect a set of nodes with all-to-all quantum links.
QStateBackend GetQStateBackend()
Get the current default backend.
std::shared_ptr< QState > GetState(const std::shared_ptr< Qubit > &q) const
Convenience helper to get a qubit's current backend state.
ns3::Ptr< QNode > GetNode(uint32_t nodeId)
Return the QNode associated with a node id.
ns3::Ptr< QNode > CreateNode(const std::string &label="")
Create a QNode with an optional human-readable label.
ns3::Ptr< QChannel > InstallQuantumLink(ns3::Ptr< QNode > a, ns3::Ptr< QNode > b)
Install a duplex quantum link between two nodes.
bool streamsAssigned_
True once AssignStreams has been called.
NetController()
Default constructor.
std::unordered_map< uint32_t, ns3::Ptr< QNode > > nodes_
Node id to QNode map.
std::vector< ns3::Ptr< QChannel > > InstallQuantumChain(const std::vector< ns3::Ptr< QNode > > &nodes)
Connect a sequence of nodes as a linear chain.
void SetQStateBackend(QStateBackend b)
Set the default backend used for newly created quantum states.
Internal registry that owns backend states and tracks qubit membership and location.
QStateBackend
Backend family used when creating new quantum states.