The objective evaluation service enables a service-based evaluation of quantum execution results for variational quantum algorithms (VQA).
It implements multiple cost and objective functions commonly employed in current quantum applications.
- Cost functions are used to determine the quality (cost) of each single solution measured on a quantum computer in the form of a bitstring. These functions are specific to the problem at hand, e.g., the Traveling Salesman Problem (TSP) or Maximum Cut (MaxCut) problem, and are required to process the quantum measurement results further.
- Objective functions are the basis for the parameter optimization of VQAs. They summarize the overall quality of all solutions measured during the execution in one single number called objective value, that is based on the cost and frequency of each individual solution. The objective value is used by optimizers (see here) to determine new parameter values that aim to improve the objective value and thus the overall solution quality. Therefore, objective functions heavily influence the optimization process (see here for more details). Examples include the expectation value, CVaR, and Gibbs objective function.
Additionally, the objective evaluation service contains a visualization module to generate a visualization of the most dominant solution obtained with optimized parameters, i.e., the most frequent solution. For example, for the TSP problem, the route described by this solution is highlighted in the graph.
The easiest way to get started is using a pre-built Docker image:
docker run -p 5072:5072 planqk/objective-evaluation-service
Alternatively, the application can be built manually:
- Clone the repository using
git clone https://github.com/UST-QuAntiL/objective-evaluation-service.git
- Navigate to the repository
cd objective-evaluation-service
- Build the Docker container:
docker build -t objective-evaluation-service .
- Run the Docker container:
docker run -p 5072:5072 objective-evaluation-service
Then the application can be accessed via: http://127.0.0.1:5072.
The objective evaluation service provides a Swagger UI, specifying the request schemas and showcasing exemplary requests for all API endpoints.
- Swagger UI: http://127.0.0.1:5072/api/swagger-ui.
git clone https://github.com/UST-QuAntiL/objective-evaluation-service.git
cd objective-evaluation-service
# 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
- Run the application with:
flask run --port=5072
- Test with:
python -m unittest discover
- Coverage with:
coverage run --branch --include 'app/*' -m unittest discover; coverage report
black .
OR black FILE|DIRECTORY
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.
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.
The initial code contribution has been supported by the project SEQUOIA funded by the Baden-Wuerttemberg Ministry of the Economy, Labour and Housing.