# Halowerk Quantum Portfolio QAOA Optimizer

> Halowerk Quantum Portfolio QAOA Optimizer is a paid API for AI agents from quantum.halowerk.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Finds the optimal subset of exactly k assets (up to 16) that maximizes expected return minus a risk-aversion-weighted covariance penalty, returning a deterministic classical solution for benchmarking QAOA/QUBO quantum formulations.

## Facts

- Endpoint: POST https://quantum.halowerk.com/v1/portfolio-qaoa
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/halowerk-quantum-portfolio-qaoa-optimizer-abed29b8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_A1x8FXL7Cp73BKIC6VGVl

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability halowerk-quantum-portfolio-qaoa-optimizer-abed29b8 -d '<json body>'
```

Example prompt: I have 6 assets — TechA (12% expected return), TechB (9%), BondX (3%), BondY (4%), GoldZ (7%), CryptoQ (18%) — and I want to pick exactly 3 to maximize return minus risk. Use a risk aversion of 0.5 and the covariance matrix I'll paste in. Give me the classically optimal subset for benchmarking against my QAOA circuit.

## When to prefer this

Choose this endpoint when you need an exact, deterministic classical optimum for a binary k-of-n portfolio selection problem with up to 16 assets, especially to validate or benchmark QAOA or QUBO quantum circuit results. It is not suitable for large asset universes (>16), for continuous-weight allocation, for real investment decisions, or when transaction costs and position sizing matter.

## Known failure modes

- assets array has fewer than select_count items — solver cannot select k from n<k
- covariance matrix dimensions do not match number of assets — shape mismatch error
- select_count exceeds 16 or assets exceed 16 — violates hard upper bound
- expected_return or covariance values outside allowed numeric range — validation error
- risk_aversion is negative — rejected by schema minimum of 0
- missing required fields (name or expected_return on any asset) — schema validation failure

## How this service works

Enumerates every selection of exactly k assets for at most 16 assets, maximizing summed expected return minus a caller-selected covariance penalty. It runs no quantum circuit and provides a deterministic classical optimum for testing a corresponding binary QAOA or QUBO formulation; it is not investment advice and ignores transaction costs and allocation sizes.

## Output

Returns the set of exactly k selected asset names that maximizes the objective (sum of expected returns minus risk_aversion times the portfolio covariance term), along with the numeric objective value achieved. This is a deterministic classical optimum useful for validating or benchmarking QAOA and QUBO quantum results.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "assets": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "name",
     "expected_return"
    ],
    "properties": {
     "name": {
      "type": "string",
      "maxLength": 64,
      "minLength": 1
     },
     "expected_return": {
      "type": "number",
      "maximum": 1000,
      "minimum": -1000
     }
    },
    "additionalProperties": false
   },
   "maxItems": 16,
   "minItems": 1
  },
  "covariance": {
   "type": "array",
   "items": {
    "type": "array",
    "items": {
     "type": "number",
     "maximum": 1000000,
     "minimum": -1000000
    },
    "maxItems": 16,
    "minItems": 1
   },
   "maxItems": 16,
   "minItems": 1
  },
  "select_count": {
   "type": "integer",
   "maximum": 16,
   "minimum": 1
  },
  "risk_aversion": {
   "type": "number",
   "maximum": 1000000,
   "minimum": 0
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/halowerk-quantum-portfolio-qaoa-optimizer-abed29b8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from quantum.halowerk.com](https://www.zero.xyz/host/quantum.halowerk.com/llms.txt)
