{"uid":"cap_A1x8FXL7Cp73BKIC6VGVl","slug":"halowerk-quantum-portfolio-qaoa-optimizer-abed29b8","name":"Halowerk Quantum Portfolio QAOA Optimizer","description":"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.","url":"https://quantum.halowerk.com/v1/portfolio-qaoa","method":"POST","headers":{},"bodySchema":{"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}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lq-taHbBK2Blg3KT4yRb3","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Benchmarking a QAOA quantum circuit","prompt":"I'm testing a QAOA circuit for portfolio selection and need the classical brute-force optimum to compare against. I have 8 assets with expected returns ranging from 2% to 15%, a full 8x8 covariance matrix, I want to select exactly 4 assets, and my risk aversion is 1.0. Can you run the classical optimizer and tell me which 4 assets are optimal?"},{"title":"Risk-adjusted subset selection for research","prompt":"For my finance research I need to find the best 5 assets out of 12 candidates to maximize expected return minus a covariance penalty. Here are the expected returns and covariance matrix for all 12. Set risk aversion to 2.0 and give me the optimal combination."},{"title":"QUBO formulation validation","prompt":"I'm building a QUBO model for binary portfolio selection and need a ground-truth answer. I have 10 assets with known expected returns and a 10x10 covariance matrix — pick exactly 3 assets, risk aversion 0.8. What does the classical exhaustive search say the optimal portfolio is?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:44:35.282Z","isFirstParty":false}