Package: netqasm
NetQASMUtilities for writing, compiling, and running quantum network applications.IntroNetQASM is an instruction set architecture that allows one to interface with quantum network controllers and run applications on a quantum network. Applications may be written directly in the NetQASM language, which resembles assembly code. However, this package also provides an SDK which allows writing application code in Python.
For the paper introducing NetQASM, seehere.Applications written with this SDK may be run on a simulator backend, likeSquidASMorSimulaQron. In the future, these same applications may be run on a hardware backend consisting of real implementations of quantum network controllers.This NetQASM Python library is used by theQNE ADK, which allows interaction with theQuantum Network Explorer. When developing applications specifically for the QNE platform, it is recommended to use theQNE ADK.
For more generic application development, this NetQASM package can be used directly.PrerequisitesThis package has only been tested on Linux, specifically Ubuntu. On Windows,WSLmay be used.InstallationFrom PyPINetQASM is available asa package on PyPIand can be installed withpip install netqasmIf you also want to run NetQASM applications on an actual simulator, you may installsquidasm, with:pip install squidasm --extra-index-url=https://pypi.netsquid.orgwhich whill prompt for your NetSquid username and password.From sourceClone this repository and create an editable install with:pip install -e .Additionally you may want to install thedevdependencies in order to run the tests and linter:pip install -e .[dev]Thesquidasmsimulator can also be installed, with:pip install -e .[squidasm] --extra-index-url=https://pypi.netsquid.orgAlternatively, you can use themake installandmake install-devMakefile commands.
For also installingsquidasm, usemake install-squidasm.
This requires you to have theNETSQUIDPYPI_USERandNETSQUIDPYPI_PWDenvironment variables set to your NetSquid username and password respectively.To verify the installation and run all tests and examples:makeverifyDocumentationThe documentation is hosted onRead the Docs.The documentation source lives inthe docs directory.
See thedocs READMEfor information about building and rendering docs.ExamplesExample applications can be found innetqasm/examples.Applications can be run in two ways:From the command line, usingnetqasm simulate.
This requires the application code to be organized in a directory with a specific format (see theApplication file structurepage in the docs).By running a Python script that contains code to start the application.Examples of applications organized in a directory can be found innetqasm/examples/appsandnetqasm/examples/qne_apps.
They can be run on a simulator usingnetqasmsimulate--app-dirnetqasm/examples/<app>Examples of Python scripts that can run applications can be found innetqasm/examples/sdk_scripts. These files can be run directly usingpython <filename>.netqasm/examples/sdk_compilationcontains SDK scripts that use a debug backend. Running these files does not involve an actual simulation of the application code but can be used to see the NetQASM subroutines that are compiled from the Python application code.For more information, check thedocumentation.CLIOnce installed,netqasmcan be used as a command-line interface (CLI) to perform various operations.Seenetqasm --helpandnetqasm <command> --helpfor the options.For example, you can use the--simulator=<simulator>to specify which simulator to use.
Currently there is support for:SquidASM, which internally usesNetSquidSimulaQronWe note that SquidASM is the recommended (and also default) simulator since it is generally faster than SimulaQron and can also simulate noise much more accurately.License and patentA patent application (NL 2029673) has been filed which covers parts of the software in this
repository. We allow for non-commercial and academic use but if you want to
explore a commercial market, please contact us for a license agreement.DevelopmentFor code formatting,blackandisortare used.
Type hints should be added as much as possible.
Types are checked usingmypy.Before code is pushed, make sure that themake lintcommand succeeds, which runsblack,isort,flake8andmypy.BranchesA form of "git flow" is used for branch and release management. The main active branch isdevelop.
New features are developed in new separate branches, preferrably with a name representing the new feature.
To get the new features in the main branch, open a pull request for merging the feature branch into thedevelopbranch.
These pull requests are then reviewed by maintainers of the repository.
Amasterormainbranch is not used.Releases (for maintainers only)When a release is made, a new branchrelease-X.Y(e.g.release-0.12) is created from thedevelopbranch.
Only small fixes (patches) may be pushed onto this release branch. Bigger new features need to go into separate branches, merged intodevelop, and will hence end up in a later release.Tagsareonlyapplied on commits in the release branch. The first tag on a new release branch needs to bevX.Y.0, e.g.v0.12.0.
Patches (i.e. commits on the release branch) may then be tagged withvX.Y.1,vX.Y.2etc.
Pushing a 'tag' automatically triggers the Github Action for publishing the corresponding version to PyPI.
Whenever a new tag is pushed for a patch, the corresponding commit (on the release branch) should be merged intodevelop.Example list of steps for releasing a new version:(0)developcontains all the features that are needed for the release(1) updateCHANGELOG.mdwith the new version number and the changes (this will require a final PR todevelop)(2) create arelease-X.Ybranch fromdevelopand switch to this branch(3) create a tagvX.Y.0on this branch(4) push the release branch as well as the tag (pushing the tag will automatically publish to PyPI)(5) develop a small fix (patch) as a commit on therelease-X.Ybranch(6) updateCHANGELOG.mdwith the new (minor) version number and the changes(7) push the new commit and see if all the workflows (in Github Actions) succeed forrelease-X.Y(8) add a tagvX.Y.1to this latest commit(9) push the new tag; the patch will automatically be published on PyPI(10) create a pull request for mergingrelease-X.YintodevelopContributorsIn alphabetical order:Axel DahlbergCarlo Delle DonneWojciech KozlowskiMartijn PapendrechtIngmar te RaaBart van der Vecht (b.vandervecht[at]tudelft.nl)