curl --request POST \
--url 'https://api.example.com/ai/estimate_state_compression?HAIQU_API_KEY=' \
--header 'Content-Type: application/json' \
--data '
{
"num_qubits": 20,
"parameters": {
"max_bond_dimension": 64
}
}
'import requests
url = "https://api.example.com/ai/estimate_state_compression?HAIQU_API_KEY="
payload = {
"num_qubits": 20,
"parameters": { "max_bond_dimension": 64 }
}
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({num_qubits: 20, parameters: {max_bond_dimension: 64}})
};
fetch('https://api.example.com/ai/estimate_state_compression?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/estimate_state_compression?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([
'num_qubits' => 20,
'parameters' => [
'max_bond_dimension' => 64
]
]),
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/estimate_state_compression?HAIQU_API_KEY="
payload := strings.NewReader("{\n \"num_qubits\": 20,\n \"parameters\": {\n \"max_bond_dimension\": 64\n }\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/estimate_state_compression?HAIQU_API_KEY=")
.header("Content-Type", "application/json")
.body("{\n \"num_qubits\": 20,\n \"parameters\": {\n \"max_bond_dimension\": 64\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/ai/estimate_state_compression?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 \"num_qubits\": 20,\n \"parameters\": {\n \"max_bond_dimension\": 64\n }\n}"
response = http.request(request)
puts response.read_body{
"estimated_time": 123,
"estimated_cost": 123,
"context": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Estimate State Compression
Estimate the time and cost of a state-compression job before submitting it.
Use this tool to size a compression run up front. It creates no job, spends no credits, and needs no stored circuit — only the qubit count and the parameters planned for the real submission.
When to Use:
- Call this before
compress_circuit_with_state_compressionwhen the user asks how long compression will take or what it will cost. - Call this to compare candidate qubit counts before committing to one.
Constraints:
- The estimate is a projection from the qubit count, not a measurement of the specific circuit, so actual runtime varies with circuit structure.
- This tool is read-only and never creates a compression job.
Notes:
- Report the estimate in seconds and credits, and state plainly that it is an estimate rather than a quote.
Args: user: Authenticated user resolved from the API key. data: Qubit count and compression parameters to estimate.
Returns: The estimated time and cost with an explanatory context string.
curl --request POST \
--url 'https://api.example.com/ai/estimate_state_compression?HAIQU_API_KEY=' \
--header 'Content-Type: application/json' \
--data '
{
"num_qubits": 20,
"parameters": {
"max_bond_dimension": 64
}
}
'import requests
url = "https://api.example.com/ai/estimate_state_compression?HAIQU_API_KEY="
payload = {
"num_qubits": 20,
"parameters": { "max_bond_dimension": 64 }
}
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({num_qubits: 20, parameters: {max_bond_dimension: 64}})
};
fetch('https://api.example.com/ai/estimate_state_compression?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/estimate_state_compression?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([
'num_qubits' => 20,
'parameters' => [
'max_bond_dimension' => 64
]
]),
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/estimate_state_compression?HAIQU_API_KEY="
payload := strings.NewReader("{\n \"num_qubits\": 20,\n \"parameters\": {\n \"max_bond_dimension\": 64\n }\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/estimate_state_compression?HAIQU_API_KEY=")
.header("Content-Type", "application/json")
.body("{\n \"num_qubits\": 20,\n \"parameters\": {\n \"max_bond_dimension\": 64\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/ai/estimate_state_compression?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 \"num_qubits\": 20,\n \"parameters\": {\n \"max_bond_dimension\": 64\n }\n}"
response = http.request(request)
puts response.read_body{
"estimated_time": 123,
"estimated_cost": 123,
"context": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
Define payload for estimating a state-compression job.
Attributes: num_qubits: Qubit count of the circuit to be compressed. parameters: Compression parameters matching those planned for the real submission.
Response
Successful Response
Represent a pre-submission time and cost estimate.
Attributes: estimated_time: Estimated wall-clock computation time in seconds. estimated_cost: Estimated cost in Haiqu credits. context: Summary of what the estimate covers and how to act on it.