This is a simple API that demonstrates quantum-inspired optimization using the Quantum Approximate Optimization Algorithm (QAOA) to solve the MaxCut problem. It uses Qiskit for quantum circuit simulation and FastAPI for creating the API.
- Clone the repository:
git clone https://github.com/kyoo-log/QIOS.git
(replace with your repo URL) - Create a virtual environment (recommended):
python -m venv .venv
- Activate the virtual environment:
- Windows:
.venv\Scripts\activate
- macOS/Linux:
source .venv/bin/activate
- Windows:
- Install dependencies:
pip install -r requirements.txt
- Run the API:
uvicorn main:app --reload
Send a POST request to /max_cut
with a JSON payload containing the adjacency matrix of the graph and the number of QAOA layers (p
).
Example Request:
{
"graph": [[0, 1, 1], [1, 0, 1], [1, 1, 0]],
"p": 2
}