Skip to content

Quantum circuit generator API specification and implementation repository.

License

Notifications You must be signed in to change notification settings

UST-QuAntiL/quantum-circuit-generator

Repository files navigation

Quantum Circuit Generator

Tests passed License Code style: black codecov

The quantum circuit generator enables service-based generation of quantum circuit fragments via a REST API.

It implements a selection of commonly used encodings, algorithms, and algorithm fragments:

  • Encodings are used to encode classical data for a quantum computer. The following encodings are currently supported by the quantum circuit generator:
  • Quantum algorithms can solve difficult problems efficiently on a quantum computer. Currently, the following algorithms are supported:
    • QAOA for the Maximum Cut (MaxCut) and Traveling Sales Person (TSP) problems
    • HHL algorithm to solve systems of linear equations
    • VQE for approximating the lowest eigenvalue of a matrix

Running the Service

The easiest way to get start is using a pre-built Docker image:

docker run -p 5073:5073 planqk/quantum-circuit-generator

Alternatively, the service can be built manually:

  1. Clone the repository using git clone https://github.com/UST-QuAntiL/quantum-circuit-generator.git
  2. Navigate to the repository cd quantum-circuit-generator
  3. Build the Docker container: docker build -t quantum-circuit-generator .
  4. Run the Docker container: docker run -p 5073:5073 quantum-circuit-generator

Then the service can be accessed via: http://127.0.0.1:5073.

API Documentation

The quantum circuit generator service provides a Swagger UI, specifying the request schemas and showcasing exemplary requests for all API endpoints.

Developer Guide

Setup (exemplary for ubuntu 18.04):

git clone https://github.com/UST-QuAntiL/quantum-circuit-generator.git
cd quantum-circuit-generator

# if virtualenv is not installed
sudo -H pip install virtualenv

# create new virtualenv called 'venv'
virtualenv venv

# activate virtualenv; in Windows systems activate might be in 'venv/Scripts'
source venv/bin/activate

#install application requirements.
pip install -r requirements.txt

Execution:

  • Run the application with: flask run --port=5073
  • Test with: python -m unittest discover
  • Coverage with: coverage run --branch --include 'app/*' -m unittest discover; coverage report

Codestyle:

black . OR black FILE|DIRECTORY

Disclaimer of Warranty

Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.

Haftungsausschluss

Dies ist ein Forschungsprototyp. Die Haftung für entgangenen Gewinn, Produktionsausfall, Betriebsunterbrechung, entgangene Nutzungen, Verlust von Daten und Informationen, Finanzierungsaufwendungen sowie sonstige Vermögens- und Folgeschäden ist, außer in Fällen von grober Fahrlässigkeit, Vorsatz und Personenschäden, ausgeschlossen.

Acknowledgements

The initial code contribution has been supported by the project SEQUOIA funded by the Baden-Wuerttemberg Ministry of the Economy, Labour and Housing.