Transpile Circuits
Submit one or more circuits for transpilation on a target backend.
Use this tool when the caller needs backend-aware transpilation before
execution, comparison, or further circuit analysis. The request accepts
existing circuit_ids or inline circuits_qasm. When QASM is
supplied, the endpoint creates persistent circuit records associated with
the experiment before submitting the transpilation job.
When to Use:
- Call this after
list_qpus_and_simulatorsreturns a validdevice_idfor the target backend. - Call this when the user wants transpiled circuit IDs, not immediate final circuits inline.
Constraints:
- Provide at least one of
circuit_idsorcircuits_qasm. device_idshould be passed exactly as returned bylist_qpus_and_simulators.- The response is a lightweight context wrapper; use
get_job_results_and_statusto retrieve terminal outputs such astranspiled_circuit_ids.
Notes:
transpilation_optionsis forwarded to the backend-facing transpilation path and may contain device-specific settings.- Circuits created from inline QASM are stored under the experiment so they remain visible in Haiqu UI flows and later MCP calls.
Args: user: Authenticated user resolved from the API key. data: Transpilation payload containing the experiment scope, target backend, existing circuit IDs and/or inline QASM circuits, and optional transpilation settings. db: Active database session.
Returns: A lightweight context wrapper summarizing the created transpilation job and the next polling step.
Raises:
HTTPException: Raised with 400 when neither circuit_ids nor
circuits_qasm is provided, 402 when the caller cannot
submit billable jobs, or 404 when the experiment is not
available to the caller.
Authorizations
Body
Define payload for MCP transpilation submissions.
This model extends :class:haiqu.sdk.schemas.SubmitTranspilationModel with
optional inline QASM input so agents can submit and transpile circuits in
one operation.
Attributes:
experiment_id: Parent experiment identifier for the transpilation job.
circuit_ids: Existing stored circuit IDs to transpile. Use either this
field or circuits_qasm.
circuits_qasm: Inline QASM circuits to persist and transpile in one
step.
device_id: Backend identifier returned by
list_qpus_and_simulators.
transpilation_options: Optional backend-specific transpilation options
forwarded to the underlying transpilation path.
name: Optional job name inherited from the SDK model.
description: Optional plain-text job description inherited from the SDK
model.
Backend-specific transpilation options. For example: {'optimization_level': 2}.
List of quantum circuits in QASM 2.0 or 3.0 format. Use either this field or circuit_ids field to specify the existing circuits IDs to transpile.
Response
Successful Response
Represent context payload returned after transpilation job creation.
Attributes:
context: Submission summary text including the created job ID, the
input circuit references, and the next polling step. This response
model does not expose structured job_id or
transpiled_circuit_ids fields outside the text payload.