Introduction

Welcome to the Quantum Inspire Examples. This introduction will shortly introduce the repository, and it will guide you through the structure, installation process and how to contribute. We look forward to working with you!

The Quantum Inspire Examples consist of a number of Jupyter notebooks and python scripts with a diverse set of Quantum algorithms that illustrate the possibilities of the Quantum Inspire platform to run more complex algorithms. The Quantum Inspire examples make use of:

For more information on Quantum Inspire see https://www.quantum-inspire.com/. Detailed information can be found in the Quantum Inspire knowledge base.

Quantum Inspire is developed by QuTech QuTech is an advanced research center based in Delft, the Netherlands, for quantum computing and quantum internet. It is a collaboration founded by the Delft University of Technology (TU Delft) and the Netherlands Organisation for Applied Scientific Research (TNO).

Installing from source

The source for the Quantum Inspire examples can be found at Github. For the default installation execute:

git clone https://github.com/QuTech-Delft/quantum-inspire-examples
cd quantum-inspire-examples
git submodule update --init
pip install .

This will install everything necessary to run the examples, the Quantum Inspire SDK including the Qiskit and ProjectQ packages.

Installing for generating documentation

To install the necessary packages to perform documentation activities:

pip install .[rtd]

The documentation generation process is dependent on pandoc. When you want to generate the documentation and pandoc is not yet installed on your system navigate to Pandoc and follow the instructions found there to install pandoc. To build the ‘readthedocs’ documentation do:

cd docs
make html

The documentation is then build in ‘docs/_build/html’.

Running

For example usage see the python scripts in the docs/examples/ directory and Jupyter notebooks in the docs/notebooks/ directory when installed from source.

For example, to run the ProjectQ example notebook after installing from source:

cd docs/notebooks
jupyter notebook example_projectq.ipynb

or when you want to choose which example notebook to run from the browser do:

jupyter notebook --notebook-dir="docs/notebooks"

and select a Jupyter notebook (file with extension ipynb) to run from one of the directories.

Configure your token credentials for Quantum Inspire

To make use of Quantum Inspire requires you to register and create an account. To prevent submitting your credentials with each example you can make use of token authentication.

  1. Create a Quantum Inspire account at https://www.quantum-inspire.com/ if you do not already have one.

  2. Get an API token from the Quantum Inspire website https://www.quantum-inspire.com/account.

  3. With your API token run:

from quantuminspire.credentials import save_account
save_account('YOUR_API_TOKEN')

After calling save_account, your credentials will be stored on disk and token authentication is done automatically in many of the examples.