About NetSquid

The Network Simulator for Quantum Information using Discrete events (NetSquid) is a software tool for the modelling and simulation of scalable quantum networks developed at QuTech. The goal of NetSquid is to enable scientists and engineers to design the future quantum internet as well as modular quantum computing architectures. One of NetSquid’s key features is its ability to easily and accurately model the effects of time on the performance of quantum network and quantum computing systems. This forms an essential ingredient in developing scalable systems which require a design that can mitigate the limited lifetime of quantum bits processed by quantum devices. Read More

Key Features of NetSquid

Discrete Event Simulation

Discrete Event Simulation

Discrete event simulation engine to accurately track quantum decoherence across a network in time.

Quantum Computation Library

Quantum Computation Library

A quantum computation library focused on localised qubit operations and optimized for repeated random sampling using memoization.

Multiple Quantum State Formalisms

Multiple Quantum State Formalisms

Seamless support for representing quantum states as ket vector states, stabiliser states and density matrices, providing trade-offs in performance, scalability and versatility.

Physically Realistic Building Blocks

Physically Realistic Building Blocks

A library of modular and composable component base classes with which to physically model network hardware.

Available as Python Package

Available as Python Package

An easy to use Python package that uses optimised C and Cython code under the hood.

Asynchronous Framework

Asynchronous Framework

An intuitive asynchronous framework to program quantum network protocols and the classical control plane above it.

Getting Started with NetSquid

  • NetSquid is free to download and use! To get access please agree to the terms of service by registering via the community forum:
  • NetSquid is a package for the Python 3 programming language. It can be installed directly from our package server using the Python package installer and your forum credentials:
    pip3 install --extra-index-url https://pypi.netsquid.org netsquid
  • To get started visit the online documentation (requires registration) to learn the basics using the NetSquid in 10 minutes guide or to dive into the complete tutorial.
  • The community forum is a great place to find answers to NetSquid related questions and interact with the development team and other users.

Code example: a game of quantum ping-pong

  • >>> import netsquid as ns
  • >>> from netsquid.components import QuantumChannel
  • ...
  • >>> class PingPongProtocol(ns.protocols.NodeProtocol):
  • ...     def run(self):
  • ...         port = self.node.ports['qubitIO']
  • ...         while True:
  • ...             yield self.await_port_input(port)
  • ...             qubit = port.rx_input().items[0]
  • ...             observable = ns.X if self.node.name == 'Bob' else ns.Z
  • ...             outcome, _ = ns.qubits.measure(qubit, observable)
  • ...             print(f'{ns.sim_time()}: {self.node.name} measured '
  • ...                   f'{outcome} in {observable.name} basis')
  • ...             port.tx_output(qubit_msg)
  • ...
  • >>> network = ns.nodes.Network(
  • ...     'PingPongNetwork', nodes=['Alice', 'Bob'])
  • >>> network.add_connection('Alice', 'Bob',
  • ...     channel_to=QuantumChannel('A2B', delay=10),
  • ...     channel_from=QuantumChannel('B2A', delay=10),
  • ...     port_name_node1='qubitIO', port_name_node2='qubitIO')
  • >>> proto_a = PingPongProtocol(network.nodes['Alice']).start()
  • >>> proto_b = PingPongProtocol(network.nodes['Bob']).start()
  • >>> qubit = ns.qubits.qubitapi.create_qubits(1)
  • >>> network.nodes['Alice'].ports['qubitIO'].tx_output(qubit)
  • >>> ns.sim_run(duration=50)
  • 10.0: Bob measured 1 in X basis
  • 20.0: Alice measured 1 in Z basis
  • 30.0: Bob measured 0 in X basis
  • 40.0: Alice measured 1 in Z basis

NetSquid In Action

previous arrowprevious arrow
next arrownext arrow
Slider