curl --request POST \ --url 'https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY=' \ --header 'Content-Type: application/json' \ --data '{ "circuit_qasm": "OPENQASM 3;\nqubit[2] q;\nh q[0];\ncx q[0], q[1];", "context": "Persist this Bell-state circuit so it can be executed and compared after compression.", "description": "Simple entangling circuit used for analytics and run tests.", "experiment_id": "exp-123", "name": "Bell state"}'
import requests
url = "https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY="
payload = {
"circuit_qasm": "OPENQASM 3;
qubit[2] q;
h q[0];
cx q[0], q[1];",
"context": "Persist this Bell-state circuit so it can be executed and compared after compression.",
"description": "Simple entangling circuit used for analytics and run tests.",
"experiment_id": "exp-123",
"name": "Bell state"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
circuit_qasm: 'OPENQASM 3;\nqubit[2] q;\nh q[0];\ncx q[0], q[1];',
context: 'Persist this Bell-state circuit so it can be executed and compared after compression.',
description: 'Simple entangling circuit used for analytics and run tests.',
experiment_id: 'exp-123',
name: 'Bell state'
})
};
fetch('https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'circuit_qasm' => 'OPENQASM 3;
qubit[2] q;
h q[0];
cx q[0], q[1];',
'context' => 'Persist this Bell-state circuit so it can be executed and compared after compression.',
'description' => 'Simple entangling circuit used for analytics and run tests.',
'experiment_id' => 'exp-123',
'name' => 'Bell state'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY="
payload := strings.NewReader("{\n \"circuit_qasm\": \"OPENQASM 3;\\nqubit[2] q;\\nh q[0];\\ncx q[0], q[1];\",\n \"context\": \"Persist this Bell-state circuit so it can be executed and compared after compression.\",\n \"description\": \"Simple entangling circuit used for analytics and run tests.\",\n \"experiment_id\": \"exp-123\",\n \"name\": \"Bell state\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.post("https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY=")
.header("Content-Type", "application/json")
.body("{\n \"circuit_qasm\": \"OPENQASM 3;\\nqubit[2] q;\\nh q[0];\\ncx q[0], q[1];\",\n \"context\": \"Persist this Bell-state circuit so it can be executed and compared after compression.\",\n \"description\": \"Simple entangling circuit used for analytics and run tests.\",\n \"experiment_id\": \"exp-123\",\n \"name\": \"Bell state\"\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"circuit_qasm\": \"OPENQASM 3;\\nqubit[2] q;\\nh q[0];\\ncx q[0], q[1];\",\n \"context\": \"Persist this Bell-state circuit so it can be executed and compared after compression.\",\n \"description\": \"Simple entangling circuit used for analytics and run tests.\",\n \"experiment_id\": \"exp-123\",\n \"name\": \"Bell state\"\n}"
response = http.request(request)
puts response.read_body
Submit a QASM circuit and persist core analytics for MCP workflows.
Use this tool when the caller has experiment_id plus circuit_qasm
and needs a persisted circuit before running, compressing, transpiling, or
inspecting related jobs. The endpoint computes and stores core analytics
such as qubit count, depth, and gate counts, and it deduplicates by circuit
hash within the authenticated user and experiment scope.
The returned object is a ContextCircuitModel, which represents a
persisted Haiqu circuit entity for MCP and API workflows rather than a raw
Qiskit QuantumCircuit instance. This Haiqu model carries stable IDs,
experiment ownership, stored analytics, and MCP context so later tools can
reference the circuit directly without serializing or passing around the
in-memory Qiskit circuit object itself.
When to Use:
Call this when a workflow starts from inline QASM and needs a stable
circuit_id for later MCP tools.
Call this before run_circuits_on_qpu_or_simulator or
compress_circuit_with_state_compression when the circuit is not
already stored.
Large circuits:
There is no practical size limit on circuit_qasm; payloads of
thousands of QASM lines (tens of KB) are normal. Submit the requested
circuit exactly as generated — never substitute a smaller instance
because the payload looks large. Send the QASM once here and pass the
returned circuit_id to every later transpilation, compression, or
run call so the payload never needs to be re-sent.
Constraints:
experiment_id must refer to an accessible experiment owned by the
authenticated caller.
Circuit deduplication is hash-based within the caller and experiment
scope, so this route may return an existing circuit instead of
creating a new row.
Notes:
The response is the full ContextCircuitModel object, not a
lightweight acknowledgment wrapper.
For agent-facing output, surface id, name, and the key
analytics fields instead of repeating the raw QASM payload.
Args:
user: Authenticated user resolved from the API key.
data: Circuit payload containing the parent experiment ID, QASM source,
and optional MCP context text.
db: Active database session.
Returns:
The created or reused circuit object.
Raises:
HTTPException: Raised with 400 when the QASM payload cannot be
parsed, or 404 when the parent experiment is not available to
the caller.
POST
/
ai
/
submit_circuit_for_analytics
Submit Circuit For Analytics
curl --request POST \ --url 'https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY=' \ --header 'Content-Type: application/json' \ --data '{ "circuit_qasm": "OPENQASM 3;\nqubit[2] q;\nh q[0];\ncx q[0], q[1];", "context": "Persist this Bell-state circuit so it can be executed and compared after compression.", "description": "Simple entangling circuit used for analytics and run tests.", "experiment_id": "exp-123", "name": "Bell state"}'
import requests
url = "https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY="
payload = {
"circuit_qasm": "OPENQASM 3;
qubit[2] q;
h q[0];
cx q[0], q[1];",
"context": "Persist this Bell-state circuit so it can be executed and compared after compression.",
"description": "Simple entangling circuit used for analytics and run tests.",
"experiment_id": "exp-123",
"name": "Bell state"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
circuit_qasm: 'OPENQASM 3;\nqubit[2] q;\nh q[0];\ncx q[0], q[1];',
context: 'Persist this Bell-state circuit so it can be executed and compared after compression.',
description: 'Simple entangling circuit used for analytics and run tests.',
experiment_id: 'exp-123',
name: 'Bell state'
})
};
fetch('https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'circuit_qasm' => 'OPENQASM 3;
qubit[2] q;
h q[0];
cx q[0], q[1];',
'context' => 'Persist this Bell-state circuit so it can be executed and compared after compression.',
'description' => 'Simple entangling circuit used for analytics and run tests.',
'experiment_id' => 'exp-123',
'name' => 'Bell state'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY="
payload := strings.NewReader("{\n \"circuit_qasm\": \"OPENQASM 3;\\nqubit[2] q;\\nh q[0];\\ncx q[0], q[1];\",\n \"context\": \"Persist this Bell-state circuit so it can be executed and compared after compression.\",\n \"description\": \"Simple entangling circuit used for analytics and run tests.\",\n \"experiment_id\": \"exp-123\",\n \"name\": \"Bell state\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.post("https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY=")
.header("Content-Type", "application/json")
.body("{\n \"circuit_qasm\": \"OPENQASM 3;\\nqubit[2] q;\\nh q[0];\\ncx q[0], q[1];\",\n \"context\": \"Persist this Bell-state circuit so it can be executed and compared after compression.\",\n \"description\": \"Simple entangling circuit used for analytics and run tests.\",\n \"experiment_id\": \"exp-123\",\n \"name\": \"Bell state\"\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.example.com/ai/submit_circuit_for_analytics?HAIQU_API_KEY=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"circuit_qasm\": \"OPENQASM 3;\\nqubit[2] q;\\nh q[0];\\ncx q[0], q[1];\",\n \"context\": \"Persist this Bell-state circuit so it can be executed and compared after compression.\",\n \"description\": \"Simple entangling circuit used for analytics and run tests.\",\n \"experiment_id\": \"exp-123\",\n \"name\": \"Bell state\"\n}"
response = http.request(request)
puts response.read_body
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Haiqu","description":"Haiqu is a quantum computing software company building a full-stack quantum intelligence platform for enterprise, research, and developer teams.\n\nHaiqu helps quantum R\u0026D teams move from application ideas to executable prototypes and run frontier quantum workloads on real quantum hardware. The platform combines agentic R\u0026D workflows, Haiqu SDK optimization, and runtime orchestration to improve quantum application development, circuit performance, and execution cost. AI agents: The agent orientation is installed to ``haiqu/sdk/AGENTS.md``, and can also be found at https://github.com/haiqu-ai/haiqu-sdk/blob/main/haiqu/sdk/AGENTS.md","colors":{"primary":"#000000","light":"#CDE9F7","dark":"#092382"},"logo":{"light":"https://mintcdn.com/haiqu/naR3-ajV6yLCfg5I/logo/logo-text-black.svg?fit=max\u0026auto=format\u0026n=naR3-ajV6yLCfg5I\u0026q=85\u0026s=2010ac2de39f76a994323bd9afa6aec1","dark":"https://mintcdn.com/haiqu/naR3-ajV6yLCfg5I/logo/logo-text-white.svg?fit=max\u0026auto=format\u0026n=naR3-ajV6yLCfg5I\u0026q=85\u0026s=826f72d62ee230ca75fe7311455a4012"},"favicon":"https://mintcdn.com/haiqu/QnjSg02a6HjnZweN/logo/logo_black.svg?fit=max\u0026auto=format\u0026n=QnjSg02a6HjnZweN\u0026q=85\u0026s=ff388300b90ced457ceff179ec9ca3a9","navbar":{"links":[{"href":"https://feedback.haiqu.ai","label":"Support"}],"primary":{"type":"button","label":"Request Platform Demo","href":"https://haiqu.ai/contactform"}},"footer":{"socials":{"github":"https://github.com/haiqu-ai","linkedin":"https://linkedin.com/company/haiquai"}},"seo":{"indexing":"all"},"fonts":{"heading":{"family":"SuisseIntlMono","weight":400,"source":"fonts/SuisseIntlMono-Regular-WebS.woff2","format":"woff2"},"body":{"family":"Softcore","weight":400,"source":"fonts/Softcore-Regular.woff2","format":"woff2"}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"haiqu","hasAudioNarration":false,"actualSubdomain":"haiqu","customDomains":["docs.haiqu.ai"],"gitSource":{"type":"github","owner":"haiqu-ai","repo":"sdk-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adb26c9935ad58d7118117b","collectionId":"093b7692-2a93-43ec-b5d6-290798aa7f23","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adb26c9935ad58d7118117b"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6adb26c9935ad58d7118117b","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"default","tag":"API Reference","count":178},{"language":"default","tag":"SDK Reference","count":34},{"language":"default","tag":"Guides","count":31},{"language":"default","tag":"Core features","count":17},{"language":"default","tag":"Data loading","count":9},{"language":"default","tag":"Dashboard","count":8},{"language":"default","tag":"Core platform functions","count":8},{"language":"default","tag":"Circuit Execution","count":5},{"language":"default","tag":"SKQD","count":5},{"language":"default","tag":"Catalog","count":4}]},"assistantConfig":{},"hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"@font-face{font-family:\"SkandiaSN\";src:url(/fonts/SkandiaSN-Regular.woff2) format(\"woff2\");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:\"SkandiaSN\";src:url(/fonts/SkandiaSN-Bold.woff2) format(\"woff2\");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:\"Softcore\";src:url(/fonts/Softcore-Regular.woff2) format(\"woff2\");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:\"Softcore\";src:url(/fonts/Softcore-RegularItalic.woff2) format(\"woff2\");font-weight:400;font-style:italic;font-display:swap}@font-face{font-family:\"Softcore\";src:url(/fonts/Softcore-Bold.woff2) format(\"woff2\");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:\"Softcore\";src:url(/fonts/Softcore-BoldItalic.woff2) format(\"woff2\");font-weight:700;font-style:italic;font-display:swap}@font-face{font-family:\"SuisseIntlMono\";src:url(/fonts/SuisseIntlMono-Regular-WebS.woff2) format(\"woff2\");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:\"SuisseIntlMono\";src:url(/fonts/SuisseIntlMono-Regular-WebXL.woff2) format(\"woff2\");font-weight:400;font-style:normal;font-display:swap}.code,code,pre{font-family:\"SuisseIntlMono\",monospace}:root{--primary-light:196 213 255;--primary-color:#000000;--light-color:#C4D5FF;--dark-color:#093188;--font-family-suisse-intl-mono:\"SuisseIntlMono\", monospace;--font-family-skandia-sn:\"SkandiaSN\", sans-serif;--font-family-softcore:\"Softcore\", sans-serif}h1,h2,h3,h4,h5,h6{font-family:var(--font-family-suisse-intl-mono)}.case-studies .card-group .card{display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:0;padding:1.25rem 1.5rem;border:1px solid rgba(0,0,0,.12);border-radius:1rem}.case-studies .card-group .card:hover{border-color:#000}.case-studies .card-group .card>[data-component-part=card-content-container],.case-studies .card-group .card>[data-component-part=card-content-container]>a,.case-studies .card-group .card>[data-component-part=card-content-container]>a>.w-full{display:contents}"},{"filePath":"styles/content.css","content":".sidebar-group-header{padding-left:0}#sidebar-title,.eyebrow,.sidebar-group>li{text-transform:uppercase;letter-spacing:1px;font-size:12px}.eyebrow,.sidebar-group>li{font-family:var(--font-family-suisse-intl-mono);font-size:10px}.sidebar-group>li>a{padding:9px!important;border-radius:5px!important;line-height:1.5}[data-callout-type=check],[data-callout-type=note],[data-callout-type=tip]{background-color:var(--light-color)!important;border-color:var(--dark-color)!important}[data-callout-type=check] strong,[data-callout-type=check] svg,[data-callout-type=check]>div,[data-callout-type=note] strong,[data-callout-type=note] svg,[data-callout-type=note]>div,[data-callout-type=tip] strong,[data-callout-type=tip] svg,[data-callout-type=tip]>div,[data-component-part=callout-content] h3{color:var(--dark-color)!important}"},{"filePath":"styles/footer.css","content":"#footer{padding:1rem 0}"},{"filePath":"styles/main.css","content":"#navbar~div:has(#content-container){max-width:92rem;padding:0 3rem}#content-container:has([data-page-title=Changelog]){max-width:50rem;margin:0 auto}.changelog-inline-dates .update{flex-direction:column!important;align-items:stretch!important;gap:0!important}.changelog-inline-dates [data-component-part=update-content]>*{min-width:0;overflow-wrap:anywhere}.changelog-inline-dates .update:first-child{padding-top:0}.changelog-inline-dates .update>div,.changelog-inline-dates [data-component-part=update-content]{display:contents}.changelog-inline-dates .update>div:first-child>.absolute,.changelog-inline-dates [data-component-part=update-description]{display:none}.changelog-inline-dates [data-component-part=update-content]>:not(h1,h2,h3,h4){margin-bottom:0!important}.changelog-inline-dates [data-component-part=update-content]>h1{order:-1;margin-bottom:.5rem}.changelog-inline-dates [data-name=frame]{max-width:48rem;margin-inline:auto}.changelog-inline-dates [data-component-part=update-label]{align-self:flex-start;padding:0;background:0 0;font-family:var(--font-family-suisse-intl-mono);font-size:12px;letter-spacing:1px;text-transform:uppercase}#content{margin:32px 0 0}.main-page-title-block h1{font-family:var(--font-family-softcore);font-weight:200;font-size:34px;margin-top:0}.main-page-title-block p{font-family:var(--font-family-softcore);font-weight:400;font-size:15px}.card-group .card{border:0;border-radius:0}.card-group .card>[data-component-part=card-content-container]{padding:1rem 0}.card-group .card>[data-component-part=card-content-container] h2{font-weight:400;margin-bottom:1rem;font-size:14px;letter-spacing:1px}.card-group .card>[data-component-part=card-content-container] [data-component-part=card-content]{font-family:var(--font-family-skandia-sn);font-weight:400;font-size:14px}#quick-navigation{background-color:var(--dark-color);color:#fff;font-size:10px;letter-spacing:1px;border:0;border-radius:5px!important;line-height:1.5;padding:10px;display:inline-block;text-transform:uppercase;font-weight:400}"},{"filePath":"styles/navbar.css","content":"#assistant-entry,#search-bar-entry{text-transform:uppercase;font-family:var(--font-family-suisse-intl-mono);height:32px}#search-bar-entry{background-color:#f1efed;border:0;box-shadow:none;border-radius:6px}#search-bar-entry>div>div,#search-bar-entry>span{font-size:10px;color:var(--primary-color);letter-spacing:1px}#search-bar-entry svg,#topbar-cta-button>a svg{display:none}#assistant-entry{padding:7px 9px}#assistant-entry>span,#topbar-cta-button>a{font-size:10px;line-height:1.5}#assistant-entry,#topbar-cta-button>a{border-radius:5px!important;letter-spacing:1px}#topbar-cta-button>a{border:0;padding:9px}#topbar-cta-button>a>span{border-radius:5px}.nav-tabs>a{font-weight:400;text-shadow:none}#mobile-nav button>span,#navbar button div,#navbar button span,.nav-tabs>a,[role=menu]>a,nav a,nav button{font-family:var(--font-family-suisse-intl-mono);letter-spacing:1px;text-transform:uppercase;font-size:10px}#navbar button div,#navbar button span{font-size:10px!important}"}],"page":{"pagePath":"api-reference/submit-circuit-for-analytics","slug":"/api-reference/submit-circuit-for-analytics","pageMetadata":{"title":"Submit Circuit For Analytics","description":"Submit a QASM circuit and persist core analytics for MCP workflows.\n\nUse this tool when the caller has ``experiment_id`` plus ``circuit_qasm``\nand needs a persisted circuit before running, compressing, transpiling, or\ninspecting related jobs. The endpoint computes and stores core analytics\nsuch as qubit count, depth, and gate counts, and it deduplicates by circuit\nhash within the authenticated user and experiment scope.\n\nThe returned object is a ``ContextCircuitModel``, which represents a\npersisted Haiqu circuit entity for MCP and API workflows rather than a raw\nQiskit ``QuantumCircuit`` instance. This Haiqu model carries stable IDs,\nexperiment ownership, stored analytics, and MCP context so later tools can\nreference the circuit directly without serializing or passing around the\nin-memory Qiskit circuit object itself.\n\nWhen to Use:\n - Call this when a workflow starts from inline QASM and needs a stable\n ``circuit_id`` for later MCP tools.\n - Call this before ``run_circuits_on_qpu_or_simulator`` or\n ``compress_circuit_with_state_compression`` when the circuit is not\n already stored.\n\nLarge circuits:\n There is no practical size limit on ``circuit_qasm``; payloads of\n thousands of QASM lines (tens of KB) are normal. Submit the requested\n circuit exactly as generated -- never substitute a smaller instance\n because the payload looks large. Send the QASM once here and pass the\n returned ``circuit_id`` to every later transpilation, compression, or\n run call so the payload never needs to be re-sent.\n\nConstraints:\n - ``experiment_id`` must refer to an accessible experiment owned by the\n authenticated caller.\n - Circuit deduplication is hash-based within the caller and experiment\n scope, so this route may return an existing circuit instead of\n creating a new row.\n\nNotes:\n - The response is the full ``ContextCircuitModel`` object, not a\n lightweight acknowledgment wrapper.\n - For agent-facing output, surface ``id``, ``name``, and the key\n analytics fields instead of repeating the raw QASM payload.\n\nArgs:\n user: Authenticated user resolved from the API key.\n data: Circuit payload containing the parent experiment ID, QASM source,\n and optional MCP context text.\n db: Active database session.\n\nReturns:\n The created or reused circuit object.\n\nRaises:\n HTTPException: Raised with ``400`` when the QASM payload cannot be\n parsed, or ``404`` when the parent experiment is not available to\n the caller.","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/submit_circuit_for_analytics","href":"/api-reference/submit-circuit-for-analytics","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n li: \"li\",\n p: \"p\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Submit a QASM circuit and persist core analytics for MCP workflows.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Use this tool when the caller has \", _jsx(_components.code, {\n children: \"experiment_id\"\n }), \" plus \", _jsx(_components.code, {\n children: \"circuit_qasm\"\n }), \"\\nand needs a persisted circuit before running, compressing, transpiling, or\\ninspecting related jobs. The endpoint computes and stores core analytics\\nsuch as qubit count, depth, and gate counts, and it deduplicates by circuit\\nhash within the authenticated user and experiment scope.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"The returned object is a \", _jsx(_components.code, {\n children: \"ContextCircuitModel\"\n }), \", which represents a\\npersisted Haiqu circuit entity for MCP and API workflows rather than a raw\\nQiskit \", _jsx(_components.code, {\n children: \"QuantumCircuit\"\n }), \" instance. This Haiqu model carries stable IDs,\\nexperiment ownership, stored analytics, and MCP context so later tools can\\nreference the circuit directly without serializing or passing around the\\nin-memory Qiskit circuit object itself.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"When to Use:\"\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [\"Call this when a workflow starts from inline QASM and needs a stable\\n\", _jsx(_components.code, {\n children: \"circuit_id\"\n }), \" for later MCP tools.\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Call this before \", _jsx(_components.code, {\n children: \"run_circuits_on_qpu_or_simulator\"\n }), \" or\\n\", _jsx(_components.code, {\n children: \"compress_circuit_with_state_compression\"\n }), \" when the circuit is not\\nalready stored.\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Large circuits:\\nThere is no practical size limit on \", _jsx(_components.code, {\n children: \"circuit_qasm\"\n }), \"; payloads of\\nthousands of QASM lines (tens of KB) are normal. Submit the requested\\ncircuit exactly as generated — never substitute a smaller instance\\nbecause the payload looks large. Send the QASM once here and pass the\\nreturned \", _jsx(_components.code, {\n children: \"circuit_id\"\n }), \" to every later transpilation, compression, or\\nrun call so the payload never needs to be re-sent.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"Constraints:\"\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"experiment_id\"\n }), \" must refer to an accessible experiment owned by the\\nauthenticated caller.\"]\n }), \"\\n\", _jsx(_components.li, {\n children: \"Circuit deduplication is hash-based within the caller and experiment\\nscope, so this route may return an existing circuit instead of\\ncreating a new row.\"\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"Notes:\"\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [\"The response is the full \", _jsx(_components.code, {\n children: \"ContextCircuitModel\"\n }), \" object, not a\\nlightweight acknowledgment wrapper.\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"For agent-facing output, surface \", _jsx(_components.code, {\n children: \"id\"\n }), \", \", _jsx(_components.code, {\n children: \"name\"\n }), \", and the key\\nanalytics fields instead of repeating the raw QASM payload.\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"Args:\\nuser: Authenticated user resolved from the API key.\\ndata: Circuit payload containing the parent experiment ID, QASM source,\\nand optional MCP context text.\\ndb: Active database session.\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"Returns:\\nThe created or reused circuit object.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Raises:\\nHTTPException: Raised with \", _jsx(_components.code, {\n children: \"400\"\n }), \" when the QASM payload cannot be\\nparsed, or \", _jsx(_components.code, {\n children: \"404\"\n }), \" when the parent experiment is not available to\\nthe caller.\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Submit Circuit For Analytics","description":"Submit a QASM circuit and persist core analytics for MCP workflows.\n\nUse this tool when the caller has ``experiment_id`` plus ``circuit_qasm``\nand needs a persisted circuit before running, compressing, transpiling, or\ninspecting related jobs. The endpoint computes and stores core analytics\nsuch as qubit count, depth, and gate counts, and it deduplicates by circuit\nhash within the authenticated user and experiment scope.\n\nThe returned object is a ``ContextCircuitModel``, which represents a\npersisted Haiqu circuit entity for MCP and API workflows rather than a raw\nQiskit ``QuantumCircuit`` instance. This Haiqu model carries stable IDs,\nexperiment ownership, stored analytics, and MCP context so later tools can\nreference the circuit directly without serializing or passing around the\nin-memory Qiskit circuit object itself.\n\nWhen to Use:\n - Call this when a workflow starts from inline QASM and needs a stable\n ``circuit_id`` for later MCP tools.\n - Call this before ``run_circuits_on_qpu_or_simulator`` or\n ``compress_circuit_with_state_compression`` when the circuit is not\n already stored.\n\nLarge circuits:\n There is no practical size limit on ``circuit_qasm``; payloads of\n thousands of QASM lines (tens of KB) are normal. Submit the requested\n circuit exactly as generated -- never substitute a smaller instance\n because the payload looks large. Send the QASM once here and pass the\n returned ``circuit_id`` to every later transpilation, compression, or\n run call so the payload never needs to be re-sent.\n\nConstraints:\n - ``experiment_id`` must refer to an accessible experiment owned by the\n authenticated caller.\n - Circuit deduplication is hash-based within the caller and experiment\n scope, so this route may return an existing circuit instead of\n creating a new row.\n\nNotes:\n - The response is the full ``ContextCircuitModel`` object, not a\n lightweight acknowledgment wrapper.\n - For agent-facing output, surface ``id``, ``name``, and the key\n analytics fields instead of repeating the raw QASM payload.\n\nArgs:\n user: Authenticated user resolved from the API key.\n data: Circuit payload containing the parent experiment ID, QASM source,\n and optional MCP context text.\n db: Active database session.\n\nReturns:\n The created or reused circuit object.\n\nRaises:\n HTTPException: Raised with ``400`` when the QASM payload cannot be\n parsed, or ``404`` when the parent experiment is not available to\n the caller.","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/submit_circuit_for_analytics","href":"/api-reference/submit-circuit-for-analytics","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/haiqu/cc26807bbccf8c6c/preload-fonts.js"],"openApiReferenceData":{"operation":{"summary":"Submit Circuit For Analytics","description":"Submit a QASM circuit and persist core analytics for MCP workflows.\n\nUse this tool when the caller has ``experiment_id`` plus ``circuit_qasm``\nand needs a persisted circuit before running, compressing, transpiling, or\ninspecting related jobs. The endpoint computes and stores core analytics\nsuch as qubit count, depth, and gate counts, and it deduplicates by circuit\nhash within the authenticated user and experiment scope.\n\nThe returned object is a ``ContextCircuitModel``, which represents a\npersisted Haiqu circuit entity for MCP and API workflows rather than a raw\nQiskit ``QuantumCircuit`` instance. This Haiqu model carries stable IDs,\nexperiment ownership, stored analytics, and MCP context so later tools can\nreference the circuit directly without serializing or passing around the\nin-memory Qiskit circuit object itself.\n\nWhen to Use:\n - Call this when a workflow starts from inline QASM and needs a stable\n ``circuit_id`` for later MCP tools.\n - Call this before ``run_circuits_on_qpu_or_simulator`` or\n ``compress_circuit_with_state_compression`` when the circuit is not\n already stored.\n\nLarge circuits:\n There is no practical size limit on ``circuit_qasm``; payloads of\n thousands of QASM lines (tens of KB) are normal. Submit the requested\n circuit exactly as generated -- never substitute a smaller instance\n because the payload looks large. Send the QASM once here and pass the\n returned ``circuit_id`` to every later transpilation, compression, or\n run call so the payload never needs to be re-sent.\n\nConstraints:\n - ``experiment_id`` must refer to an accessible experiment owned by the\n authenticated caller.\n - Circuit deduplication is hash-based within the caller and experiment\n scope, so this route may return an existing circuit instead of\n creating a new row.\n\nNotes:\n - The response is the full ``ContextCircuitModel`` object, not a\n lightweight acknowledgment wrapper.\n - For agent-facing output, surface ``id``, ``name``, and the key\n analytics fields instead of repeating the raw QASM payload.\n\nArgs:\n user: Authenticated user resolved from the API key.\n data: Circuit payload containing the parent experiment ID, QASM source,\n and optional MCP context text.\n db: Active database session.\n\nReturns:\n The created or reused circuit object.\n\nRaises:\n HTTPException: Raised with ``400`` when the QASM payload cannot be\n parsed, or ``404`` when the parent experiment is not available to\n the caller.","operationId":"submit_circuit_for_analytics","requestBody":"9672d38d-d522-4d54-99a4-754e46a775a7","responses":{"200":"7cf9f89d-f581-4f7c-8d85-7c7ba8d55b6e","422":"d751b8b0-54fe-4b63-95ee-da7f2339ba98"},"security":["3c3a2b36-6531-469d-ab24-d58c1206815d","dfe2e27a-cce1-44df-9382-d1af021b572d"],"method":"post","type":"path","servers":[],"path":"/ai/submit_circuit_for_analytics","baseUrlOptions":[],"title":"Submit Circuit For Analytics","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"properties":{"experiment_id":{"type":"string","title":"Experiment Id","isRequired":true,"uniqueKey":"experiment_id","typeLabel":"string"},"circuit_qasm":{"type":"string","title":"Circuit Qasm","description":"Quantum circuit source in QASM 2.0 or 3.0 format.","isRequired":true,"uniqueKey":"circuit_qasm","typeLabel":"string"},"name":{"type":"string","title":"Name","isRequired":true,"uniqueKey":"name","typeLabel":"string"},"context":{"type":"string","title":"Context","isRequired":true,"uniqueKey":"context","typeLabel":"string"},"description":{"oneOf":[{"type":"string","title":"Description","description":"Optional plain-text circuit description.","uniqueKey":"description.oneOf.0","typeLabel":"string"},{"type":"null","title":"Description","description":"Optional plain-text circuit description.","uniqueKey":"description.oneOf.1","typeLabel":"null"}],"uniqueKey":"description","typeLabel":"string | null"}},"type":"object","required":["experiment_id","circuit_qasm","name","context"],"title":"ContextCircuitSubmitModel","description":"Define payload for creating an MCP circuit from QASM.\n\nAttributes:\n experiment_id: Parent experiment identifier.\n circuit_qasm: Quantum circuit source in QASM format.\n name: circuit name.\n description: Optional circuit description.\n context: Agent-facing reason for creating the circuit.","examples":[{"circuit_qasm":"OPENQASM 3;\nqubit[2] q;\nh q[0];\ncx q[0], q[1];","context":"Persist this Bell-state circuit so it can be executed and compared after compression.","description":"Simple entangling circuit used for analytics and run tests.","experiment_id":"exp-123","name":"Bell state"}],"uniqueKey":"","typeLabel":"ContextCircuitSubmitModel · object"},"examples":{"Example":{"title":"Example","value":{"circuit_qasm":"OPENQASM 3;\nqubit[2] q;\nh q[0];\ncx q[0], q[1];","context":"Persist this Bell-state circuit so it can be executed and compared after compression.","description":"Simple entangling circuit used for analytics and run tests.","experiment_id":"exp-123","name":"Bell state"}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"7cf9f89d-f581-4f7c-8d85-7c7ba8d55b6e":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"id":{"type":"string","title":"Id","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"hash":{"type":"string","title":"Hash","isRequired":true,"uniqueKey":"hash","typeLabel":"string"},"name":{"type":"string","title":"Name","isRequired":true,"uniqueKey":"name","typeLabel":"string"},"creation_date":{"type":"string","format":"date-time","title":"Creation Date","isRequired":true,"uniqueKey":"creation_date","typeLabel":"string\u003cdate-time>"},"user_id":{"type":"integer","title":"User Id","isRequired":true,"uniqueKey":"user_id","typeLabel":"integer"},"experiment_id":{"type":"string","title":"Experiment Id","isRequired":true,"uniqueKey":"experiment_id","typeLabel":"string"},"status":{"type":"string","enum":["Submitted","Running analytics computation","Core metrics computation is done","Advanced metrics computation is done","Parameterized QML metrics computation is done","Evolution computation is done","Done","Error"],"title":"CircuitStatus","description":"Class for circuit analytics calculation job status.","isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"generated":{"type":"boolean","title":"Generated","isRequired":true,"uniqueKey":"generated","typeLabel":"boolean"},"context":{"type":"string","title":"Context","isRequired":true,"uniqueKey":"context","typeLabel":"string"},"description":{"oneOf":[{"type":"string","title":"Description","default":"","uniqueKey":"description.oneOf.0","typeLabel":"string"},{"type":"null","title":"Description","default":"","uniqueKey":"description.oneOf.1","typeLabel":"null"}],"uniqueKey":"description","typeLabel":"string | null"},"tags":{"oneOf":[{"type":"string","title":"Tags","default":"","uniqueKey":"tags.oneOf.0","typeLabel":"string"},{"type":"null","title":"Tags","default":"","uniqueKey":"tags.oneOf.1","typeLabel":"null"}],"uniqueKey":"tags","typeLabel":"string | null"},"parameters":{"oneOf":[{"type":"object","title":"Parameters","additionalProperties":true,"uniqueKey":"parameters.oneOf.0","typeLabel":"Parameters · object"},{"type":"null","title":"Parameters","uniqueKey":"parameters.oneOf.1","typeLabel":"null"}],"uniqueKey":"parameters","typeLabel":"Parameters · object | null"},"analytics":{"oneOf":[{"type":"object","title":"CircuitAnalyticsModel","description":"Data model for circuit metrics.","required":["qubits","depth","depth_2q","gates_1q","gates_2q","gates_total","other_ops"],"properties":{"qubits":{"type":"integer","minimum":1,"title":"Qubits","description":"Number of qubits (must be >= 1)","isRequired":true,"uniqueKey":"analytics.oneOf.0.qubits","typeLabel":"integer"},"depth":{"type":"integer","title":"Depth","isRequired":true,"uniqueKey":"analytics.oneOf.0.depth","typeLabel":"integer"},"depth_2q":{"type":"integer","title":"Depth 2Q","isRequired":true,"uniqueKey":"analytics.oneOf.0.depth_2q","typeLabel":"integer"},"gates_1q":{"type":"integer","title":"Gates 1Q","isRequired":true,"uniqueKey":"analytics.oneOf.0.gates_1q","typeLabel":"integer"},"gates_2q":{"type":"integer","title":"Gates 2Q","isRequired":true,"uniqueKey":"analytics.oneOf.0.gates_2q","typeLabel":"integer"},"gates_total":{"type":"integer","title":"Gates Total","isRequired":true,"uniqueKey":"analytics.oneOf.0.gates_total","typeLabel":"integer"},"other_ops":{"type":"integer","title":"Other Ops","isRequired":true,"uniqueKey":"analytics.oneOf.0.other_ops","typeLabel":"integer"},"num_qubits_active":{"oneOf":[{"type":"integer","title":"Num Qubits Active","uniqueKey":"analytics.oneOf.0.num_qubits_active.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Num Qubits Active","uniqueKey":"analytics.oneOf.0.num_qubits_active.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.num_qubits_active","typeLabel":"integer | null"},"num_parameters":{"oneOf":[{"type":"integer","title":"Num Parameters","uniqueKey":"analytics.oneOf.0.num_parameters.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Num Parameters","uniqueKey":"analytics.oneOf.0.num_parameters.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.num_parameters","typeLabel":"integer | null"},"other_gates":{"oneOf":[{"type":"integer","title":"Other Gates","uniqueKey":"analytics.oneOf.0.other_gates.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Other Gates","uniqueKey":"analytics.oneOf.0.other_gates.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.other_gates","typeLabel":"integer | null"},"instructions_total":{"oneOf":[{"type":"integer","title":"Instructions Total","uniqueKey":"analytics.oneOf.0.instructions_total.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Instructions Total","uniqueKey":"analytics.oneOf.0.instructions_total.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.instructions_total","typeLabel":"integer | null"},"operations_counts":{"oneOf":[{"type":"object","title":"Operations Counts","additionalProperties":true,"uniqueKey":"analytics.oneOf.0.operations_counts.oneOf.0","typeLabel":"Operations Counts · object"},{"type":"null","title":"Operations Counts","uniqueKey":"analytics.oneOf.0.operations_counts.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.operations_counts","typeLabel":"Operations Counts · object | null"},"gate_size_distribution":{"oneOf":[{"type":"object","title":"Gate Size Distribution","additionalProperties":{"type":"number","uniqueKey":"analytics.oneOf.0.gate_size_distribution.oneOf.0.additionalProperties","typeLabel":"number"},"uniqueKey":"analytics.oneOf.0.gate_size_distribution.oneOf.0","typeLabel":"Gate Size Distribution · object"},{"type":"null","title":"Gate Size Distribution","uniqueKey":"analytics.oneOf.0.gate_size_distribution.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.gate_size_distribution","typeLabel":"Gate Size Distribution · object | null"},"gate_diversity":{"oneOf":[{"type":"object","title":"Gate Diversity","additionalProperties":{"type":"number","uniqueKey":"analytics.oneOf.0.gate_diversity.oneOf.0.additionalProperties","typeLabel":"number"},"uniqueKey":"analytics.oneOf.0.gate_diversity.oneOf.0","typeLabel":"Gate Diversity · object"},{"type":"null","title":"Gate Diversity","uniqueKey":"analytics.oneOf.0.gate_diversity.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.gate_diversity","typeLabel":"Gate Diversity · object | null"},"gate_diversity_basis_gates":{"oneOf":[{"type":"object","title":"Gate Diversity Basis Gates","additionalProperties":{"type":"number","uniqueKey":"analytics.oneOf.0.gate_diversity_basis_gates.oneOf.0.additionalProperties","typeLabel":"number"},"uniqueKey":"analytics.oneOf.0.gate_diversity_basis_gates.oneOf.0","typeLabel":"Gate Diversity Basis Gates · object"},{"type":"null","title":"Gate Diversity Basis Gates","uniqueKey":"analytics.oneOf.0.gate_diversity_basis_gates.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.gate_diversity_basis_gates","typeLabel":"Gate Diversity Basis Gates · object | null"},"gate_count_distribution":{"oneOf":[{"type":"object","title":"Gate Count Distribution","additionalProperties":{"type":"integer","uniqueKey":"analytics.oneOf.0.gate_count_distribution.oneOf.0.additionalProperties","typeLabel":"integer"},"uniqueKey":"analytics.oneOf.0.gate_count_distribution.oneOf.0","typeLabel":"Gate Count Distribution · object"},{"type":"null","title":"Gate Count Distribution","uniqueKey":"analytics.oneOf.0.gate_count_distribution.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.gate_count_distribution","typeLabel":"Gate Count Distribution · object | null"},"program_communication":{"oneOf":[{"type":"number","title":"Program Communication","default":"N/A","uniqueKey":"analytics.oneOf.0.program_communication.oneOf.0","typeLabel":"number"},{"type":"string","title":"Program Communication","default":"N/A","uniqueKey":"analytics.oneOf.0.program_communication.oneOf.1","typeLabel":"string"},{"type":"null","title":"Program Communication","default":"N/A","uniqueKey":"analytics.oneOf.0.program_communication.oneOf.2","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.program_communication","typeLabel":"number | string | null"},"critical_depth":{"oneOf":[{"type":"number","title":"Critical Depth","default":"N/A","uniqueKey":"analytics.oneOf.0.critical_depth.oneOf.0","typeLabel":"number"},{"type":"string","title":"Critical Depth","default":"N/A","uniqueKey":"analytics.oneOf.0.critical_depth.oneOf.1","typeLabel":"string"},{"type":"null","title":"Critical Depth","default":"N/A","uniqueKey":"analytics.oneOf.0.critical_depth.oneOf.2","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.critical_depth","typeLabel":"number | string | null"},"entanglement_ratio":{"oneOf":[{"type":"number","title":"Entanglement Ratio","default":"N/A","uniqueKey":"analytics.oneOf.0.entanglement_ratio.oneOf.0","typeLabel":"number"},{"type":"string","title":"Entanglement Ratio","default":"N/A","uniqueKey":"analytics.oneOf.0.entanglement_ratio.oneOf.1","typeLabel":"string"},{"type":"null","title":"Entanglement Ratio","default":"N/A","uniqueKey":"analytics.oneOf.0.entanglement_ratio.oneOf.2","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.entanglement_ratio","typeLabel":"number | string | null"},"parallelism":{"oneOf":[{"type":"number","title":"Parallelism","default":"N/A","uniqueKey":"analytics.oneOf.0.parallelism.oneOf.0","typeLabel":"number"},{"type":"string","title":"Parallelism","default":"N/A","uniqueKey":"analytics.oneOf.0.parallelism.oneOf.1","typeLabel":"string"},{"type":"null","title":"Parallelism","default":"N/A","uniqueKey":"analytics.oneOf.0.parallelism.oneOf.2","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.parallelism","typeLabel":"number | string | null"},"liveness_per_qubit":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"analytics.oneOf.0.liveness_per_qubit.oneOf.0.items.[INDEX]","typeLabel":"any"},"title":"Liveness Per Qubit","default":"N/A","uniqueKey":"analytics.oneOf.0.liveness_per_qubit.oneOf.0","typeLabel":"any[]"},{"type":"string","title":"Liveness Per Qubit","default":"N/A","uniqueKey":"analytics.oneOf.0.liveness_per_qubit.oneOf.1","typeLabel":"string"},{"type":"null","title":"Liveness Per Qubit","default":"N/A","uniqueKey":"analytics.oneOf.0.liveness_per_qubit.oneOf.2","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.liveness_per_qubit","typeLabel":"any[] | string | null"},"liveness":{"oneOf":[{"type":"number","title":"Liveness","default":"N/A","uniqueKey":"analytics.oneOf.0.liveness.oneOf.0","typeLabel":"number"},{"type":"string","title":"Liveness","default":"N/A","uniqueKey":"analytics.oneOf.0.liveness.oneOf.1","typeLabel":"string"},{"type":"null","title":"Liveness","default":"N/A","uniqueKey":"analytics.oneOf.0.liveness.oneOf.2","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.liveness","typeLabel":"number | string | null"},"correlation_matrix":{"oneOf":[{"type":"object","title":"Correlation Matrix","additionalProperties":true,"uniqueKey":"analytics.oneOf.0.correlation_matrix.oneOf.0","typeLabel":"Correlation Matrix · object"},{"type":"null","title":"Correlation Matrix","uniqueKey":"analytics.oneOf.0.correlation_matrix.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.correlation_matrix","typeLabel":"Correlation Matrix · object | null"},"kl_divergence":{"oneOf":[{"type":"number","title":"Kl Divergence","default":"N/A","uniqueKey":"analytics.oneOf.0.kl_divergence.oneOf.0","typeLabel":"number"},{"type":"string","title":"Kl Divergence","default":"N/A","uniqueKey":"analytics.oneOf.0.kl_divergence.oneOf.1","typeLabel":"string"},{"type":"null","title":"Kl Divergence","default":"N/A","uniqueKey":"analytics.oneOf.0.kl_divergence.oneOf.2","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.kl_divergence","typeLabel":"number | string | null"},"entanglement_capability":{"oneOf":[{"type":"number","title":"Entanglement Capability","default":"N/A","uniqueKey":"analytics.oneOf.0.entanglement_capability.oneOf.0","typeLabel":"number"},{"type":"string","title":"Entanglement Capability","default":"N/A","uniqueKey":"analytics.oneOf.0.entanglement_capability.oneOf.1","typeLabel":"string"},{"type":"null","title":"Entanglement Capability","default":"N/A","uniqueKey":"analytics.oneOf.0.entanglement_capability.oneOf.2","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.entanglement_capability","typeLabel":"number | string | null"},"expressibility":{"oneOf":[{"type":"number","title":"Expressibility","default":"N/A","uniqueKey":"analytics.oneOf.0.expressibility.oneOf.0","typeLabel":"number"},{"type":"string","title":"Expressibility","default":"N/A","uniqueKey":"analytics.oneOf.0.expressibility.oneOf.1","typeLabel":"string"},{"type":"null","title":"Expressibility","default":"N/A","uniqueKey":"analytics.oneOf.0.expressibility.oneOf.2","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.expressibility","typeLabel":"number | string | null"},"quantum_fisher_information_matrix":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"analytics.oneOf.0.quantum_fisher_information_matrix.oneOf.0.items.[INDEX]","typeLabel":"any"},"title":"Quantum Fisher Information Matrix","default":"N/A","uniqueKey":"analytics.oneOf.0.quantum_fisher_information_matrix.oneOf.0","typeLabel":"any[]"},{"type":"string","title":"Quantum Fisher Information Matrix","default":"N/A","uniqueKey":"analytics.oneOf.0.quantum_fisher_information_matrix.oneOf.1","typeLabel":"string"},{"type":"null","title":"Quantum Fisher Information Matrix","default":"N/A","uniqueKey":"analytics.oneOf.0.quantum_fisher_information_matrix.oneOf.2","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.quantum_fisher_information_matrix","typeLabel":"any[] | string | null"},"circuit_normalized":{"oneOf":[{"type":"string","title":"Circuit Normalized","uniqueKey":"analytics.oneOf.0.circuit_normalized.oneOf.0","typeLabel":"string"},{"type":"null","title":"Circuit Normalized","uniqueKey":"analytics.oneOf.0.circuit_normalized.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics.oneOf.0.circuit_normalized","typeLabel":"string | null"}},"uniqueKey":"analytics.oneOf.0","typeLabel":"CircuitAnalyticsModel · object"},{"type":"null","uniqueKey":"analytics.oneOf.1","typeLabel":"null"}],"uniqueKey":"analytics","typeLabel":"CircuitAnalyticsModel · object | null"},"transpilation_target":{"oneOf":[{"type":"string","title":"Transpilation Target","uniqueKey":"transpilation_target.oneOf.0","typeLabel":"string"},{"type":"null","title":"Transpilation Target","uniqueKey":"transpilation_target.oneOf.1","typeLabel":"null"}],"uniqueKey":"transpilation_target","typeLabel":"string | null"},"transpilation_options":{"oneOf":[{"type":"object","title":"Transpilation Options","additionalProperties":true,"uniqueKey":"transpilation_options.oneOf.0","typeLabel":"Transpilation Options · object"},{"type":"null","title":"Transpilation Options","uniqueKey":"transpilation_options.oneOf.1","typeLabel":"null"}],"uniqueKey":"transpilation_options","typeLabel":"Transpilation Options · object | null"},"transpiled_circuit_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"transpiled_circuit_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Transpiled Circuit Ids","uniqueKey":"transpiled_circuit_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Transpiled Circuit Ids","uniqueKey":"transpiled_circuit_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"transpiled_circuit_ids","typeLabel":"string[] | null"},"compressed_circuit_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"compressed_circuit_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Compressed Circuit Ids","uniqueKey":"compressed_circuit_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Compressed Circuit Ids","uniqueKey":"compressed_circuit_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"compressed_circuit_ids","typeLabel":"string[] | null"},"job_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"job_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Job Ids","uniqueKey":"job_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Job Ids","uniqueKey":"job_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"job_ids","typeLabel":"string[] | null"}},"type":"object","required":["id","hash","name","creation_date","user_id","experiment_id","status","generated","context"],"title":"ContextCircuitModel","description":"Extend a stored circuit model with MCP context text.\n\nAttributes:\n context: ai summary describing the circuit role in the workflow.","uniqueKey":"","typeLabel":"ContextCircuitModel · object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","hash":"\u003cstring>","name":"\u003cstring>","creation_date":"2023-11-07T05:31:56Z","user_id":123,"experiment_id":"\u003cstring>","status":"Submitted","generated":true,"context":"\u003cstring>","description":"","tags":"","parameters":{},"analytics":{"qubits":2,"depth":123,"depth_2q":123,"gates_1q":123,"gates_2q":123,"gates_total":123,"other_ops":123,"num_qubits_active":123,"num_parameters":123,"other_gates":123,"instructions_total":123,"operations_counts":{},"gate_size_distribution":{},"gate_diversity":{},"gate_diversity_basis_gates":{},"gate_count_distribution":{},"program_communication":"N/A","critical_depth":"N/A","entanglement_ratio":"N/A","parallelism":"N/A","liveness_per_qubit":"N/A","liveness":"N/A","correlation_matrix":{},"kl_divergence":"N/A","entanglement_capability":"N/A","expressibility":"N/A","quantum_fisher_information_matrix":"N/A","circuit_normalized":"\u003cstring>"},"transpilation_target":"\u003cstring>","transpilation_options":{},"transpiled_circuit_ids":["\u003cstring>"],"compressed_circuit_ids":["\u003cstring>"],"job_ids":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"d751b8b0-54fe-4b63-95ee-da7f2339ba98":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"oneOf":[{"type":"string","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"detail.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"type":"array","title":"Location","isRequired":true,"uniqueKey":"detail.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"detail.items.[INDEX].msg","typeLabel":"string"},"type":{"type":"string","title":"Error Type","isRequired":true,"uniqueKey":"detail.items.[INDEX].type","typeLabel":"string"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","uniqueKey":"detail.items.[INDEX]","typeLabel":"ValidationError · object"},"type":"array","title":"Detail","uniqueKey":"detail","typeLabel":"ValidationError · object[]"}},"type":"object","title":"HTTPValidationError","uniqueKey":"","typeLabel":"HTTPValidationError · object"},"examples":{"Example":{"title":"Example","value":{"detail":[{"loc":["\u003cstring>"],"msg":"\u003cstring>","type":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"3c3a2b36-6531-469d-ab24-d58c1206815d":{"APIKeyQuery":{"type":"apiKey","in":"query","name":"HAIQU_API_KEY","scopes":[],"schemeName":"APIKeyQuery"}},"dfe2e27a-cce1-44df-9382-d1af021b572d":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"authorization","scopes":[],"schemeName":"APIKeyHeader"}}},"servers":{},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"query","name":"HAIQU_API_KEY","scopes":[],"schemeName":"APIKeyQuery"},"schema":{"title":"HAIQU_API_KEY","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"APIKeyQuery","name":"HAIQU_API_KEY"}],"title":"APIKeyQuery"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"authorization","scopes":[],"schemeName":"APIKeyHeader"},"schema":{"title":"authorization","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"APIKeyHeader","name":"authorization"}],"title":"APIKeyHeader"}]},"originalFileLocation":"https://api.haiqu.ai/openapi.json"},"subdomain":"haiqu","siteName":"Haiqu","title":"Submit Circuit For Analytics - Haiqu","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-23T09:20:14.245Z","originalFileLocation":"api-reference/submit-circuit-for-analytics.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Submit a QASM circuit and persist core analytics for MCP workflows. Use this tool when the caller has experiment_id plus circuit_qasm and needs a persisted circuit before running, compressing, transpiling, or inspecting related jobs. The endpoint computes and stores core analytics such as qubit count, depth, and gate counts, and it deduplicates by circuit hash within the authenticated user and experiment scope. The returned object is a ContextCircuitModel, which represents a persisted Haiqu circuit entity for MCP and API workflows rather than a raw Qiskit QuantumCircuit instance. This Haiqu model carries stable IDs, experiment ownership, stored analytics, and MCP context so later tools can reference the circuit directly without serializing or passing around the in-memory Qiskit circuit object itself. When to Use: - Call this when a workflow starts from inline QASM and needs a stable circuit_id for later MCP tools. - Call this before run_circuits_on_qpu_or_simulator or compress_circuit_with_state_compression when the circuit is not already stored. Large circuits: There is no practical size limit on circuit_qasm; payloads of thousands of QASM lines (tens of KB) are normal. Submit the requested circuit exactly as generated -- never substitute a smaller instance because the payload looks large. Send the QASM once here and pass the returned circuit_id to every later transpilation, compression, or run call so the payload never needs to be re-sent. Constraints: - experiment_id must refer to an accessible experiment owned by the authenticated caller. - Circuit deduplication is hash-based within the caller and experiment scope, so this route may return an existing circuit instead of creating a new row. Notes: - The response is the full ContextCircuitModel object, not a lightweight acknowledgment wrapper. - For agent-facing output, surface id, name, and the key analytics fields instead of repeating the raw QASM payload. Args: user: Authenticated user resolved from the API key. data: Circuit payload containing the parent experiment ID, QASM source, and optional MCP context text. db: Active database session. Returns: The created or reused circuit object. Raises: HTTPException: Raised with 400 when the QASM payload cannot be parsed, or 404 when the parent experiment is not available to the caller.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Haiqu\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/haiqu/oEFiEtbJmeciuADt/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/haiqu/oEFiEtbJmeciuADt/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/haiqu/oEFiEtbJmeciuADt/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/haiqu/oEFiEtbJmeciuADt/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/haiqu/oEFiEtbJmeciuADt/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/haiqu/oEFiEtbJmeciuADt/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/haiqu/oEFiEtbJmeciuADt/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/haiqu/oEFiEtbJmeciuADt/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/haiqu/oEFiEtbJmeciuADt/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Submit Circuit For Analytics - Haiqu\">\u003cmeta data-mint-head property=\"og:description\" content=\"Submit a QASM circuit and persist core analytics for MCP workflows. Use this tool when the caller has experiment_id plus circuit_qasm and needs a persisted circuit before running, compressing, transpiling, or inspecting related jobs. The endpoint computes and stores core analytics such as qubit count, depth, and gate counts, and it deduplicates by circuit hash within the authenticated user and experiment scope. The returned object is a ContextCircuitModel, which represents a persisted Haiqu circuit entity for MCP and API workflows rather than a raw Qiskit QuantumCircuit instance. This Haiqu model carries stable IDs, experiment ownership, stored analytics, and MCP context so later tools can reference the circuit directly without serializing or passing around the in-memory Qiskit circuit object itself. When to Use: - Call this when a workflow starts from inline QASM and needs a stable circuit_id for later MCP tools. - Call this before run_circuits_on_qpu_or_simulator or compress_circuit_with_state_compression when the circuit is not already stored. Large circuits: There is no practical size limit on circuit_qasm; payloads of thousands of QASM lines (tens of KB) are normal. Submit the requested circuit exactly as generated -- never substitute a smaller instance because the payload looks large. Send the QASM once here and pass the returned circuit_id to every later transpilation, compression, or run call so the payload never needs to be re-sent. Constraints: - experiment_id must refer to an accessible experiment owned by the authenticated caller. - Circuit deduplication is hash-based within the caller and experiment scope, so this route may return an existing circuit instead of creating a new row. Notes: - The response is the full ContextCircuitModel object, not a lightweight acknowledgment wrapper. - For agent-facing output, surface id, name, and the key analytics fields instead of repeating the raw QASM payload. Args: user: Authenticated user resolved from the API key. data: Circuit payload containing the parent experiment ID, QASM source, and optional MCP context text. db: Active database session. Returns: The created or reused circuit object. Raises: HTTPException: Raised with 400 when the QASM payload cannot be parsed, or 404 when the parent experiment is not available to the caller.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Haiqu\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.haiqu.ai/api-reference/submit-circuit-for-analytics\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://haiqu.mintlify.app/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Submit+Circuit+For+Analytics\u0026amp;description=Submit+a+QASM+circuit+and+persist+core+analytics+for+MCP+workflows.%0A%0AUse+this+tool+when+the+caller+has+%60%60experiment_id%60%60+plus+%60%60circuit_qasm%60%60%0Aand+needs+a+persi\u0026amp;theme=a89afdb9c3ab85c54450697e\u0026amp;signature=70fe69dda742c8c4001108085be7fad01037ddada62221670ff9d50f59a6e6ce\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Submit Circuit For Analytics - Haiqu\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Submit a QASM circuit and persist core analytics for MCP workflows. Use this tool when the caller has experiment_id plus circuit_qasm and needs a persisted circuit before running, compressing, transpiling, or inspecting related jobs. The endpoint computes and stores core analytics such as qubit count, depth, and gate counts, and it deduplicates by circuit hash within the authenticated user and experiment scope. The returned object is a ContextCircuitModel, which represents a persisted Haiqu circuit entity for MCP and API workflows rather than a raw Qiskit QuantumCircuit instance. This Haiqu model carries stable IDs, experiment ownership, stored analytics, and MCP context so later tools can reference the circuit directly without serializing or passing around the in-memory Qiskit circuit object itself. When to Use: - Call this when a workflow starts from inline QASM and needs a stable circuit_id for later MCP tools. - Call this before run_circuits_on_qpu_or_simulator or compress_circuit_with_state_compression when the circuit is not already stored. Large circuits: There is no practical size limit on circuit_qasm; payloads of thousands of QASM lines (tens of KB) are normal. Submit the requested circuit exactly as generated -- never substitute a smaller instance because the payload looks large. Send the QASM once here and pass the returned circuit_id to every later transpilation, compression, or run call so the payload never needs to be re-sent. Constraints: - experiment_id must refer to an accessible experiment owned by the authenticated caller. - Circuit deduplication is hash-based within the caller and experiment scope, so this route may return an existing circuit instead of creating a new row. Notes: - The response is the full ContextCircuitModel object, not a lightweight acknowledgment wrapper. - For agent-facing output, surface id, name, and the key analytics fields instead of repeating the raw QASM payload. Args: user: Authenticated user resolved from the API key. data: Circuit payload containing the parent experiment ID, QASM source, and optional MCP context text. db: Active database session. Returns: The created or reused circuit object. Raises: HTTPException: Raised with 400 when the QASM payload cannot be parsed, or 404 when the parent experiment is not available to the caller.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://haiqu.mintlify.app/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Submit+Circuit+For+Analytics\u0026amp;description=Submit+a+QASM+circuit+and+persist+core+analytics+for+MCP+workflows.%0A%0AUse+this+tool+when+the+caller+has+%60%60experiment_id%60%60+plus+%60%60circuit_qasm%60%60%0Aand+needs+a+persi\u0026amp;theme=a89afdb9c3ab85c54450697e\u0026amp;signature=70fe69dda742c8c4001108085be7fad01037ddada62221670ff9d50f59a6e6ce\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/haiqu/oEFiEtbJmeciuADt/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Haiqu\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#000000\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.haiqu.ai/api-reference/submit-circuit-for-analytics\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/submit-circuit-for-analytics.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.haiqu.ai/#organization\",\"name\":\"Haiqu\",\"url\":\"https://docs.haiqu.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/haiqu/naR3-ajV6yLCfg5I/logo/logo-text-black.svg?fit=max\u0026auto=format\u0026n=naR3-ajV6yLCfg5I\u0026q=85\u0026s=2010ac2de39f76a994323bd9afa6aec1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.haiqu.ai#website\",\"name\":\"Haiqu\",\"url\":\"https://docs.haiqu.ai\",\"publisher\":{\"@id\":\"https://docs.haiqu.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.haiqu.ai/api-reference/submit-circuit-for-analytics#webpage\",\"url\":\"https://docs.haiqu.ai/api-reference/submit-circuit-for-analytics\",\"name\":\"Submit Circuit For Analytics\",\"description\":\"Submit a QASM circuit and persist core analytics for MCP workflows. Use this tool when the caller has experiment_id plus circuit_qasm and needs a persisted circuit before running, compressing, transpiling, or inspecting related jobs. The endpoint computes and stores core analytics such as qubit count, depth, and gate counts, and it deduplicates by circuit hash within the authenticated user and experiment scope. The returned object is a ContextCircuitModel, which represents a persisted Haiqu circuit entity for MCP and API workflows rather than a raw Qiskit QuantumCircuit instance. This Haiqu model carries stable IDs, experiment ownership, stored analytics, and MCP context so later tools can reference the circuit directly without serializing or passing around the in-memory Qiskit circuit object itself. When to Use: - Call this when a workflow starts from inline QASM and needs a stable circuit_id for later MCP tools. - Call this before run_circuits_on_qpu_or_simulator or compress_circuit_with_state_compression when the circuit is not already stored. Large circuits: There is no practical size limit on circuit_qasm; payloads of thousands of QASM lines (tens of KB) are normal. Submit the requested circuit exactly as generated -- never substitute a smaller instance because the payload looks large. Send the QASM once here and pass the returned circuit_id to every later transpilation, compression, or run call so the payload never needs to be re-sent. Constraints: - experiment_id must refer to an accessible experiment owned by the authenticated caller. - Circuit deduplication is hash-based within the caller and experiment scope, so this route may return an existing circuit instead of creating a new row. Notes: - The response is the full ContextCircuitModel object, not a lightweight acknowledgment wrapper. - For agent-facing output, surface id, name, and the key analytics fields instead of repeating the raw QASM payload. Args: user: Authenticated user resolved from the API key. data: Circuit payload containing the parent experiment ID, QASM source, and optional MCP context text. db: Active database session. Returns: The created or reused circuit object. Raises: HTTPException: Raised with 400 when the QASM payload cannot be parsed, or 404 when the parent experiment is not available to the caller.\",\"dateModified\":\"2026-10-23T09:20:14.245Z\",\"isPartOf\":{\"@id\":\"https://docs.haiqu.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.haiqu.ai/api-reference/submit-circuit-for-analytics#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.haiqu.ai/api-reference/submit-circuit-for-analytics#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.haiqu.ai/api-reference/submit-circuit\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Submit Circuit For Analytics\",\"item\":\"https://docs.haiqu.ai/api-reference/submit-circuit-for-analytics\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.haiqu.ai/api-reference/submit-circuit-for-analytics#apireference\",\"headline\":\"Submit Circuit For Analytics\",\"name\":\"Submit Circuit For Analytics\",\"description\":\"Submit a QASM circuit and persist core analytics for MCP workflows. Use this tool when the caller has experiment_id plus circuit_qasm and needs a persisted circuit before running, compressing, transpiling, or inspecting related jobs. The endpoint computes and stores core analytics such as qubit count, depth, and gate counts, and it deduplicates by circuit hash within the authenticated user and experiment scope. The returned object is a ContextCircuitModel, which represents a persisted Haiqu circuit entity for MCP and API workflows rather than a raw Qiskit QuantumCircuit instance. This Haiqu model carries stable IDs, experiment ownership, stored analytics, and MCP context so later tools can reference the circuit directly without serializing or passing around the in-memory Qiskit circuit object itself. When to Use: - Call this when a workflow starts from inline QASM and needs a stable circuit_id for later MCP tools. - Call this before run_circuits_on_qpu_or_simulator or compress_circuit_with_state_compression when the circuit is not already stored. Large circuits: There is no practical size limit on circuit_qasm; payloads of thousands of QASM lines (tens of KB) are normal. Submit the requested circuit exactly as generated -- never substitute a smaller instance because the payload looks large. Send the QASM once here and pass the returned circuit_id to every later transpilation, compression, or run call so the payload never needs to be re-sent. Constraints: - experiment_id must refer to an accessible experiment owned by the authenticated caller. - Circuit deduplication is hash-based within the caller and experiment scope, so this route may return an existing circuit instead of creating a new row. Notes: - The response is the full ContextCircuitModel object, not a lightweight acknowledgment wrapper. - For agent-facing output, surface id, name, and the key analytics fields instead of repeating the raw QASM payload. Args: user: Authenticated user resolved from the API key. data: Circuit payload containing the parent experiment ID, QASM source, and optional MCP context text. db: Active database session. Returns: The created or reused circuit object. Raises: HTTPException: Raised with 400 when the QASM payload cannot be parsed, or 404 when the parent experiment is not available to the caller.\",\"url\":\"https://docs.haiqu.ai/api-reference/submit-circuit-for-analytics\",\"mainEntityOfPage\":{\"@id\":\"https://docs.haiqu.ai/api-reference/submit-circuit-for-analytics#webpage\"},\"dateModified\":\"2026-10-23T09:20:14.245Z\",\"publisher\":{\"@id\":\"https://docs.haiqu.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.haiqu.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Haiqu\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Haiqu","nav":{"global":null,"tabs":[{"tab":"Welcome","pages":[{"title":"Welcome","href":""}]},{"tab":"Haiqu AgenticOS","pages":[{"title":"Haiqu AgenticOS","href":"/agentic-os"}]},{"tab":"Guides","versions":[{"version":"1.7.0","groups":[{"group":"Quick Start","pages":[{"title":"Get Started","href":"/quickstart/qs_intro"},{"title":"Local Installation","href":"/quickstart/qs_local"},{"title":"Update the SDK","href":"/quickstart/update-the-sdk"},{"title":"AI Assisted Development","href":"/quickstart/ai-assisted-development"}]},{"group":"Core features","pages":[{"title":"SDK Overview","href":"/core_features/overview"},{"title":"Dashboard Overview","href":"/dashboard-overview"},{"title":"Distribution Loading","href":"/core_features/data_loading_dist"},{"title":"Data Loading","href":"/core_features/data_loading_vect"},{"title":"Feature embedding","href":"/core_features/data_loading_isom"},{"title":"Compression","href":"/core_features/compression"},{"title":"Working with Haiqu Circuits","href":"/core_features/haiqu_circuits"},{"title":"Transpilation","href":"/core_features/transpilation"},{"title":"Measuring in different bases","href":"/core_features/readout_bases"},{"title":"Error Mitigation","href":"/core_features/error_shield"},{"title":"Variational algorithms","href":"/core_features/qml"},{"title":"SU(2)-equivariant gates","href":"/core_features/equivariant_gates"},{"title":"Optimization \u0026 Postprocessing","href":"/core_features/postprocessing"},{"title":"Experiment Tracking","href":"/core_features/exp_tracking"},{"title":"Experiment Sharing","href":"/core_features/experiment-sharing"},{"title":"Circuit Analytics","href":"/core_features/circ_analytics"},{"title":"Job Performance Metrics","href":"/core_features/quality"}]},{"group":"Hybrid programs","pages":[{"title":"Overview","href":"/hybrid/overview"},{"title":"Building and running flows","href":"/hybrid/flows"}]},{"group":"Integrations","pages":[{"title":"IBM Quantum","href":"/integrations/ibm"},{"title":"Amazon Braket","href":"/integrations/amazon"},{"title":"IonQ Cloud","href":"/integrations/ionq"},{"title":"IQM Resonance","href":"/integrations/iqm"}]},{"group":"Catalog","pages":[{"title":"QML building blocks","href":"/catalog/qml_building_blocks"},{"title":"Benchmarks data sheet","href":"/catalog/datasheet"},{"title":"Characteristic Functions","href":"/catalog/characteristic_functions"},{"title":"Multivariate Probability Distributions","href":"/catalog/multivariate_distributions"}]}]}]},{"tab":"Dashboard","pages":[{"title":"Dashboard","href":"/dashboard/overview"}]},{"tab":"SDK Reference","versions":[{"version":"1.7.0","groups":[{"group":"Core platform functions","pages":[{"title":"Login","href":"/reference/core/login"},{"title":"Init or Update Experiment","href":"/reference/core/init"},{"title":"Log Objects","href":"/reference/core/log"},{"title":"List Objects","href":"/reference/core/list"},{"title":"Get Objects","href":"/reference/core/get"},{"title":"Draw","href":"/reference/core/draw"},{"title":"Credentials Helpers","href":"/reference/core/credentials_helpers"},{"title":"Health Check","href":"/reference/core/health_check"}]},{"group":"Data loading","pages":[{"title":"Distribution Loading","href":"/reference/data/distribution"},{"title":"Multivariate Distribution Loading","href":"/reference/data/multivariate_distribution"},{"title":"Vector Loading","href":"/reference/data/vector"},{"title":"Block-wise Vector Loading","href":"/reference/data/block_vector"},{"title":"Entangled Manifold Embedding","href":"/reference/data/entangled_manifold_embedding"},{"title":"MPS Loading","href":"/reference/data/mps_loading"},{"title":"Function Loading","href":"/reference/data/function"},{"title":"Fourier Loading","href":"/reference/data/fourier"},{"title":"Circuit Synthesis Options","href":"/reference/data/synthesis_options"}]},{"group":"Middleware","pages":[{"title":"State Compression","href":"/reference/middleware/compression"},{"title":"Observable Backpropagation","href":"/reference/middleware/observable-backpropagation"}]},{"group":"Circuit Execution","pages":[{"title":"Flow","href":"/reference/run/flow"},{"title":"Hybrid Program","href":"/reference/run/hybrid_program"},{"title":"Run","href":"/reference/run/run"},{"title":"Statevector Run","href":"/reference/run/statevector_run"},{"title":"Transpile","href":"/reference/run/transpile"}]},{"group":"Optimization","pages":[{"title":"Problem Formulations","href":"/reference/optimization/problem"},{"title":"Postprocessing","href":"/reference/optimization/postprocessing"}]},{"group":"Variational Algorithms","pages":[{"title":"Variational Quantum Optimization","href":"/reference/qml/variational"},{"title":"SU(2)-equivariant gates","href":"/reference/qml/equivariant"},{"title":"Pretrain","href":"/reference/qml/pretrain"}]},{"group":"SKQD","pages":[{"title":"Postprocessing","href":"/reference/skqd/postprocess_skqd"},{"title":"Configuration recovery","href":"/reference/skqd/configuration_recovery"},{"title":"Hubbard Model","href":"/reference/skqd/hubbard"},{"title":"SIAM Model","href":"/reference/skqd/siam"},{"title":"SKQD Helpers","href":"/reference/skqd/helpers"}]}]}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"Submit Circuit","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /circuits","href":"/api-reference/submit-circuit"},{"title":"Transpile Circuit","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /circuits/transpile","href":"/api-reference/transpile-circuit"},{"title":"Build Lr Qaoa Circuit","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /circuits/lr_qaoa","href":"/api-reference/build-lr-qaoa-circuit"},{"title":"Backpropagate Observables","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /circuits/{circuit_id}/backpropagate_observables","href":"/api-reference/backpropagate-observables"},{"title":"Compute Analytics","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /circuits/{circuit_id}/compute_analytics/{analytics_type}","href":"/api-reference/compute-analytics"},{"title":"Get Circuit","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /circuits/{circuit_id}","href":"/api-reference/get-circuit"},{"title":"Delete Circuit","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json delete /circuits/{circuit_id}","href":"/api-reference/delete-circuit"},{"title":"Get Circuit By Hash","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /experiments/{experiment_id}/circuits/{circuit_hash}","href":"/api-reference/get-circuit-by-hash"},{"title":"Post Metrics","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /experiments/{experiment_id}/circuits/{circuit_hash}/metrics","href":"/api-reference/post-metrics"},{"title":"Get Analytics","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /circuits/{circuit_id}/metrics","href":"/api-reference/get-analytics"},{"title":"Get Metrics Evolution","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /circuits/{circuit_id}/metrics_evolution","href":"/api-reference/get-metrics-evolution"},{"title":"Collect Csp Report","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /csp","href":"/api-reference/collect-csp-report"},{"title":"List Devices Endpoint","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /devices","href":"/api-reference/list-devices-endpoint"},{"title":"Get Device Endpoint","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /devices/{device_id}","href":"/api-reference/get-device-endpoint"},{"title":"Get Device Gate Map","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /devices/{device_id}/gate_map","href":"/api-reference/get-device-gate-map"},{"title":"List Experiments","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /experiments","href":"/api-reference/list-experiments"},{"title":"Create Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /experiments","href":"/api-reference/create-experiment"},{"title":"Init Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /experiments/init","href":"/api-reference/init-experiment"},{"title":"Get Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /experiments/{experiment_id}","href":"/api-reference/get-experiment"},{"title":"Update Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json put /experiments/{experiment_id}","href":"/api-reference/update-experiment"},{"title":"Delete Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json delete /experiments/{experiment_id}","href":"/api-reference/delete-experiment"},{"title":"Post Metrics","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /experiments/{experiment_id}/metrics","href":"/api-reference/post-metrics-1"},{"title":"List Circuits","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /experiments/{experiment_id}/circuits","href":"/api-reference/list-circuits"},{"title":"List Jobs","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /experiments/{experiment_id}/jobs","href":"/api-reference/list-jobs"},{"title":"List Artifacts","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /experiments/{experiment_id}/artifacts","href":"/api-reference/list-artifacts"},{"title":"Get Artifact","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /experiments/{experiment_id}/artifacts/{artifact_name}","href":"/api-reference/get-artifact"},{"title":"Submit Local Job","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /jobs","href":"/api-reference/submit-local-job"},{"title":"Post Metrics","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /experiments/{experiment_id}/jobs/{job_id}/metrics","href":"/api-reference/post-metrics-2"},{"title":"Get Job","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /jobs/{job_id}","href":"/api-reference/get-job"},{"title":"Get Local Job By Hash","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /experiments/{experiment_id}/jobs/{job_hash}","href":"/api-reference/get-local-job-by-hash"},{"title":"Cancel Job","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /jobs/{job_id}/cancel","href":"/api-reference/cancel-job"},{"title":"Restart Job","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /jobs/{job_id}/restart","href":"/api-reference/restart-job"},{"title":"Get User","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /user","href":"/api-reference/get-user"},{"title":"Data Loading","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /data_loading","href":"/api-reference/data-loading"},{"title":"Data Loading Estimates","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /data_loading_estimates","href":"/api-reference/data-loading-estimates"},{"title":"Flow","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /flow","href":"/api-reference/flow"},{"title":"Run","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /run","href":"/api-reference/run"},{"title":"Compression","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /compression","href":"/api-reference/compression"},{"title":"Compression Estimates","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /compression_estimates","href":"/api-reference/compression-estimates"},{"title":"Postprocess Counts","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /postprocess","href":"/api-reference/postprocess-counts"},{"title":"Variational","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /variational","href":"/api-reference/variational"},{"title":"Pretraining","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /pretraining","href":"/api-reference/pretraining"},{"title":"Postprocess Skqd","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /postprocess_skqd","href":"/api-reference/postprocess-skqd"},{"title":"Create New Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/create_new_experiment","href":"/api-reference/create-new-experiment"},{"title":"List Experiments Mcp","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/","href":"/api-reference/list-experiments-mcp"},{"title":"Get Experiment By Name","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/by_name/{experiment_name}","href":"/api-reference/get-experiment-by-name"},{"title":"Get Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/{experiment_id}","href":"/api-reference/get-experiment-1"},{"title":"Update Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json put /ai/{experiment_id}","href":"/api-reference/update-experiment-1"},{"title":"Get Experiment Url On Dashboard By Name","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/dashboard_url_by_name/{experiment_name}","href":"/api-reference/get-experiment-url-on-dashboard-by-name"},{"title":"List Circuits In Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/{experiment_id}/circuits","href":"/api-reference/list-circuits-in-experiment"},{"title":"List Jobs","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/{experiment_id}/jobs","href":"/api-reference/list-jobs-1"},{"title":"Log Artifact In Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/{experiment_id}/log_artifact","href":"/api-reference/log-artifact-in-experiment"},{"title":"List Artifacts In Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/{experiment_id}/artifacts","href":"/api-reference/list-artifacts-in-experiment"},{"title":"Get Artifact In Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/{experiment_id}/artifact","href":"/api-reference/get-artifact-in-experiment"},{"title":"Get Artifact Content In Experiment","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/{experiment_id}/artifact/content","href":"/api-reference/get-artifact-content-in-experiment"},{"title":"Get Artifact Download Url In Experiment","description":"Get a fetchable URL for the bytes of a binary artifact.\n\nUse this tool when the caller needs the actual content of an image or file\nartifact, for example to view a plot logged during an experiment. Tool\nresults are text, so this returns a URL to fetch rather than the bytes\nthemselves.\n\nWhen to Use:\n - Call this after ``list_artifacts_in_experiment`` or\n ``get_artifact_in_experiment`` identifies an artifact whose ``kind`` is\n a media family such as ``image``, rather than ``value`` or\n ``timeseries``.\n - Call this when the user asks to see, open, or download a logged file or\n image.\n\nConstraints:\n - Scalar and timeseries artifacts carry their data in\n ``get_artifact_in_experiment`` already and are rejected here with\n ``422``.\n - Pre-signed URLs expire. Re-call this tool instead of reusing a stale\n URL.\n\nNotes:\n - For artifacts stored inline rather than in object storage, the returned\n URL is a relative API path and ``requires_auth_header`` is true, which\n means it must be fetched with the caller's ``authorization`` header.\n - Surface the URL to the user; do not attempt to inline binary content\n into agent-facing output.\n\nArgs:\n experiment_id: Parent experiment identifier.\n artifact_name: Artifact key within experiment metrics.\n user: Authenticated user resolved from the API key.\n db: Active database session.\n\nReturns:\n The artifact name, MIME type, and a URL from which the bytes can be\n fetched.\n\nRaises:\n HTTPException: Raised with ``404`` when the experiment is unavailable to\n the caller or the artifact key is missing, or ``422`` when the\n artifact holds no binary content.","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/{experiment_id}/artifact/download_url","href":"/api-reference/get-artifact-download-url-in-experiment"},{"title":"Submit Circuit For Analytics","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/submit_circuit_for_analytics","href":"/api-reference/submit-circuit-for-analytics"},{"title":"Backpropagate Observables Mcp","description":"Backpropagate observables through a circuit to shorten what must be run.\n\nUse this tool to move part of the computation from the circuit into the\nobservable: Haiqu rewrites each observable through the tail of the circuit and\nstores a correspondingly shortened circuit. Running the shorter circuit with\nthe rewritten observable estimates the same expectation value with less\nhardware noise.\n\nWhen to Use:\n - Call this when the user wants expectation values from a circuit that is\n too deep to run faithfully on hardware.\n - Call this before ``run_circuits_on_qpu_or_simulator`` for\n expectation-value workloads, and pass the returned circuit and\n observable together.\n\nConstraints:\n - Backpropagation is synchronous and runs no quantum job.\n - Each input observable yields one output circuit, returned under the same\n key you gave the observable: run ``optimized_circuit_ids[name]`` with\n ``backpropagated_observables[name]``.\n - Truncation budgets trade accuracy for depth. Without\n ``max_error_total`` or ``max_error_per_slice`` the rewritten observable\n can grow large.\n\nNotes:\n - Pauli coefficients are given and returned as ``(pauli, real, imaginary)``\n triples, one per term -- not as the parallel ``(pauli_strings,\n coefficients)`` lists that ``run_variational_workload`` and\n ``run_circuits_on_qpu_or_simulator`` take.\n - Compare the returned circuits against the input with\n ``get_circuit_by_id`` to show how much depth was removed.\n\nArgs:\n user: Authenticated user resolved from the API key.\n data: Circuit identifier, observables, and optional truncation budgets.\n db: Active database session.\n\nReturns:\n The generated circuit IDs with their rewritten observables.\n\nRaises:\n HTTPException: Raised with ``404`` when the circuit is not available to\n the caller, ``422`` when an observable cannot be parsed, or ``501``\n when the backpropagation dependency is unavailable.","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/backpropagate_observables","href":"/api-reference/backpropagate-observables-mcp"},{"title":"Get Circuit By Id","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/circuit/{circuit_id}","href":"/api-reference/get-circuit-by-id"},{"title":"Get Circuit Metrics Evolution","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/circuit/{circuit_id}/metrics_evolution","href":"/api-reference/get-circuit-metrics-evolution"},{"title":"Compute Circuit Analytics","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/compute_circuit_analytics","href":"/api-reference/compute-circuit-analytics"},{"title":"List Children Circuits","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/circuit/{circuit_id}/children","href":"/api-reference/list-children-circuits"},{"title":"List Jobs For Circuit","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/circuit/{circuit_id}/jobs","href":"/api-reference/list-jobs-for-circuit"},{"title":"Transpile Circuits","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/transpile_circuits","href":"/api-reference/transpile-circuits"},{"title":"Get Job Results And Status","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/jobs/{job_id}/results","href":"/api-reference/get-job-results-and-status"},{"title":"Cancel Job","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/jobs/{job_id}/cancel","href":"/api-reference/cancel-job-1"},{"title":"Restart Job","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/jobs/{job_id}/restart","href":"/api-reference/restart-job-1"},{"title":"List Qpus And Simulators","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/list_qpus_and_simulators","href":"/api-reference/list-qpus-and-simulators"},{"title":"Get Device Details","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/device/{device_id}","href":"/api-reference/get-device-details"},{"title":"Run Circuits On Qpu Or Simulator","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/run_circuits_on_qpu_or_simulator","href":"/api-reference/run-circuits-on-qpu-or-simulator"},{"title":"Compress Circuit With State Compression","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/compress_circuit_with_state_compression","href":"/api-reference/compress-circuit-with-state-compression"},{"title":"Estimate State Compression","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/estimate_state_compression","href":"/api-reference/estimate-state-compression"},{"title":"Load Classical Data With Data Loading","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/load_classical_data_with_data_loading","href":"/api-reference/load-classical-data-with-data-loading"},{"title":"Estimate Data Loading","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/estimate_data_loading","href":"/api-reference/estimate-data-loading"},{"title":"List Haiqu Algorithms","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/qakb/algorithms","href":"/api-reference/list-haiqu-algorithms"},{"title":"Get Haiqu Algorithm Recipe","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /ai/qakb/algorithms/{algorithm_key}/recipe","href":"/api-reference/get-haiqu-algorithm-recipe"},{"title":"Build Lr Qaoa Circuit Mcp","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/build_lr_qaoa_circuit","href":"/api-reference/build-lr-qaoa-circuit-mcp"},{"title":"Postprocess Measurement Counts","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/postprocess_measurement_counts","href":"/api-reference/postprocess-measurement-counts"},{"title":"Run Variational Workload","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/run_variational_workload","href":"/api-reference/run-variational-workload"},{"title":"Postprocess Skqd Samples","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/postprocess_skqd_samples","href":"/api-reference/postprocess-skqd-samples"},{"title":"Run Hybrid Flow","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /ai/run_hybrid_flow","href":"/api-reference/run-hybrid-flow"},{"title":"Notify Certificate Code","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json post /certificate-codes/{code}/notify","href":"/api-reference/notify-certificate-code"},{"title":"Root","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /","href":"/api-reference/root"},{"title":"Version","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /version","href":"/api-reference/version"},{"title":"Get Benchmarks","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /help/benchmarks","href":"/api-reference/get-benchmarks"},{"title":"Health Live","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /health/live","href":"/api-reference/health-live"},{"title":"Health Ready","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /health/ready","href":"/api-reference/health-ready"},{"title":"Health Auth","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /health/auth","href":"/api-reference/health-auth"},{"title":"Mcp Meta","deprecated":null,"version":null,"openapi":"https://api.haiqu.ai/openapi.json get /mcp/meta","href":"/api-reference/mcp-meta"}]}]},{"tab":"Publications","pages":[{"title":"Publications","href":"/publications"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]},{"tab":"FAQ","pages":[{"title":"FAQ","href":"/faq"}]}]},"title":"Submit Circuit For Analytics - Haiqu","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-Bbp7I60D.js","utils-C3RIvJha.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DqD-vLt8.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B31Loprg.js","snippetPresets-DKpk-b8t.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Cj65AhOR.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BXtn5gcC.js","shallow-RY2b03Cp.js","getApiPlaygroundDisplay-B0jeiPk3.js","CodeSnippet-CYgBjjwn.js","CodeSnippets-DOngDrYB.js","Page-n7I5XbKb.js","getPastedJson-DRQbJx-T.js","icon-CQiQCicY.js","MethodPill-BKTLdNtu.js","DuplicateIcon-B9jpAdat.js","createIcon-DCddRrXv.js","DynamicMarkdown-a8hUKrw6.js","SectionHeading-eECVV2eH.js","axios-vUo_bRtp.js","Markdown--GF7ZIpf.js","clsx-DZLdJUrt.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-2LoAhjKH.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Zwc0ZncM.js"]}