Q2NS

This module brings quantum-native networking to ns-3, with pluggable state backends, entanglement-aware modeling, and visualization.
Categories: Quantum Networks

Overview

Q2NS architecture

Q2NS is a modular, inherently extensible simulation framework for quantum networks, built on top of ns-3. Q2NS augments ns-3 with quantum-network primitives while remaining fully compatible with ns-3’s classical discrete-event simulation environment. The goal is to provide a flexible, open, and scalable platform for Quantum Internet research.

Q2NS's design reflects recent advances in quantum-native network architectural modeling (1). 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 (1).

As described in our paper, users build a network with NetController, then create, manipulate, and send qubits through QNode. This allows for a decoupling of protocol control logic from node- and channel-level operations, enabling rapid prototyping and adaptation across heterogeneous and evolving Quantum Internet scenarios. Q2NS also natively supports multiple quantum-state representations through a unified plug-in interface, allowing interchangeable state-vector, density-matrix, and stabilizer backends.

This repository additionally includes q2nsviz (Q2NSViz), a lightweight visualization companion for trace-based animations. It jointly renders physical- and entanglement-connectivity graphs and supports entangled-state manipulations, facilitating an intuitive inspection of entanglement dynamics and protocol behavior. More details can be found in our documentation and related works!

Documentation



Acknowledgement

Q2NS is developed within the Horizon Europe ERC-CoG QNattyNet project (grant n. 101169850) at the University of Naples Federico II, funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.

v0.1

Works with ns-3.47

Build History : Q2NS v0.1

Release Notes

<p>v0.1-pre-alpha</p> <p>Initial public release, doxygen updates</p> <p><strong>Pre-alpha patch note:</strong> The App Store download points to a post-v0.1 patched commit containing small documentation/build fixes after the original <code>v0.1-pre-alpha</code> tag. The formal release tag and DOI remain unchanged.</p>

Q2NS is an ns-3 contributed module. Install it inside the ns-3 `contrib/` directory and make sure the module directory is named `q2ns`. Q2NS is currently tested with **ns-3.47** and requires a **C++23 compiler**. ### From the App Store download Download the source archive using the blue **Download** button on this App Store page. Then unpack it into an ns-3.47 source tree: ```bash git clone https://gitlab.com/nsnam/ns-3-dev.git cd ns-3-dev git checkout ns-3.47 tar -xzf /path/to/q2ns-archive.tar.gz -C contrib mv contrib/q2ns-* contrib/q2ns ./ns3 configure --enable-examples --enable-tests ./ns3 build ./ns3 run q2ns-1-basics-example ``` ### From git For development, clone Q2NS directly into `contrib/q2ns`: ```bash git clone https://gitlab.com/nsnam/ns-3-dev.git cd ns-3-dev git checkout ns-3.47 git clone https://github.com/QuantumInternet-it/q2ns.git contrib/q2ns ./ns3 configure --enable-examples --enable-tests ./ns3 build ./ns3 run q2ns-1-basics-example ``` ### Notes - The Q2NS directory must be named `q2ns`. - Q2NS vendors its required third-party libraries under `third_party/`. - Python 3 is only needed for the optional q2nsviz visualization server.

Q2NS is actively maintained by the Quantum Internet Research Group at the University of Naples Federico II within the ERC-CoG QNattyNet project. Please report bugs, build issues, and feature requests through the GitHub issue tracker: https://github.com/QuantumInternet-it/q2ns/issues

This ns-3 extension is one or more contributed modules.

Version v0.1

Released April 2, 2026

Works with ns-3.47