Apply post-processing to quantum measurement counts.
This endpoint provides access to Haiqu's proprietary optimization algorithms
for post-processing QAOA/VQE measurement results.
All algorithm defaults are defined in haiqu-optimization. Users can override
any parameter by passing it in the params dictionary.
Args:
request: PostprocessRequest containing:
- lp_problem: QUBO problem serialized as LP file format
- counts: Dictionary of bitstring -> count mappings
- params: Optional parameters dict. Available options:
* method (str): Post-processing method. Default: "bitflip_incremental"
* reverse_string (bool): Whether to reverse bitstring ordering. Default: True
* postprocess_iterations (int): Number of optimization passes. Default: 5
* use_fast_eval (bool): Enable fast evaluation. Default: True
* seed (int): Random seed for reproducibility. Default: None
Returns:
PostprocessResponse with optimized costs and counts
Raises:
HTTPException: 400 if invalid problem format
HTTPException: 500 if processing fails
Example:
{
"lp_problem": "Minimize\n x0 + x1\nBinary\n x0\n x1\nEnd",
"counts": {"00": 100, "01": 50},
"params": {
"postprocess_iterations": 10,
"seed": 42
}
}