Compute Circuit Analytics
Start an analytics job for a stored circuit.
Use this tool when a circuit has no analytics yet, or only core metrics, and the workflow needs quality metrics or an evolution snapshot. Haiqu-generated circuits from data loading, state compression, and transpilation frequently arrive without advanced analytics computed.
When to Use:
- Call this when
get_circuit_by_idreturnsanalytics: nullor lacks the advanced quality metrics the caller asked about. - Call this before comparing a circuit against reference benchmarks.
Constraints:
- Analytics run asynchronously; this tool returns a job reference, not
metric values. Poll with
get_job_results_and_statusand then read the metrics withget_circuit_by_idorget_circuit_metrics_evolution. - A pending job for the same circuit and analytics type is reused instead of duplicated.
Notes:
corecovers qubits, depth, and gate counts;advancedcovers the quality metrics compared against reference benchmarks; andevolutionrecords a snapshot forget_circuit_metrics_evolution.
Args: user: Authenticated user resolved from the API key. data: Payload naming the circuit and the analytics family to compute. db: Active database session.
Returns: A context wrapper naming the analytics job and the next polling step.
Raises:
HTTPException: Raised with 404 when the circuit is not available to
the caller.
Authorizations
Body
Define payload for explicitly triggering circuit analytics computation.
Attributes: circuit_id: Circuit to analyze. analytics_type: Analytics family to compute.
Analytics family to compute. Use core for qubits, depth, and gate counts, advanced for the quality metrics used against reference benchmarks (program communication, critical depth, entanglement ratio, parallelism, liveness), and evolution to record a metrics snapshot readable through get_circuit_metrics_evolution.
core, advanced, evolution Response
Successful Response
Represent context returned after requesting analytics computation.
Attributes: context: Summary of the submission and the next polling step. Analytics run asynchronously, so this response does not carry metric values.