qaoa

Solve Max-Cut problems with QAOA circuits using COBYLA optimization.

30|2|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/unitarylab/quantum-skills --skill qaoa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: qaoa
Source: https://github.com/unitarylab/quantum-skills/tree/main/algorithms/quantum-machine-learning/qaoa
Command: npx skills add https://github.com/unitarylab/quantum-skills --skill qaoa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unitarylab, and includes scripts (resource) components.

What problem does it solve?

This skill helps users understand, implement, and apply the Quantum Approximate Optimization Algorithm (QAOA) to Max-Cut problems, bridging theory and runnable code through a structured workflow.

Core Features & Use Cases

  • Hybrid quantum-classical optimization: builds and runs QAOA circuits with configurable depth p on a given graph.
  • End-to-end workflow: cost Hamiltonian construction, circuit mapping, COBYLA optimization, and result decoding/export.
  • Educational and prototyping use: suitable for learning, experimentation, and evaluating QAOA performance on small graphs.

Quick Start

Run the provided script to execute a QAOA Max-Cut example on a 6-node graph.

Frequently Asked Questions about qaoa

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I solve the Max-Cut problem using QAOA in Python?

To solve Max-Cut using QAOA, this script constructs a cost Hamiltonian, maps it to a quantum circuit with configurable depth, and runs COBYLA optimization to find the graph partition. It provides an end-to-end workflow from circuit construction to result decoding.

What is a hybrid quantum-classical workflow for graph optimization?

A hybrid quantum-classical workflow for graph optimization builds parameterized quantum circuits to evaluate cost functions while a classical optimizer updates parameters. This approach applies QAOA to find approximate solutions for graph-based problems like Max-Cut.

Can I configure the circuit depth and backend for QAOA optimization?

Yes, you can configure the circuit depth parameter p and select backends for QAOA optimization. The implementation allows tuning the gate sequence construction and running the COBYLA optimizer across different simulation environments.

Do I need the UnitaryLab QAOA implementation to run this algorithm?

Yes, you need the UnitaryLab QAOAAlgorithm implementation and Python installed to run this skill. It provides the core circuit construction, COBYLA optimizer integration, and circuit export functions required for the workflow.

Is this QAOA implementation suitable for large graph optimization tasks?

This QAOA implementation is designed for educational learning and prototyping on small graphs, such as a 6-node example. It is not intended for large-scale graph optimization tasks due to the computational limits of simulating deep quantum circuits.

How does the COBYLA optimizer work with QAOA circuits?

The COBYLA optimizer works with QAOA by classically tuning the parameterized gate angles in the quantum circuit to minimize the cost Hamiltonian. This hybrid loop repeats until the algorithm converges on an approximate Max-Cut solution.