Skip to content

G-Myron/quantum-optimization-thesis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantum Optimization Algorithms - Diploma Thesis

Table of Contents

Introduction

This repository contains the code and resources for the project I developed for my Diploma Thesis.

Installation

One can install the project by running the following code:

# Clone the repository
git clone https://github.com/G-Myron/quantum-optimization-thesis.git

# Navigate to the project directory
cd quantum-optimization-thesis

# Install dependencies
pip install -r requirements.txt

Usage

To run the code for each of the three problems (knapsack, max-cut, TSP), open the terminal while inside the quantum-optimization-thesis/ and run the lines of code bellow: {The code provided is for the maxcut problem but in the same way can be excecuted any of the other problems according the project structure}

# Navigate to the specific problem's folder
cd maxcut

# Run the main script providing (optionally) a size n of the problem.
# Keep in mind that for values of n greater than a certain limit,
# the simulation of the quantum circuit will be problematic.
# It is suggested to keep n inside the following upper limits:
# n<10 for knapsack, n<16 for maxcut, n<5 for TSP.
python maxcut.py --n 6

Interactive Execution

Alternatively, open the project in VScode and use the Python Interactive window. The main files are defined in Jupyter-like code cells beggining with a # %% comment which allows them to run interactively through the VScode environment. To do that, open the problem's main file (knapsack.py, maxcut.py or tsp.py), place the cursor anywhere in the file and press Ctrl+Enter. This way is suggested for exploring the code more interactively.

Project Structure

The outline of the project's structure. There are three main directories, one for each problem.

quantum-optimization-thesis/
│   
├── knapsack/               # Knapsack code
│   ├── helper_knapsack.py
│   └── knapsack.py
│       
├── maxcut/                 # MaxCut code
│   ├── helper_maxcut.py
│   └── maxcut.py
│       
├── tsp/                    # TSP code
│   ├── helper_tsp.py
│   └── tsp.py
│   
├── energy_landscape.py
├── problem_quantum.py
├── README.md               # Readme file
└── requirements.txt        # List of dependencies

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages