Skip to content

Commit

Permalink
Merge 2536ee8 into ae4644e
Browse files Browse the repository at this point in the history
  • Loading branch information
QFer committed Jun 1, 2021
2 parents ae4644e + 2536ee8 commit 28de44d
Show file tree
Hide file tree
Showing 45 changed files with 212 additions and 4,504 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ coverage.xml
.hypothesis/
.pytest_cache/

# Sphinx stuff
docs/build/

# Translations
*.mo
*.pot
Expand All @@ -68,13 +65,13 @@ instance/

# Sphinx documentation
docs/_build/
docs/_test/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints
*.nbconvert.ipynb

# pyenv
.python-version
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build:
image: latest

python:
version: 3.7
version: 3.9
setup_py_install: true
pip_install: true
extra_requirements:
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ matrix:
include:
- name: python 3.7
python: 3.7
if: branch = dev
sudo: true
dist: xenial
- name: python 3.8
Expand Down Expand Up @@ -39,7 +40,7 @@ deploy:
provider: pypi
user: qinspire
password:
secure: LN2iXxsoffIVmLKBuX6z273D1PpJt6zYLLF3snfkM4lzQZhNl4nLn/D0CdMb0OiMAKINzQELiKZFlH0RRXI9xsG3ErdJU3M9PcKpbGKndJ1tz92hFwy6rP1H5gwPXsx03PuiiXGGp6xZiK/BYuyzkZBjS9LRt8Z3cmjINwJSMiF8jTBfQo1sVe5eaqpDzofrCAe4VThuUsZGOpPjQsjT7xL93k8tr6soQIL8ruE6VUxscW4dAaqG+1CyRUkP8oC2SQ9TJVkYE1iI90LgwHzQEYxOzB6wwmpNZ9RM2nQ3p7eOBcn+/rbr/sc87C+exQN+lWLL32plesdVnctBxjNcfupCip66tEtx/JPqWdJvQUbRz4L2Zi2YY9wTWILn0UzIjULid6hqhe5sEoVCpjBGbCLV5E6dSRpZwsF44flLWGX5PY0nHNtE+oFReygcupxKkeOEXoFwk5GlhOzxNUGDlqWUKQuxxiGMWqmJe73hzdjUlP+VEO5dFrlQdRt4clKCZV+0kNvzxhW1GT/nxBBVermpKPIbPR019686J+pv0RFsLhZYGNGTXNc/IKCfvwhMSsF6169ue0P70AomXQXsXYNcQNAypdUGiVTIfiU6B6xVfKYKQVXu1ZqV4UxxOcSORtXAolgmGLZkc7+k8Jy8QRRY/iK3BDmsdRF2YY2p3A4=
secure: Hhiv2J3i5bU25M1QlSknneMN9ZQ0KLOf1hSrS9FkmXNQFS5EIWKbSBJYP/5DeWLsezR7SxFNql1aPF3G2QLSfztELqd3avbS5qNC5ZmooDGD/PdR5XEjnUlYrn5YtBgNq+IR+91uWaBI5TZfD9bQl7lYW5LVxH2GpI9MZrx27gytxwjfqfNOTcnn/fKDn0artCQ3V+Bnu5clEGlQagNWajuYKqSCMY2gk3r5xqHPgyt7OMWk7L2ZDLiEsN8NDx3leRPWPhwVX1CCO5CR5PHSCAdc0C7Uxy8l44DgCpx8+jeLnADh7RXsHGQfj7pBX3CtbjwERBrysNtKUB4zTzkgzBpBXoI1ffCLUOmPaMdYhXveNeAWnem6aZ2lLl9+MVikPS8laPttWcRAqzDjbdFBB6D6WHvsXAFUpEllsD3AILYpD7nOEsx9uvwKlCfcgf6fmq0z5Q6Y0Kux3/oDs4AQpAPVXmWsfnbrQkaJ0Knlho+ncgrLFymvIGmMxOee8tuj6bTeOtazvCjfoDcwjT86n6qkSUZ8g/dPKMkJox8SILFpVQzOWlIwrJMzs7X65vP25nBcHYZwI7db/e+fwOwxECHvKTHf4Bubgc7FNAK7kGcobCSeC2djA83Or3LAVen58m6YCBG+AJfRHUIEkqtN2KDIuDBZfn3r8OvT3Hd2IQA=
on:
tags: true
branch: master
Expand Down
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Quantum Inspire SDK

*Note: this SDK is made available as a public beta, please report any
issues or bugs in the github issue tracker.*
[![License](https://img.shields.io/github/license/qutech-delft/quantuminspire.svg?)](https://opensource.org/licenses/Apache-2.0)
[![Coverage Status](https://coveralls.io/repos/github/QuTech-Delft/quantuminspire/badge.svg?branch=dev)](https://coveralls.io/github/QuTech-Delft/quantuminspire?branch=dev)
[![Documentation Status](https://readthedocs.org/projects/quantum-inspire/badge/?version=latest)](https://quantum-inspire.readthedocs.io/en/latest/?badge=latest)
[![](https://img.shields.io/github/release/qutech-delft/quantuminspire.svg)](https://github.com/qutech-delft/quantuminspire/releases)
[![Downloads](https://pepy.tech/badge/quantuminspire)](https://pypi.org/project/quantuminspire/)

The Quantum Inspire platform allows to execute quantum algorithms using the cQASM language.

Expand All @@ -17,6 +20,7 @@ For more information on Quantum Inspire see
on cQASM can be found in the Quantum Inspire
[knowledge base](https://www.quantum-inspire.com/kbase/advanced-guide/).

Examples of more complex algorithms that make use of Quantum Inspire SDK can be found in [Quantum Inspire Examples](https://github.com/QuTech-Delft/quantum-inspire-examples).

## Installation

Expand Down Expand Up @@ -62,15 +66,20 @@ pip install .[qiskit,projectq]

### Installing for generating documentation
To install the necessary packages to perform documentation activities for SDK do:

```
pip install -e .[rtd]
```

To build the 'readthedocs' documentation do:

```
cd docs
make html
```

The documentation is then build in 'docs/_build/html' and can be viewed [here](docs/_build/html/index.html).

## Running

For example usage see the python scripts and Jupyter notebooks in the [docs/examples](docs/examples) directory
Expand All @@ -92,7 +101,7 @@ cd docs/examples
python example_projectq_grover.py
```

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/QuTech-Delft/quantuminspire/master?filepath=docs)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/QuTech-Delft/quantuminspire/master?filepath=docs/examples)

Another way to browse and run the available notebooks is by clicking the 'launch binder' button above.

Expand Down Expand Up @@ -204,8 +213,8 @@ qi = QuantumInspireAPI()
```
To create a token authentication object yourself using the stored token you do:
```python
from quantuminspire.credentials import get_token_authentication
auth = get_token_authentication()
from quantuminspire.credentials import get_authentication
auth = get_authentication()
```
This `auth` can then be used to initialize the Quantum Inspire API object.

Expand All @@ -220,19 +229,9 @@ coverage report -m

## Known issues

* Some test-cases call protected methods
* Known issues and common questions regarding the Quantum Inspire platform
can be found in the [FAQ](https://www.quantum-inspire.com/faq/).

## Bug reports

Please submit bug-reports [on the github issue tracker](https://github.com/QuTech-Delft/quantuminspire/issues).

## Note

If you are getting import errors related to `tests.quantuminspire` when running
the above commands after a `pip install -e .`, as a workaround you should remove
the package `tests` installed by older versions of `marshmallow-polyfield` (a Qiskit
dependency):

`rm -Rf env/lib/python3.7/site-packages/tests`
8 changes: 6 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'nbsphinx',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon', # google style docstrings
'sphinx.ext.viewcode',
'sphinx_rtd_theme',
'recommonmark'
]
Expand All @@ -46,13 +49,14 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'examples/*nbconvert.ipynb']

nbsphinx_execute = 'never'

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here,
Expand Down
26 changes: 26 additions & 0 deletions docs/examplenotebooks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Example notebooks
=================

ProjectQ examples
-----------------

.. toctree::
:maxdepth: 3
:titlesonly:
:glob:

examples/example_projectq.ipynb

Qiskit examples
---------------

.. toctree::
:maxdepth: 3
:titlesonly:
:glob:

examples/grover_algorithm_qi.ipynb
examples/qi-performance-test.ipynb


Back to the :doc:`main page <index>`.
47 changes: 19 additions & 28 deletions docs/examples.rst
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
Examples
========
Python Examples
===============

ProjectQ
--------
.. toctree::
ProjectQ examples
-----------------

..
examples/example_projectq
examples/example_projectq_entangle
examples/example_projectq_grover
A simple example that demonstrates how to use the SDK to create a circuit to create a Bell state, and simulate the
circuit on Quantum Inspire.

Qiskit
------
.. toctree::
.. literalinclude:: examples/example_projectq_entangle.py

..
examples/example_qiskit_conditional
examples/example_qiskit_entangle
An example that demonstrates how to use the SDK to create a more complex circuit to run Grover's algorithm and
simulate the circuit on Quantum Inspire.

Classifier
----------
.. literalinclude:: examples/example_projectq_grover.py

.. toctree::
Qiskit examples
---------------

..
examples/classifier_example/classification_example1_2_data_points
examples/classifier_example/classification_example2_4_data_points
examples/classifier_example/classification_example3_4_features
A simple example that demonstrates how to use the SDK to create a circuit to create a Bell state, and simulate the
circuit on Quantum Inspire.

General
-------
.. literalinclude:: examples/example_qiskit_entangle.py

.. toctree::
A simple example that demonstrates how to use the SDK to create a circuit to demonstrate conditional gate execution.

..
examples/grover_algorithm_qi
examples/qi-performance-test
.. literalinclude:: examples/example_qiskit_conditional.py

Back to the :doc:`main page <index>`.
Loading

0 comments on commit 28de44d

Please sign in to comment.