Q2NS is a modular and inherently extensible simulation framework for quantum networks, designed to support the development and evaluation of Quantum Internet protocols and available for download on the ns-3 App Store.
Built on top of the widely adopted ns-3 discrete-event simulator, Q2NS augments classical network simulation capabilities with quantum-network primitives, while remaining fully compatible with ns-3’s environment. This enables researchers to study quantum and classical communication processes within a unified, flexible, and scalable platform.
Q2NS’s design reflects recent advances in quantum-native network architectural modeling. The “2” in Q2NS is intentional and applies to both Q and N: Q2 captures quantumness at the message and control functionality levels, while 2N reflects the enforced decoupling between network control and in-network operation execution within a unified framework.

At its core, Q2NS introduces a clear abstraction model in which users build a network through a NetController, and then create, manipulate, and transmit quantum information via QNode instances. This design enables a principled separation between protocol control logic and node- and channel-level operations, allowing rapid prototyping and seamless adaptation across heterogeneous and evolving Quantum Internet scenarios.
The framework is modular by design and supports multiple quantum-state representations through a unified plug-in interface. Users can transparently switch between state-vector, density-matrix, and stabilizer backends, selecting the most suitable trade-off between accuracy and computational efficiency for their specific use case.
To complement the simulation engine, Q2NS is accompanied by Q2NSViz, a lightweight visualization tool for trace-based animation. It jointly renders both the physical network topology and the entanglement connectivity graph, enabling intuitive inspection of entanglement dynamics and protocol behavior.
Developed within the ERC Consolidator Grant project QNattyNet at the University of Naples Federico II, Q2NS embodies a long-term vision of quantum-native networking, where entanglement is treated as a first-class network resource and protocols emerge from the tight interplay between quantum operations and classical signaling.
Key Features
- Multiple quantum state backends — ket-vector (QStateBackend::Ket), density matrix (DM), and stabilizer (Stab) representations, selectable per simulation at runtime.
- QMap-based channel noise — composable channel noise models including DepolarizingQMap, DephasingQMap, LossQMap, RandomGateQMap, RandomUnitaryQMap, plus LambdaQMap for arbitrary custom maps.
- Native ns-3 integration — standard build_lib module structure; NS_LOG, TypeId attributes, helper classes, examples, and tests follow ns-3 conventions throughout.
- Classical–quantum co-simulation — inherits the full ns-3 networking stack; classical and quantum traffic coexist over the same simulated topology with accurate timing and congestion effects.
- q2nsviz companion — lightweight trace-based browser visualization for quantum network animations.
Related Papers and Useful Links
- Quantum Internet Architecture: Unlocking Quantum-Native Routing via Quantum Addressing(invited paper). Marcello Caleffi and Angela Sara Cacciapuoti — in IEEE Transactions on Communications, vol. 74, pp. 3577-3599, 2026.
- An extensible quantum network simulator built on ns-3: Q2NS design and evaluation. Adam Pearson, Francesco Mazza, Marcello Caleffi, Angela Sara Cacciapuoti — Computer Networks (Elsevier) 2026.
- Q2NS: A Modular Framework for Quantum Network Simulation in ns-3 Authors/Creators (invited paper). Adam Pearson, Francesco Mazza, Marcello Caleffi, Angela Sara Cacciapuoti — Proc. of QCNC 2026.
- Q2NS Demo: A Quantum Network Simulator Based on ns-3 Francesco Mazza, Adam Pearson, Marcello Caleffi, Angela Sara Cacciapuoti — 2026.
- Q2NS Repository
- Q2NS App
