Giter Club home page Giter Club logo

qc-configuration-problem's Introduction

Quantum Banner

Python

Addressing the Configuration Problem via Quantum Computing

Installation

Install python 3.9. Ideally, you should use a virtual environment for this project. Clone (or download) this repository and install the requirements via pip:

pip install -r requirements.txt

Quantum Approximate Optimization Algorithm (QAOA)

This repository contains code and data for applying QAOA to different instances and solving configuration selection and prioritization problems.

There are multiple Jupyter notebooks in this repository (all inside the configproblem/qaoa directory):

The first two notebooks contain detailed explanations of the algorithm and examples.

The accompanying python file of the first two notebooks (qaoa_mincost_sat.py and qaoa_mincost_k_sat.py) contains the different implementations of the phase seperating operator $U_C$ for the QUBO / PUBO formulation.

Additionally, you can use evaluation.py to run the QAOA algorithm on a set of DIMACS files and save and process the results.

Grover's Algorithm

This repository contains code and data for applying Grover's Algorithm to retrieve uniform random configuration samples. See the Jupyter notebook grover_sat.ipynb.

Usage

  1. Navigate to the root directory of this repository inside a terminal.
  2. If you have a virtual environment set up, activate it.

Notebooks

  1. Run the jupyter notebook command. A browser window should open up.
  2. In the browser window, navigate to the configproblem directory for the notebook about Grover's algorithm or to the configproblem/qaoadirectory for the notebooks about QAOA and open the notebook you want to run.

Evaluation of QAOA using DIMACS files

Run python -m configproblem.qaoa.evaluation <args> with the following arguments:

  • --first <index> - Index of the first file to evaluate
  • --last <index> - Index of the last file to evaluate
  • --skip-quso - Skip running QAOA for the QUSO/QUBO formulation
  • --skip-puso - Skip running QAOA for the PUSO/PUBO formulation
  • --save-individual-results - Save the results of each file in a separate file (so you can terminate the program before it finishes)
  • -f <filename> - Process the results of a previous run (saved in a file)
  • --linux - Use this flag to use Linux file paths (default is Windows)

DIMACS files have to be placed in the benchmarks/qaoa-feature-models directory and have to be named feature_model_<index>.dimacs where <index> is the index of the file.

The files currently in the directory are the ones we used for our evaluation.

Results will be saved in benchmarks/qaoa-feature-models/results.

Other repositories

Here is a list of tools that we used during our evaluation:

  • FeatureIDE for generating feature models.
  • Qiskit for creating and simulating quantum circuits.
  • Qubovert for conversion from and to QUBO and PUBO models.

qc-configuration-problem's People

Contributors

cauterium avatar jooshua avatar

Stargazers

Marwin Kadner avatar

qc-configuration-problem's Issues

Investigate impact of different properties of SAT instances

Add functionality for evaluating a list of multiple instances at once and create a set of different SAT instances in order to investigate the impact of different instance properties such as number of clauses, number of variables and number of variables within each clause.

QAOA Evaluation

  • Add evaluation data structure to save results of QAOA run
  • Add evaluation post processing
  • Add evaluation runner

Investigate configuration priorization

Create a ordered list of n configurations that starting with minimal cost (ascending)

One approach may be to have multiple QAOA runs and add a term to the Hamiltionan that excludes the best configuration of the previous run

Update project setup

  • Update folder structure
  • Add github actions:
    • Execute tests
    • Lint + TODO check
    • Autoformat
  • Rename repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.